diff --git a/web/apps/photos/src/components/Collections/styledComponents.ts b/web/apps/photos/src/components/Collections/styledComponents.ts index 936fb61e68..d7bfcbde94 100644 --- a/web/apps/photos/src/components/Collections/styledComponents.ts +++ b/web/apps/photos/src/components/Collections/styledComponents.ts @@ -1,6 +1,10 @@ import { Overlay } from "@ente/shared/components/Container"; import { Box, styled } from "@mui/material"; -import { IMAGE_CONTAINER_MAX_WIDTH, MIN_COLUMNS } from "components/PhotoList"; +import { + IMAGE_CONTAINER_MAX_WIDTH, + MIN_COLUMNS, +} from "components/PhotoList/constants"; + export const CollectionListWrapper = styled(Box)` position: relative; overflow: hidden; diff --git a/web/apps/photos/src/components/PhotoList/constants.ts b/web/apps/photos/src/components/PhotoList/constants.ts new file mode 100644 index 0000000000..6f88be0d89 --- /dev/null +++ b/web/apps/photos/src/components/PhotoList/constants.ts @@ -0,0 +1,8 @@ +export const GAP_BTW_TILES = 4; +export const DATE_CONTAINER_HEIGHT = 48; +export const SIZE_AND_COUNT_CONTAINER_HEIGHT = 72; +export const IMAGE_CONTAINER_MAX_HEIGHT = 180; +export const IMAGE_CONTAINER_MAX_WIDTH = 180; +export const MIN_COLUMNS = 4; +export const SPACE_BTW_DATES = 44; +export const SPACE_BTW_DATES_TO_IMAGE_CONTAINER_WIDTH_RATIO = 0.244; diff --git a/web/apps/photos/src/components/PhotoList/dedupe.tsx b/web/apps/photos/src/components/PhotoList/dedupe.tsx index bd42aa6f1b..25b8f1e8f4 100644 --- a/web/apps/photos/src/components/PhotoList/dedupe.tsx +++ b/web/apps/photos/src/components/PhotoList/dedupe.tsx @@ -19,7 +19,7 @@ import { MIN_COLUMNS, SIZE_AND_COUNT_CONTAINER_HEIGHT, SPACE_BTW_DATES, -} from "."; +} from "./constants"; export enum ITEM_TYPE { TIME = "TIME", diff --git a/web/apps/photos/src/components/PhotoList/index.tsx b/web/apps/photos/src/components/PhotoList/index.tsx index b0172fb873..01eb5bb7e4 100644 --- a/web/apps/photos/src/components/PhotoList/index.tsx +++ b/web/apps/photos/src/components/PhotoList/index.tsx @@ -20,14 +20,16 @@ const FOOTER_HEIGHT = 90; const ALBUM_FOOTER_HEIGHT = 75; const ALBUM_FOOTER_HEIGHT_WITH_REFERRAL = 113; -export const GAP_BTW_TILES = 4; -export const DATE_CONTAINER_HEIGHT = 48; -export const SIZE_AND_COUNT_CONTAINER_HEIGHT = 72; -export const IMAGE_CONTAINER_MAX_HEIGHT = 180; -export const IMAGE_CONTAINER_MAX_WIDTH = 180; -export const MIN_COLUMNS = 4; -export const SPACE_BTW_DATES = 44; -export const SPACE_BTW_DATES_TO_IMAGE_CONTAINER_WIDTH_RATIO = 0.244; +import { + DATE_CONTAINER_HEIGHT, + GAP_BTW_TILES, + IMAGE_CONTAINER_MAX_HEIGHT, + IMAGE_CONTAINER_MAX_WIDTH, + MIN_COLUMNS, + SIZE_AND_COUNT_CONTAINER_HEIGHT, + SPACE_BTW_DATES, + SPACE_BTW_DATES_TO_IMAGE_CONTAINER_WIDTH_RATIO, +} from "./constants"; export enum ITEM_TYPE { TIME = "TIME", diff --git a/web/apps/photos/src/components/SearchBar.tsx b/web/apps/photos/src/components/SearchBar.tsx index 915c1993e6..20f18ec0f2 100644 --- a/web/apps/photos/src/components/SearchBar.tsx +++ b/web/apps/photos/src/components/SearchBar.tsx @@ -42,7 +42,10 @@ import { } from "@mui/material"; import CollectionCard from "components/Collections/CollectionCard"; import { ResultPreviewTile } from "components/Collections/styledComponents"; -import { IMAGE_CONTAINER_MAX_WIDTH, MIN_COLUMNS } from "components/PhotoList"; +import { + IMAGE_CONTAINER_MAX_WIDTH, + MIN_COLUMNS, +} from "components/PhotoList/constants"; import { t } from "i18next"; import memoize from "memoize-one"; import pDebounce from "p-debounce"; diff --git a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx index 402dda4a65..deb212ef77 100644 --- a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx +++ b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx @@ -8,7 +8,10 @@ import useLongPress from "@ente/shared/hooks/useLongPress"; import AlbumOutlined from "@mui/icons-material/AlbumOutlined"; import PlayCircleOutlineOutlinedIcon from "@mui/icons-material/PlayCircleOutlineOutlined"; import { Tooltip, styled } from "@mui/material"; -import { GAP_BTW_TILES, IMAGE_CONTAINER_MAX_WIDTH } from "components/PhotoList"; +import { + GAP_BTW_TILES, + IMAGE_CONTAINER_MAX_WIDTH, +} from "components/PhotoList/constants"; import { LoadingThumbnail, StaticThumbnail,