Skip to content

armgit / ente

Public Imported from GitHub
0

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

Static

Manav Rathia15c9620ec70
diff --git a/web/apps/accounts/src/pages/_app.tsx b/web/apps/accounts/src/pages/_app.tsx
index cf7de8eee5..4d099c0c67 100644
--- a/web/apps/accounts/src/pages/_app.tsx
+++ b/web/apps/accounts/src/pages/_app.tsx
@@ -4,7 +4,7 @@ import { LoadingOverlay } from "@/base/components/loaders";
import { AttributedMiniDialog } from "@/base/components/MiniDialog";
import { useAttributedMiniDialog } from "@/base/components/utils/dialog";
import { useSetupI18n, useSetupLogs } from "@/base/components/utils/hooks-app";
-import { getTheme } from "@/base/components/utils/theme";
+import { photosTheme } from "@/base/components/utils/theme";
import "@fontsource-variable/inter";
import { CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
@@ -27,7 +27,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
<>
<CustomHead {...{ title }} />
- <ThemeProvider theme={getTheme("photos")}>
+ <ThemeProvider theme={photosTheme}>
<CssBaseline enableColorScheme />
<AttributedMiniDialog {...miniDialogProps} />
diff --git a/web/apps/auth/src/pages/_app.tsx b/web/apps/auth/src/pages/_app.tsx
index eb683c2675..dc55d035ae 100644
--- a/web/apps/auth/src/pages/_app.tsx
+++ b/web/apps/auth/src/pages/_app.tsx
@@ -5,7 +5,7 @@ import { LoadingOverlay } from "@/base/components/loaders";
import { AttributedMiniDialog } from "@/base/components/MiniDialog";
import { useAttributedMiniDialog } from "@/base/components/utils/dialog";
import { useSetupI18n, useSetupLogs } from "@/base/components/utils/hooks-app";
-import { getTheme } from "@/base/components/utils/theme";
+import { authTheme } from "@/base/components/utils/theme";
import { logStartupBanner } from "@/base/log-web";
import HTTPService from "@ente/shared/network/HTTPService";
import {
@@ -70,7 +70,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
<>
<CustomHead {...{ title }} />
- <ThemeProvider theme={getTheme("auth")}>
+ <ThemeProvider theme={authTheme}>
<CssBaseline enableColorScheme />
<AttributedMiniDialog {...miniDialogProps} />
diff --git a/web/apps/cast/src/pages/_app.tsx b/web/apps/cast/src/pages/_app.tsx
index b6e866de8d..5c35cc9065 100644
--- a/web/apps/cast/src/pages/_app.tsx
+++ b/web/apps/cast/src/pages/_app.tsx
@@ -1,7 +1,7 @@
import { staticAppTitle } from "@/base/app";
import { CustomHead } from "@/base/components/Head";
import { useSetupLogs } from "@/base/components/utils/hooks-app";
-import { getTheme } from "@/base/components/utils/theme";
+import { photosTheme } from "@/base/components/utils/theme";
import "@fontsource-variable/inter";
import { CssBaseline, ThemeProvider } from "@mui/material";
import type { AppProps } from "next/app";
@@ -14,7 +14,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
<>
<CustomHead title={staticAppTitle} />
- <ThemeProvider theme={getTheme("photos")}>
+ <ThemeProvider theme={photosTheme}>
<CssBaseline enableColorScheme />
<Component {...pageProps} />
</ThemeProvider>
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index f61b1fadd0..924434d7cd 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -7,7 +7,7 @@ import {
useAttributedMiniDialog,
} from "@/base/components/utils/dialog";
import { useSetupI18n, useSetupLogs } from "@/base/components/utils/hooks-app";
-import { getTheme } from "@/base/components/utils/theme";
+import { photosTheme } from "@/base/components/utils/theme";
import log from "@/base/log";
import { logStartupBanner } from "@/base/log-web";
import { AppUpdate } from "@/base/types/ipc";
@@ -181,7 +181,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
<>
<CustomHead {...{ title }} />
- <ThemeProvider theme={getTheme("photos")}>
+ <ThemeProvider theme={photosTheme}>
<CssBaseline enableColorScheme />
<LoadingBar color="#51cd7c" ref={loadingBarRef} />
diff --git a/web/packages/base/components/utils/theme.ts b/web/packages/base/components/utils/theme.ts
index 5b8ee9e796..4e8fde99c8 100644
--- a/web/packages/base/components/utils/theme.ts
+++ b/web/packages/base/components/utils/theme.ts
@@ -6,6 +6,7 @@
import type {
FixedColors,
PaletteOptions,
+ Theme,
ThemeColorsOptions,
} from "@mui/material";
import { createTheme } from "@mui/material";
@@ -17,7 +18,7 @@ enum THEME_COLOR {
DARK = "dark",
}
-export const getTheme = (colorAccentType: ColorAccentType) => {
+const getTheme = (colorAccentType: ColorAccentType): Theme => {
const colors = getColors(THEME_COLOR.DARK, colorAccentType);
const palette = getPallette(THEME_COLOR.DARK, colors);
const components = getComponents(colors, palette, typography);
@@ -39,7 +40,7 @@ export const getTheme = (colorAccentType: ColorAccentType) => {
});
};
-export type ColorAccentType = "auth" | "photos";
+type ColorAccentType = "auth" | "photos";
/**
* [Note: Colors]
@@ -757,3 +758,18 @@ function getIconColor(
}
return {};
}
+
+// Exports ---
+
+/**
+ * The MUI {@link Theme} to use for the photos app.
+ *
+ * This is also the "default" theme, in that it is used for the accounts app
+ * which serves both photos and auth.
+ */
+export const photosTheme = getTheme("photos");
+
+/**
+ * The MUI {@link Theme} to use for the auth app.
+ */
+export const authTheme = getTheme("auth");