diff --git a/web/apps/accounts/src/pages/passkeys/index.tsx b/web/apps/accounts/src/pages/passkeys/index.tsx index 485fdf841db..ce1b928ddce 100644 --- a/web/apps/accounts/src/pages/passkeys/index.tsx +++ b/web/apps/accounts/src/pages/passkeys/index.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemDivider, MenuItemGroup } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import { errorDialogAttributes } from "@/base/components/utils/dialog"; import log from "@/base/log"; @@ -283,7 +283,7 @@ const ManagePasskeyDrawer: React.FC = ({ return ( <> - + {token && passkey && ( = ({ )} - + {token && passkey && ( - - - - - - - + + + + + + ); } diff --git a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageEmailShare.tsx b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageEmailShare.tsx index cd2cb17e75c..23cb8a4d62c 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageEmailShare.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageEmailShare.tsx @@ -1,9 +1,9 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemDivider, MenuItemGroup, MenuSectionTitle, } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import { COLLECTION_ROLE, @@ -116,7 +116,11 @@ export default function ManageEmailShare({ return ( <> - + - + - - - - - - + + + + + + + + {t("ADDED_AS")} + + + + } + endIcon={ + selectedParticipant.role === + "COLLABORATOR" && + } + /> + + + } + endIcon={ + selectedParticipant.role === "VIEWER" && ( + + ) + } + /> + + + + {t("COLLABORATOR_RIGHTS")} + + + - {t("ADDED_AS")} + {t("REMOVE_PARTICIPANT_HEAD")} } - endIcon={ - selectedParticipant.role === - "COLLABORATOR" && - } - /> - - - } - endIcon={ - selectedParticipant.role === - "VIEWER" && - } + onClick={removeParticipant} + label={"Remove"} + startIcon={} /> - - - {t("COLLABORATOR_RIGHTS")} - - - - - {t("REMOVE_PARTICIPANT_HEAD")} - - - - } - /> - - - - + + ); } diff --git a/web/apps/photos/src/components/Collections/CollectionShare/index.tsx b/web/apps/photos/src/components/Collections/CollectionShare/index.tsx index 5fda2e00c84..a1804f86526 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare/index.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare/index.tsx @@ -1,4 +1,4 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { Collection } from "@/media/collection"; import type { CollectionSummary } from "@/new/photos/services/collection/ui"; @@ -32,7 +32,7 @@ function CollectionShare({ collectionSummary, ...props }: Props) { const { type } = collectionSummary; return ( - - + ); } export default CollectionShare; diff --git a/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/deviceLimit.tsx b/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/deviceLimit.tsx index 99517c4cd22..60e31985500 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/deviceLimit.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/deviceLimit.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemDivider, MenuItemGroup } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { Collection, @@ -68,7 +68,7 @@ export function ManageDeviceLimit({ endIcon={} /> - - + ); } diff --git a/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/index.tsx b/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/index.tsx index 79f46d1dc84..801b77a5aea 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/index.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/index.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemDivider, MenuItemGroup } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { Collection, @@ -86,90 +86,86 @@ export default function ManagePublicShareOptions({ navigator.clipboard.writeText(text); }; return ( - <> - - - - - - + + + + + + + + - + - - - - - - - - - } - onClick={copyToClipboardHelper( - publicShareUrl, - )} - label={t("COPY_LINK")} - /> - - - } - onClick={disablePublicSharing} - label={t("REMOVE_LINK")} - /> - - - {sharableLinkError && ( - theme.colors.danger.A700, - mt: 0.5, - }} - > - {sharableLinkError} - - )} + + + + + } + onClick={copyToClipboardHelper(publicShareUrl)} + label={t("COPY_LINK")} + /> + + + } + onClick={disablePublicSharing} + label={t("REMOVE_LINK")} + /> + + {sharableLinkError && ( + theme.colors.danger.A700, + mt: 0.5, + }} + > + {sharableLinkError} + + )} - - + + ); } diff --git a/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx b/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx index 8487240274e..3bc1c7f2c5e 100644 --- a/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx +++ b/web/apps/photos/src/components/Collections/CollectionShare/publicShare/manage/linkExpiry.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemDivider, MenuItemGroup } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { Collection, @@ -84,7 +84,7 @@ export function ManageLinkExpiry({ } /> - - + ); } diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx index 875fd404bb4..e5664cd0132 100644 --- a/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx @@ -1,6 +1,6 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import type { MiniDialogAttributes } from "@/base/components/MiniDialog"; import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import { EllipsizedTypography } from "@/base/components/Typography"; import { useModalVisibility } from "@/base/components/utils/modal"; @@ -400,7 +400,7 @@ const confirmDisableMapsDialogAttributes = ( }); const FileInfoSidebar = styled((props: DialogProps) => ( - + ))({ zIndex: fileInfoDrawerZIndex, "& .MuiPaper-root": { diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx index 931b70d6909..de5afca30b9 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx @@ -1,10 +1,10 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemDivider, MenuItemGroup, MenuSectionTitle, } from "@/base/components/Menu"; import type { MiniDialogAttributes } from "@/base/components/MiniDialog"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { nameAndExtension } from "@/base/file"; import log from "@/base/log"; import { downloadAndRevokeObjectURL } from "@/base/utils/web"; @@ -614,7 +614,7 @@ const ImageEditorOverlay = (props: IProps) => { - { title={t("PHOTO_EDIT_REQUIRED_TO_SAVE")} /> )} - + ); diff --git a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx index 24efe9a0004..be0a4995559 100644 --- a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx +++ b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemGroup, MenuSectionTitle } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { NestedDrawerVisibilityProps } from "@/base/components/utils/modal"; import { AppContext } from "@/new/photos/types/context"; @@ -33,7 +33,7 @@ export const AdvancedSettings: React.FC = ({ }; return ( - = ({ - + ); }; diff --git a/web/apps/photos/src/components/Sidebar/MapSetting.tsx b/web/apps/photos/src/components/Sidebar/MapSetting.tsx index 6fe1851eb1f..f33b1f04a7a 100644 --- a/web/apps/photos/src/components/Sidebar/MapSetting.tsx +++ b/web/apps/photos/src/components/Sidebar/MapSetting.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemGroup } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { NestedDrawerVisibilityProps } from "@/base/components/utils/modal"; import log from "@/base/log"; @@ -54,7 +54,7 @@ export const MapSettings: React.FC = ({ }; return ( - = ({ onClose={closeModifyMapEnabled} onRootClose={handleRootClose} /> - + ); }; @@ -132,7 +132,7 @@ const ModifyMapEnabled = ({ open, onClose, onRootClose, mapEnabled }) => { return ( - { onRootClose={handleRootClose} /> )} - + ); }; diff --git a/web/apps/photos/src/components/Sidebar/Preferences.tsx b/web/apps/photos/src/components/Sidebar/Preferences.tsx index 975012bd018..c95751d17b4 100644 --- a/web/apps/photos/src/components/Sidebar/Preferences.tsx +++ b/web/apps/photos/src/components/Sidebar/Preferences.tsx @@ -1,5 +1,5 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemGroup, MenuSectionTitle } from "@/base/components/Menu"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import { useModalVisibility, @@ -56,7 +56,7 @@ export const Preferences: React.FC = ({ }; return ( - = ({ {...mlSettingsVisibilityProps} onRootClose={handleRootClose} /> - + ); }; diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx index 1d090d52b46..8e8110e65ab 100644 --- a/web/apps/photos/src/components/Sidebar/index.tsx +++ b/web/apps/photos/src/components/Sidebar/index.tsx @@ -1,9 +1,9 @@ import { RecoveryKey } from "@/accounts/components/RecoveryKey"; import { openAccountsManagePasskeysPage } from "@/accounts/services/passkey"; import { isDesktop } from "@/base/app"; -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { EnteLogo } from "@/base/components/EnteLogo"; import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { useModalVisibility } from "@/base/components/utils/modal"; import log from "@/base/log"; import { savedLogs } from "@/base/log-web"; @@ -94,7 +94,7 @@ export default function Sidebar({ closeSidebar, }: Iprops) { return ( - + @@ -111,18 +111,16 @@ export default function Sidebar({ - + ); } -const DrawerSidebar = styled(EnteDrawer)(({ theme }) => ({ +const RootSidebarDrawer = styled(SidebarDrawer)(({ theme }) => ({ "& .MuiPaper-root": { padding: theme.spacing(1.5), }, })); -DrawerSidebar.defaultProps = { anchor: "left" }; - interface HeaderSectionProps { closeSidebar: () => void; } diff --git a/web/packages/base/components/EnteDrawer.tsx b/web/packages/base/components/EnteDrawer.tsx deleted file mode 100644 index e6fc35bb159..00000000000 --- a/web/packages/base/components/EnteDrawer.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Drawer, styled } from "@mui/material"; - -export const EnteDrawer = styled(Drawer)(({ theme }) => ({ - "& .MuiPaper-root": { - maxWidth: "375px", - width: "100%", - scrollbarWidth: "thin", - padding: theme.spacing(1), - }, -})); diff --git a/web/packages/base/components/mui/SidebarDrawer.tsx b/web/packages/base/components/mui/SidebarDrawer.tsx new file mode 100644 index 00000000000..93ef27599c3 --- /dev/null +++ b/web/packages/base/components/mui/SidebarDrawer.tsx @@ -0,0 +1,17 @@ +import { Drawer, styled } from "@mui/material"; + +/** + * A MUI {@link Drawer} with a standard set of styling that we use for our left + * and right sidebar panels. + * + * It is width limited to 375px, and always at full width. It also has a default + * padding. + */ +export const SidebarDrawer = styled(Drawer)(({ theme }) => ({ + "& .MuiPaper-root": { + maxWidth: "375px", + width: "100%", + scrollbarWidth: "thin", + padding: theme.spacing(1), + }, +})); diff --git a/web/packages/new/photos/components/MLSettings.tsx b/web/packages/new/photos/components/MLSettings.tsx index 8959be3c6a7..3b2c43f44d4 100644 --- a/web/packages/new/photos/components/MLSettings.tsx +++ b/web/packages/new/photos/components/MLSettings.tsx @@ -1,6 +1,6 @@ -import { EnteDrawer } from "@/base/components/EnteDrawer"; import { MenuItemGroup } from "@/base/components/Menu"; import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator"; +import { SidebarDrawer } from "@/base/components/mui/SidebarDrawer"; import { Titlebar } from "@/base/components/Titlebar"; import type { NestedDrawerVisibilityProps } from "@/base/components/utils/modal"; import { disableML, enableML, type MLStatus } from "@/new/photos/services/ml"; @@ -67,7 +67,7 @@ export const MLSettings: React.FC = ({ return ( - = ({ /> {component} - + = ({ ); return ( - = ({ - + ); };