Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathifde6e14440b8
diff --git a/web/apps/accounts/src/pages/passkeys/index.tsx b/web/apps/accounts/src/pages/passkeys/index.tsx
index e46e7d2681..e98cc3f167 100644
--- a/web/apps/accounts/src/pages/passkeys/index.tsx
+++ b/web/apps/accounts/src/pages/passkeys/index.tsx
@@ -1,4 +1,5 @@
import { MenuItemDivider, MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import log from "@/next/log";
import { ensure } from "@/utils/ensure";
import { CenteredFlex } from "@ente/shared/components/Container";
@@ -9,7 +10,6 @@ import FormPaper from "@ente/shared/components/Form/FormPaper";
import InfoItem from "@ente/shared/components/Info/InfoItem";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import SingleInputForm from "@ente/shared/components/SingleInputForm";
-import Titlebar from "@ente/shared/components/Titlebar";
import { formatDateTimeFull } from "@ente/shared/time/format";
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
diff --git a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/AddParticipant.tsx b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/AddParticipant.tsx
index 05437ada00..733406c968 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/AddParticipant.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/AddParticipant.tsx
@@ -1,6 +1,6 @@
+import Titlebar from "@/new/shared/components/Titlebar";
import { DialogProps, Stack } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { COLLECTION_ROLE, Collection } from "types/collection";
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 a7ee1293d8..807551b4fe 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageEmailShare.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageEmailShare.tsx
@@ -3,6 +3,7 @@ import {
MenuItemGroup,
MenuSectionTitle,
} from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import Add from "@mui/icons-material/Add";
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
@@ -12,7 +13,6 @@ import Photo from "@mui/icons-material/Photo";
import { DialogProps, Stack } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
import Avatar from "components/pages/gallery/Avatar";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { GalleryContext } from "pages/gallery";
diff --git a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageParticipant.tsx b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageParticipant.tsx
index 1a8c975f3a..022e1d9e4b 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageParticipant.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare/emailShare/ManageParticipant.tsx
@@ -1,4 +1,5 @@
import { MenuItemDivider, MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import log from "@/next/log";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import BlockIcon from "@mui/icons-material/Block";
@@ -7,7 +8,6 @@ import ModeEditIcon from "@mui/icons-material/ModeEdit";
import PhotoIcon from "@mui/icons-material/Photo";
import { DialogProps, Stack, Typography } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { GalleryContext } from "pages/gallery";
diff --git a/web/apps/photos/src/components/Collections/CollectionShare/index.tsx b/web/apps/photos/src/components/Collections/CollectionShare/index.tsx
index 22de9b55e8..f8ba77f510 100644
--- a/web/apps/photos/src/components/Collections/CollectionShare/index.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionShare/index.tsx
@@ -1,6 +1,6 @@
+import Titlebar from "@/new/shared/components/Titlebar";
import { DialogProps, Stack } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { CollectionSummaryType } from "constants/collection";
import { t } from "i18next";
import { Collection, CollectionSummary } from "types/collection";
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 c198bc5aa5..7e4a91608b 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,9 +1,9 @@
import { MenuItemDivider, MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import ChevronRight from "@mui/icons-material/ChevronRight";
import { DialogProps, Stack } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { useMemo, useState } from "react";
import { Collection, PublicURL, UpdatePublicURL } from "types/collection";
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 10b1410782..438e69eb03 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,10 +1,10 @@
import { MenuItemDivider, MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
import RemoveCircleOutline from "@mui/icons-material/RemoveCircleOutline";
import { DialogProps, Stack, Typography } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { GalleryContext } from "pages/gallery";
import { useContext, useState } from "react";
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 c969429c42..6d808a4450 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,10 +1,10 @@
import { MenuItemDivider, MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import { formatDateTime } from "@ente/shared/time/format";
import ChevronRight from "@mui/icons-material/ChevronRight";
import { DialogProps, Stack } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { useMemo, useState } from "react";
import { Collection, PublicURL, UpdatePublicURL } from "types/collection";
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx
index c6c0582f8e..54db4e3849 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx
@@ -1,7 +1,7 @@
+import Titlebar from "@/new/shared/components/Titlebar";
import CopyButton from "@ente/shared/components/CodeBlock/CopyButton";
import { formatDateTimeFull } from "@ente/shared/time/format";
import { Box, Stack, styled, Typography } from "@mui/material";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import React from "react";
import { FileInfoSidebar } from ".";
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx
index ac764bd1a4..875041bf4b 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/index.tsx
@@ -1,6 +1,7 @@
import { UnidentifiedFaces } from "@/new/photos/components/PeopleList";
import { isMLEnabled } from "@/new/photos/services/ml";
import { EnteFile } from "@/new/photos/types/file";
+import Titlebar from "@/new/shared/components/Titlebar";
import CopyButton from "@ente/shared/components/CodeBlock/CopyButton";
import { FlexWrapper } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
@@ -14,7 +15,6 @@ import { Box, DialogProps, Link, Stack, styled } from "@mui/material";
import { Chip } from "components/Chip";
import { EnteDrawer } from "components/EnteDrawer";
import LinkButton from "components/pages/gallery/LinkButton";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { GalleryContext } from "pages/gallery";
diff --git a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx
index c07dd2c7e6..6362ca9d12 100644
--- a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx
+++ b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx
@@ -1,10 +1,10 @@
import { MenuItemGroup, MenuSectionTitle } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import ChevronRight from "@mui/icons-material/ChevronRight";
import ScienceIcon from "@mui/icons-material/Science";
import { Box, DialogProps, Stack } from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { MLSearchSettings } from "components/ml/MLSearchSettings";
import { t } from "i18next";
import isElectron from "is-electron";
diff --git a/web/apps/photos/src/components/Sidebar/MapSetting.tsx b/web/apps/photos/src/components/Sidebar/MapSetting.tsx
index 8e6a1f1764..3b07087402 100644
--- a/web/apps/photos/src/components/Sidebar/MapSetting.tsx
+++ b/web/apps/photos/src/components/Sidebar/MapSetting.tsx
@@ -1,4 +1,5 @@
import { MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import log from "@/next/log";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import {
@@ -10,7 +11,6 @@ import {
Typography,
} from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { useContext, useEffect, useState } from "react";
diff --git a/web/apps/photos/src/components/Sidebar/Preferences.tsx b/web/apps/photos/src/components/Sidebar/Preferences.tsx
index 0fe44712e2..9ca8c944e5 100644
--- a/web/apps/photos/src/components/Sidebar/Preferences.tsx
+++ b/web/apps/photos/src/components/Sidebar/Preferences.tsx
@@ -1,3 +1,4 @@
+import Titlebar from "@/new/shared/components/Titlebar";
import {
getLocaleInUse,
setLocaleInUse,
@@ -9,7 +10,6 @@ import ChevronRight from "@mui/icons-material/ChevronRight";
import { Box, DialogProps, Stack } from "@mui/material";
import DropdownInput from "components/DropdownInput";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { useState } from "react";
import AdvancedSettings from "./AdvancedSettings";
diff --git a/web/apps/photos/src/components/ml/MLSearchSettings.tsx b/web/apps/photos/src/components/ml/MLSearchSettings.tsx
index a98afaf3a0..d51a7609cf 100644
--- a/web/apps/photos/src/components/ml/MLSearchSettings.tsx
+++ b/web/apps/photos/src/components/ml/MLSearchSettings.tsx
@@ -5,6 +5,7 @@ import {
isMLEnabled,
} from "@/new/photos/services/ml";
import { MenuItemGroup } from "@/new/shared/components/Menu";
+import Titlebar from "@/new/shared/components/Titlebar";
import log from "@/next/log";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import {
@@ -19,7 +20,6 @@ import {
Typography,
} from "@mui/material";
import { EnteDrawer } from "components/EnteDrawer";
-import Titlebar from "components/Titlebar";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { useContext, useEffect, useState } from "react";
diff --git a/web/apps/photos/src/components/Titlebar.tsx b/web/packages/new/shared/components/Titlebar.tsx
similarity index 100%
rename from web/apps/photos/src/components/Titlebar.tsx
rename to web/packages/new/shared/components/Titlebar.tsx
diff --git a/web/packages/shared/components/Titlebar.tsx b/web/packages/shared/components/Titlebar.tsx
deleted file mode 100644
index ed9089f4c2..0000000000
--- a/web/packages/shared/components/Titlebar.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { FlexWrapper } from "@ente/shared/components/Container";
-import ArrowBack from "@mui/icons-material/ArrowBack";
-import Close from "@mui/icons-material/Close";
-import { Box, IconButton, Typography } from "@mui/material";
-
-interface Iprops {
- title: string;
- caption?: string;
- onClose: () => void;
- backIsClose?: boolean;
- onRootClose?: () => void;
- actionButton?: JSX.Element;
-}
-
-export default function Titlebar({
- title,
- caption,
- onClose,
- backIsClose,
- actionButton,
- onRootClose,
-}: Iprops): JSX.Element {
- return (
- <>
- <FlexWrapper
- height={48}
- alignItems={"center"}
- justifyContent="space-between"
- >
- <IconButton
- onClick={onClose}
- color={backIsClose ? "secondary" : "primary"}
- >
- {backIsClose ? <Close /> : <ArrowBack />}
- </IconButton>
- <Box display={"flex"} gap="4px">
- {actionButton && actionButton}
- {!backIsClose && (
- <IconButton onClick={onRootClose} color={"secondary"}>
- <Close />
- </IconButton>
- )}
- </Box>
- </FlexWrapper>
- <Box py={0.5} px={2}>
- <Typography variant="h3" fontWeight={"bold"}>
- {title}
- </Typography>
- <Typography
- variant="small"
- color="text.muted"
- sx={{ wordBreak: "break-all", minHeight: "17px" }}
- >
- {caption}
- </Typography>
- </Box>
- </>
- );
-}