This commit is contained in:
Manav Rathi
2024-09-24 04:51:06 +05:30
parent 2660cee263
commit 21ae075674
8 changed files with 16 additions and 16 deletions

View File

@@ -5,7 +5,7 @@ import {
} from "@ente/shared/components/Container";
import Close from "@mui/icons-material/Close";
import { Box, DialogTitle, Stack, Typography } from "@mui/material";
import CollectionListSortOptions from "components/Collections/CollectionListSortBy";
import { CollectionListSortOptions } from "components/Collections/CollectionListSortOptions";
import { t } from "i18next";
export default function AllCollectionsHeader({

View File

@@ -1,10 +1,10 @@
import type { CollectionSummary } from "@/new/photos/types/collection";
import { CollectionListSortBy } from "@/new/photos/types/collection";
import { Divider, useMediaQuery } from "@mui/material";
import {
AllCollectionDialog,
Transition,
} from "components/Collections/AllCollections/dialog";
import { CollectionListSortBy } from "utils/collection";
import AllCollectionContent from "./content";
import AllCollectionsHeader from "./header";

View File

@@ -5,6 +5,7 @@ import type {
CollectionSummary,
CollectionSummaryType,
} from "@/new/photos/types/collection";
import { CollectionListSortBy } from "@/new/photos/types/collection";
import { ensure } from "@/utils/ensure";
import { IconButtonWithBG, Overlay } from "@ente/shared/components/Container";
import ArchiveIcon from "@mui/icons-material/Archive";
@@ -31,7 +32,6 @@ import React, {
} from "react";
import AutoSizer from "react-virtualized-auto-sizer";
import { FixedSizeList, ListChildComponentProps, areEqual } from "react-window";
import { CollectionListSortBy } from "utils/collection";
import type { GalleryBarMode } from ".";
import { CollectionListSortOptions } from "./CollectionListSortOptions";

View File

@@ -4,7 +4,7 @@ import TickIcon from "@mui/icons-material/Done";
import SortIcon from "@mui/icons-material/Sort";
import SvgIcon from "@mui/material/SvgIcon";
import { t } from "i18next";
import { CollectionListSortBy } from "utils/collection";
import { CollectionListSortBy } from "@/new/photos/types/collection";
interface CollectionListSortOptionsProps {
setSortBy: (sortBy: CollectionListSortBy) => void;

View File

@@ -1,6 +1,7 @@
import type { Collection } from "@/media/collection";
import type { Person } from "@/new/photos/services/ml/cgroups";
import type { CollectionSummaries } from "@/new/photos/types/collection";
import { CollectionListSortBy } from "@/new/photos/types/collection";
import { useLocalState } from "@ente/shared/hooks/useLocalState";
import { LS_KEYS } from "@ente/shared/storage/localStorage";
import AllCollections from "components/Collections/AllCollections";
@@ -14,7 +15,6 @@ import { sortCollectionSummaries } from "services/collectionService";
import { SetFilesDownloadProgressAttributesCreator } from "types/gallery";
import {
ALL_SECTION,
CollectionListSortBy,
hasNonSystemCollections,
isSystemCollection,
shouldBeShownOnCollectionBar,

View File

@@ -45,7 +45,6 @@ import {
ALL_SECTION,
ARCHIVE_SECTION,
COLLECTION_SORT_ORDER,
CollectionListSortBy,
DUMMY_UNCATEGORIZED_COLLECTION,
HIDDEN_ITEMS_SECTION,
TRASH_SECTION,
@@ -61,6 +60,7 @@ import {
isSharedOnlyViaLink,
isValidMoveTarget,
} from "utils/collection";
import { CollectionListSortBy } from "@/new/photos/types/collection";
import {
getUniqueFiles,
groupFilesBasedOnCollectionID,

View File

@@ -45,16 +45,6 @@ export const DUMMY_UNCATEGORIZED_COLLECTION = -3;
export const HIDDEN_ITEMS_SECTION = -4;
export const ALL_SECTION = 0;
/**
* Sort orders for use when we're showing lists of collections (e.g. in the
* collection bar).
*/
export enum CollectionListSortBy {
Name,
CreationTimeAscending,
UpdationTimeDescending,
}
export const COLLECTION_SORT_ORDER = new Map<CollectionSummaryType, number>([
["all", 0],
["hiddenItems", 0],

View File

@@ -34,3 +34,13 @@ export interface CollectionSummary {
}
export type CollectionSummaries = Map<number, CollectionSummary>;
/**
* Sort orders for use when we're showing lists of collections (e.g. in the
* collection bar).
*/
export enum CollectionListSortBy {
Name,
CreationTimeAscending,
UpdationTimeDescending,
}