Web: Files: fixed files view after resize

This commit is contained in:
Nikita Gopienko 2022-02-10 14:03:25 +03:00
parent b066587fdc
commit 0d302d5549

View File

@ -9,6 +9,7 @@ import EmptyContainer from "../../../../components/EmptyContainer";
import withLoader from "../../../../HOCs/withLoader"; import withLoader from "../../../../HOCs/withLoader";
import TableView from "./TableView/TableContainer"; import TableView from "./TableView/TableContainer";
import withHotkeys from "../../../../HOCs/withHotkeys"; import withHotkeys from "../../../../HOCs/withHotkeys";
import { Consumer } from "@appserver/components/utils/context";
let currentDroppable = null; let currentDroppable = null;
@ -185,14 +186,23 @@ const SectionBodyContent = (props) => {
//console.log("Files Home SectionBodyContent render", props); //console.log("Files Home SectionBodyContent render", props);
return (!fileActionId && isEmptyFilesList) || null ? ( return (
<Consumer>
{(context) =>
(!fileActionId && isEmptyFilesList) || null ? (
<EmptyContainer /> <EmptyContainer />
) : viewAs === "tile" ? ( ) : viewAs === "tile" ? (
<FilesTileContainer t={t} /> <FilesTileContainer sectionWidth={context.sectionWidth} t={t} />
) : viewAs === "table" ? ( ) : viewAs === "table" ? (
<TableView tReady={tReady} /> <TableView sectionWidth={context.sectionWidth} tReady={tReady} />
) : ( ) : (
<FilesRowContainer tReady={tReady} /> <FilesRowContainer
sectionWidth={context.sectionWidth}
tReady={tReady}
/>
)
}
</Consumer>
); );
}; };