Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refactor(photos):group-sidebar-components-by-feature

Aswin Asokae721f6aeb19
diff --git a/web/apps/photos/src/components/gallery/index.tsx b/web/apps/photos/src/components/gallery/index.tsx
index d21434fd00..f240f77975 100644
--- a/web/apps/photos/src/components/gallery/index.tsx
+++ b/web/apps/photos/src/components/gallery/index.tsx
@@ -1,6 +1,9 @@
// TODO: Move this code back into gallery.tsx.
-import { EnableML, FaceConsent } from "@/components/sidebar/MLSettings";
+import {
+ EnableML,
+ FaceConsent,
+} from "@/components/sidebar/preferences/MLSettings";
import { useWrapAsyncOperation } from "@/components/utils/use-wrap-async";
import CheckIcon from "@mui/icons-material/Check";
import SortIcon from "@mui/icons-material/Sort";
diff --git a/web/apps/photos/src/components/DropdownInput.tsx b/web/apps/photos/src/components/sidebar/DropdownInput.tsx
similarity index 100%
rename from web/apps/photos/src/components/DropdownInput.tsx
rename to web/apps/photos/src/components/sidebar/DropdownInput.tsx
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/sidebar/Sidebar.tsx
similarity index 99%
rename from web/apps/photos/src/components/Sidebar.tsx
rename to web/apps/photos/src/components/sidebar/Sidebar.tsx
index 925417e5af..0a317fdc1a 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/sidebar/Sidebar.tsx
@@ -1,12 +1,13 @@
-import { DeleteAccount } from "@/components/DeleteAccount";
-import { DropdownInput } from "@/components/DropdownInput";
-import { WatchFolder } from "@/components/WatchFolder";
import { ShapeIcon } from "@/components/icons/ShapeIcon";
-import { AppLockSettings } from "@/components/sidebar/AppLockSettings";
-import { MLSettings } from "@/components/sidebar/MLSettings";
+import { DropdownInput } from "@/components/sidebar/DropdownInput";
import { ReferralSettings } from "@/components/sidebar/ReferralSettings";
-import { SessionsSettings } from "@/components/sidebar/SessionsSettings";
-import { TwoFactorSettings } from "@/components/sidebar/TwoFactorSettings";
+import { WatchFolder } from "@/components/sidebar/WatchFolder";
+import { DeleteAccount } from "@/components/sidebar/account/DeleteAccount";
+import { SessionsSettings } from "@/components/sidebar/account/SessionsSettings";
+import { SubscriptionCard } from "@/components/sidebar/account/SubscriptionCard";
+import { TwoFactorSettings } from "@/components/sidebar/account/TwoFactorSettings";
+import { AppLockSettings } from "@/components/sidebar/preferences/AppLockSettings";
+import { MLSettings } from "@/components/sidebar/preferences/MLSettings";
import { downloadAppDialogAttributes } from "@/components/utils/download";
import exportService from "@/services/export";
import {
@@ -140,7 +141,6 @@ import React, {
type MouseEventHandler,
} from "react";
import { Trans } from "react-i18next";
-import { SubscriptionCard } from "./SubscriptionCard";
type SidebarProps = ModalVisibilityProps & {
normalCollectionSummaries: CollectionSummaries;
diff --git a/web/apps/photos/src/components/WatchFolder.tsx b/web/apps/photos/src/components/sidebar/WatchFolder.tsx
similarity index 100%
rename from web/apps/photos/src/components/WatchFolder.tsx
rename to web/apps/photos/src/components/sidebar/WatchFolder.tsx
diff --git a/web/apps/photos/src/components/DeleteAccount.tsx b/web/apps/photos/src/components/sidebar/account/DeleteAccount.tsx
similarity index 99%
rename from web/apps/photos/src/components/DeleteAccount.tsx
rename to web/apps/photos/src/components/sidebar/account/DeleteAccount.tsx
index 192d7cdafc..594389c7bc 100644
--- a/web/apps/photos/src/components/DeleteAccount.tsx
+++ b/web/apps/photos/src/components/sidebar/account/DeleteAccount.tsx
@@ -1,9 +1,12 @@
-import { DropdownInput, type DropdownOption } from "@/components/DropdownInput";
import {
EnteAuthIcon,
EnteLockerIcon,
EntePhotosIcon,
} from "@/components/EnteAppIcon";
+import {
+ DropdownInput,
+ type DropdownOption,
+} from "@/components/sidebar/DropdownInput";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import ErrorOutlinedIcon from "@mui/icons-material/ErrorOutlined";
import {
diff --git a/web/apps/photos/src/components/sidebar/SessionsSettings.tsx b/web/apps/photos/src/components/sidebar/account/SessionsSettings.tsx
similarity index 100%
rename from web/apps/photos/src/components/sidebar/SessionsSettings.tsx
rename to web/apps/photos/src/components/sidebar/account/SessionsSettings.tsx
diff --git a/web/apps/photos/src/components/SubscriptionCard.tsx b/web/apps/photos/src/components/sidebar/account/SubscriptionCard.tsx
similarity index 100%
rename from web/apps/photos/src/components/SubscriptionCard.tsx
rename to web/apps/photos/src/components/sidebar/account/SubscriptionCard.tsx
diff --git a/web/apps/photos/src/components/sidebar/TwoFactorSettings.tsx b/web/apps/photos/src/components/sidebar/account/TwoFactorSettings.tsx
similarity index 100%
rename from web/apps/photos/src/components/sidebar/TwoFactorSettings.tsx
rename to web/apps/photos/src/components/sidebar/account/TwoFactorSettings.tsx
diff --git a/web/apps/photos/src/components/sidebar/AppLockSettings.tsx b/web/apps/photos/src/components/sidebar/preferences/AppLockSettings.tsx
similarity index 100%
rename from web/apps/photos/src/components/sidebar/AppLockSettings.tsx
rename to web/apps/photos/src/components/sidebar/preferences/AppLockSettings.tsx
diff --git a/web/apps/photos/src/components/sidebar/MLSettings.tsx b/web/apps/photos/src/components/sidebar/preferences/MLSettings.tsx
similarity index 100%
rename from web/apps/photos/src/components/sidebar/MLSettings.tsx
rename to web/apps/photos/src/components/sidebar/preferences/MLSettings.tsx
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index bfad032007..4ac9b60d00 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -29,7 +29,6 @@ import {
type CollectionOp,
type FileOp,
} from "@/components/SelectedFileOptions";
-import { Sidebar } from "@/components/Sidebar";
import { Upload } from "@/components/Upload";
import { WhatsNew } from "@/components/WhatsNew";
import {
@@ -46,6 +45,7 @@ import {
useGalleryReducer,
type GalleryBarMode,
} from "@/components/gallery/reducer";
+import { Sidebar } from "@/components/sidebar/Sidebar";
import {
notifyOthersFilesDialogAttributes,
notifyUnsupportedSharedFavoritesDialogAttributes,
diff --git a/web/checks/lint-exceptions/suppressions.json b/web/checks/lint-exceptions/suppressions.json
index 57aeb1367e..efd02a1725 100644
--- a/web/checks/lint-exceptions/suppressions.json
+++ b/web/checks/lint-exceptions/suppressions.json
@@ -20,13 +20,13 @@
"web/apps/photos/src/components/PlanSelector.tsx": [
"react-hooks/exhaustive-deps"
],
- "web/apps/photos/src/components/Sidebar.tsx": [
+ "web/apps/photos/src/components/sidebar/Sidebar.tsx": [
"@typescript-eslint/no-floating-promises"
],
"web/apps/photos/src/components/Upload.tsx": [
"react-hooks/exhaustive-deps"
],
- "web/apps/photos/src/components/WatchFolder.tsx": [
+ "web/apps/photos/src/components/sidebar/WatchFolder.tsx": [
"react-hooks/exhaustive-deps"
],
"web/apps/photos/src/pages/gallery.tsx": ["react-hooks/exhaustive-deps"],