π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Use theme color
Manav Rathib7841e2aeee9
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsxindex 924434d7cd..aef83d26c7 100644--- a/web/apps/photos/src/pages/_app.tsx+++ b/web/apps/photos/src/pages/_app.tsx@@ -12,6 +12,7 @@ import log from "@/base/log";import { logStartupBanner } from "@/base/log-web";import { AppUpdate } from "@/base/types/ipc";import { Notification } from "@/new/photos/components/Notification";+import { ThemedLoadingBar } from "@/new/photos/components/ThemedLoadingBar";import {updateAvailableForDownloadDialogAttributes,updateReadyToInstallDialogAttributes,@@ -39,7 +40,6 @@ import type { AppProps } from "next/app";import { useRouter } from "next/router";import "photoswipe/dist/photoswipe.css";import { useCallback, useEffect, useMemo, useState } from "react";-import LoadingBar from "react-top-loading-bar";import { resumeExportsIfNeeded } from "services/export";import { photosLogout } from "services/logout";@@ -183,7 +183,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {<ThemeProvider theme={photosTheme}><CssBaseline enableColorScheme />- <LoadingBar color="#51cd7c" ref={loadingBarRef} />+ <ThemedLoadingBar ref={loadingBarRef} /><AttributedMiniDialogsx={{ zIndex: photosDialogZIndex }}diff --git a/web/packages/new/photos/components/ThemedLoadingBar.tsx b/web/packages/new/photos/components/ThemedLoadingBar.tsxnew file mode 100644index 0000000000..96ad8afbdb--- /dev/null+++ b/web/packages/new/photos/components/ThemedLoadingBar.tsx@@ -0,0 +1,16 @@+import { useTheme } from "@mui/material";+import React from "react";+import LoadingBar, { type LoadingBarRef } from "react-top-loading-bar";++interface ThemedLoadingBarProps {+ ref: React.Ref<LoadingBarRef>;+}+/**+ * A wrapper over the {@link LoadingBar} library component that sets it to use+ * the main accent color from the theme.+ */+export const ThemedLoadingBar: React.FC<ThemedLoadingBarProps> = ({ ref }) => {+ const theme = useTheme();++ return <LoadingBar color={theme.vars.palette.accent.main} ref={ref} />;+};