Web: Files: Templates: fixed selection
This commit is contained in:
parent
3e99932986
commit
b20acb4507
@ -46,6 +46,7 @@ const Card = ({ children, countTilesInRow, ...rest }) => {
|
||||
const isFile = child?.props?.className?.includes("file");
|
||||
const isFolder = child?.props?.className?.includes("folder");
|
||||
const isRoom = child?.props?.className?.includes("room");
|
||||
const isTemplate = child?.props?.className?.includes("room"); //TODO: Templates
|
||||
|
||||
const horizontalGap = 16;
|
||||
const verticalGap = 14;
|
||||
@ -53,9 +54,11 @@ const Card = ({ children, countTilesInRow, ...rest }) => {
|
||||
|
||||
const folderHeight = 64 + verticalGap;
|
||||
const roomHeight = 122 + verticalGap;
|
||||
const templateHeight = 128 + verticalGap;
|
||||
const fileHeight = 220 + horizontalGap;
|
||||
const titleHeight = 20 + headerMargin;
|
||||
|
||||
if (isTemplate) return templateHeight;
|
||||
if (isRoom) return roomHeight;
|
||||
if (isFolder) return folderHeight;
|
||||
if (isFile) return fileHeight;
|
||||
|
@ -115,8 +115,8 @@ const roomsStyles = css`
|
||||
`;
|
||||
|
||||
const FolderStyles = css`
|
||||
height: ${(props) => (props.isRoom ? "120px" : "64px")};
|
||||
height: 126px; //TODO: Templates
|
||||
height: ${({ isTemplate, isRoom }) =>
|
||||
isTemplate ? "126px" : isRoom ? "120px" : "64px"};
|
||||
`;
|
||||
|
||||
const FileStyles = css`
|
||||
|
@ -82,7 +82,7 @@ const SelectionArea = (props) => {
|
||||
{
|
||||
type: "folder",
|
||||
rowCount: Math.ceil(foldersLength / countTilesInRow),
|
||||
rowGap: 12,
|
||||
rowGap: isRooms ? 14 : 12,
|
||||
countOfMissingTiles: getCountOfMissingFilesTiles(foldersLength),
|
||||
},
|
||||
];
|
||||
|
@ -84,6 +84,7 @@ const GridComponent = ({
|
||||
const isFile = itemClassNames?.includes("isFile");
|
||||
const isFolder = itemClassNames?.includes("isFolder");
|
||||
const isRoom = itemClassNames?.includes("isRoom");
|
||||
const isTemplate = itemClassNames?.includes("isRoom"); //TODO: Templates
|
||||
const isFolderHeader = itemClassNames?.includes("folder_header");
|
||||
|
||||
const horizontalGap = 16;
|
||||
@ -92,9 +93,11 @@ const GridComponent = ({
|
||||
|
||||
const folderHeight = 64 + verticalGap;
|
||||
const roomHeight = 122 + verticalGap;
|
||||
const templateHeight = 128 + verticalGap;
|
||||
const fileHeight = 220 + horizontalGap;
|
||||
const titleHeight = 20 + headerMargin + (isFolderHeader ? 0 : 11);
|
||||
|
||||
if (isTemplate) return templateHeight;
|
||||
if (isRoom) return roomHeight;
|
||||
if (isFolder) return folderHeight;
|
||||
if (isFile) return fileHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user