Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathi789783a370fe
diff --git a/web/apps/photos/src/components/Sidebar/HelpSection.tsx b/web/apps/photos/src/components/Sidebar/HelpSection.tsx
deleted file mode 100644
index 4cc97c414a..0000000000
--- a/web/apps/photos/src/components/Sidebar/HelpSection.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { t } from "i18next";
-import { useContext } from "react";
-
-import EnteSpinner from "@ente/shared/components/EnteSpinner";
-import { Typography } from "@mui/material";
-import { EnteMenuItem } from "components/Menu/EnteMenuItem";
-import { NoStyleAnchor } from "components/pages/sharedAlbum/GoToEnte";
-import isElectron from "is-electron";
-import { AppContext } from "pages/_app";
-import { GalleryContext } from "pages/gallery";
-import exportService from "services/export";
-import { openLink } from "utils/common";
-import { getDownloadAppMessage } from "utils/ui";
-
-export default function HelpSection() {
- const { setDialogMessage } = useContext(AppContext);
- const { openExportModal } = useContext(GalleryContext);
-
- const openRoadmap = () =>
- openLink("https://github.com/ente-io/ente/discussions", true);
-
- const contactSupport = () => openLink("mailto:[email protected]", true);
-
- function openExport() {
- if (isElectron()) {
- openExportModal();
- } else {
- setDialogMessage(getDownloadAppMessage());
- }
- }
-
- return (
- <>
- <EnteMenuItem
- onClick={openRoadmap}
- label={t("REQUEST_FEATURE")}
- variant="secondary"
- />
- <EnteMenuItem
- onClick={contactSupport}
- labelComponent={
- <NoStyleAnchor href="mailto:[email protected]">
- <Typography fontWeight={"bold"}>
- {t("SUPPORT")}
- </Typography>
- </NoStyleAnchor>
- }
- variant="secondary"
- />
- <EnteMenuItem
- onClick={openExport}
- label={t("EXPORT")}
- endIcon={
- exportService.isExportInProgress() && (
- <EnteSpinner size="20px" />
- )
- }
- variant="secondary"
- />
- </>
- );
-}
diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx
index b076bd6bc0..efa10a4b0b 100644
--- a/web/apps/photos/src/components/Sidebar/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/index.tsx
@@ -1,19 +1,25 @@
import log from "@/next/log";
import { savedLogs } from "@/next/log-web";
+import EnteSpinner from "@ente/shared/components/EnteSpinner";
import { downloadAsFile } from "@ente/shared/utils";
import { Divider, Stack } from "@mui/material";
import Typography from "@mui/material/Typography";
import DeleteAccountModal from "components/DeleteAccountModal";
import { EnteMenuItem } from "components/Menu/EnteMenuItem";
+import { NoStyleAnchor } from "components/pages/sharedAlbum/GoToEnte";
import { t } from "i18next";
+import isElectron from "is-electron";
import { AppContext } from "pages/_app";
+import { GalleryContext } from "pages/gallery";
import { useContext, useEffect, useState } from "react";
import { Trans } from "react-i18next";
+import exportService from "services/export";
import { CollectionSummaries } from "types/collection";
+import { openLink } from "utils/common";
+import { getDownloadAppMessage } from "utils/ui";
import { isInternalUser } from "utils/user";
import { testUpload } from "../../../tests/upload.test";
import HeaderSection from "./Header";
-import HelpSection from "./HelpSection";
import ShortcutSection from "./ShortcutSection";
import UtilitySection from "./UtilitySection";
import { DrawerSidebar } from "./styledComponents";
@@ -51,6 +57,55 @@ export default function Sidebar({
);
}
+const HelpSection: React.FC = () => {
+ const { setDialogMessage } = useContext(AppContext);
+ const { openExportModal } = useContext(GalleryContext);
+
+ const openRoadmap = () =>
+ openLink("https://github.com/ente-io/ente/discussions", true);
+
+ const contactSupport = () => openLink("mailto:[email protected]", true);
+
+ function openExport() {
+ if (isElectron()) {
+ openExportModal();
+ } else {
+ setDialogMessage(getDownloadAppMessage());
+ }
+ }
+
+ return (
+ <>
+ <EnteMenuItem
+ onClick={openRoadmap}
+ label={t("REQUEST_FEATURE")}
+ variant="secondary"
+ />
+ <EnteMenuItem
+ onClick={contactSupport}
+ labelComponent={
+ <NoStyleAnchor href="mailto:[email protected]">
+ <Typography fontWeight={"bold"}>
+ {t("SUPPORT")}
+ </Typography>
+ </NoStyleAnchor>
+ }
+ variant="secondary"
+ />
+ <EnteMenuItem
+ onClick={openExport}
+ label={t("EXPORT")}
+ endIcon={
+ exportService.isExportInProgress() && (
+ <EnteSpinner size="20px" />
+ )
+ }
+ variant="secondary"
+ />
+ </>
+ );
+};
+
const ExitSection: React.FC = () => {
const { setDialogMessage, logout } = useContext(AppContext);