Skip to content

armgit / ente

Public Imported from GitHub
0

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

Split photos and albums head handling

Anand Baburajan1350de828439
diff --git a/web/apps/albums/src/pages/_app.tsx b/web/apps/albums/src/pages/_app.tsx
index 551fdcb168..434ba57fc8 100644
--- a/web/apps/albums/src/pages/_app.tsx
+++ b/web/apps/albums/src/pages/_app.tsx
@@ -3,7 +3,7 @@ import { CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import { useNotification } from "components/utils/hooks-app";
import { staticAppTitle } from "ente-base/app";
-import { CustomHeadPhotosOrAlbums } from "ente-base/components/Head";
+import { CustomHeadAlbums } from "ente-base/components/Head";
import { LoadingIndicator } from "ente-base/components/loaders";
import { AttributedMiniDialog } from "ente-base/components/MiniDialog";
import { useAttributedMiniDialog } from "ente-base/components/utils/dialog";
@@ -45,12 +45,11 @@ const App: React.FC<AlbumsAppProps> = ({ Component, pageProps }) => {
}),
[showLoadingBar, hideLoadingBar, showNotification],
);
-
const title = isI18nReady ? t("title_photos") : staticAppTitle;
return (
<ThemeProvider theme={photosTheme}>
- <CustomHeadPhotosOrAlbums {...{ title }} />
+ <CustomHeadAlbums {...{ title }} />
<CssBaseline enableColorScheme />
<ThemedLoadingBar ref={loadingBarRef} />
diff --git a/web/apps/embed/src/pages/_app.tsx b/web/apps/embed/src/pages/_app.tsx
index dac5406386..ee53c7a286 100644
--- a/web/apps/embed/src/pages/_app.tsx
+++ b/web/apps/embed/src/pages/_app.tsx
@@ -1,7 +1,7 @@
import "@fontsource-variable/inter";
import { CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
-import { CustomHeadPhotosOrAlbums } from "ente-base/components/Head";
+import { CustomHead } from "ente-base/components/Head";
import {
useIsRouteChangeInProgress,
useSetupI18n,
@@ -70,7 +70,7 @@ export default function App({ Component, pageProps }: AppProps) {
return (
<>
- <CustomHeadPhotosOrAlbums title="Ente Photos" />
+ <CustomHead title="Ente Photos" />
<ThemeProvider theme={photosTheme}>
<CssBaseline enableColorScheme />
<BaseContext.Provider value={baseContext}>
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index 695004bcba..a9bf3ff361 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -11,7 +11,7 @@ import {
} from "ente-accounts/services/accounts-db";
import { isDesktop, staticAppTitle } from "ente-base/app";
import { CenteredRow } from "ente-base/components/containers";
-import { CustomHeadPhotosOrAlbums } from "ente-base/components/Head";
+import { CustomHead } from "ente-base/components/Head";
import {
LoadingIndicator,
TranslucentLoadingOverlay,
@@ -194,7 +194,7 @@ const App: React.FC<PhotosAppProps> = ({ Component, pageProps }) => {
return (
<ThemeProvider theme={photosTheme}>
- <CustomHeadPhotosOrAlbums {...{ title }} />
+ <CustomHead {...{ title }} />
<CssBaseline enableColorScheme />
<ThemedLoadingBar ref={loadingBarRef} />
diff --git a/web/packages/base/components/Head.tsx b/web/packages/base/components/Head.tsx
index 613ad6dcb0..70cc479e69 100644
--- a/web/packages/base/components/Head.tsx
+++ b/web/packages/base/components/Head.tsx
@@ -46,7 +46,7 @@ export const CustomHead: React.FC<CustomHeadProps> = ({ title }) => (
* To avoid getting in the way of self hosters, we do a deployment URL check
* before inlining this into the build.
*/
-export const CustomHeadAlbums: React.FC = () => (
+export const CustomHeadAlbumsStatic: React.FC = () => (
<Head>
<title>Ente Photos</title>
<link rel="icon" href="/images/favicon.png" type="image/png" />
@@ -70,37 +70,27 @@ export const CustomHeadAlbums: React.FC = () => (
/**
* A convenience fan out to conditionally show one of {@link CustomHead} or
- * {@link CustomHeadAlbums}.
+ * {@link CustomHeadAlbumsStatic}.
*
- * 1. This component defaults to {@link CustomHeadAlbums} during SSR unless a
- * custom endpoint is defined.
- *
- * 2. Currently the photos and albums app use the same code. During SSR this
- * uses the albums variant, and then does a client side update to the photos
- * head when it detects that the origin it is being served on is not the
- * albums origin.
- *
- * The current content of the head is such that it sort of works for both photos
- * and public albums, so the client side update is just an enhancement. We
- * should not need this component when the photos and public albums app split.
+ * This component defaults to {@link CustomHeadAlbumsStatic} during SSR unless a
+ * custom endpoint is defined, and then does a client side update when it
+ * detects that the origin it is being served on is not the albums origin.
*/
-export const CustomHeadPhotosOrAlbums: React.FC<CustomHeadProps> = ({
- title,
-}) =>
+export const CustomHeadAlbums: React.FC<CustomHeadProps> = ({ title }) =>
isCustomAlbumsAppOrigin ||
(haveWindow() &&
new URL(window.location.href).origin != albumsAppOrigin()) ? (
<CustomHead {...{ title }} />
) : (
- <CustomHeadAlbums />
+ <CustomHeadAlbumsStatic />
);
/**
* A static SSR-ed variant of {@link CustomHead} for use with the share app
* (Public Locker) deployed on production Ente instances for link previews.
*
- * Similar to {@link CustomHeadAlbums}, this includes Open Graph meta tags with
- * absolute URLs for social media preview images.
+ * Similar to {@link CustomHeadAlbumsStatic}, this includes Open Graph meta tags
+ * with absolute URLs for social media preview images.
*/
export const CustomHeadShareStatic: React.FC = () => (
<Head>