Skip to content

armgit / ente

Public Imported from GitHub
0

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

Cleanup

Manav Rathif4b909f4a790
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsx
index 7d0737d79c..905e81d227 100644
--- a/web/apps/photos/src/components/FileList.tsx
+++ b/web/apps/photos/src/components/FileList.tsx
@@ -147,7 +147,6 @@ export interface FileListProps {
* It is not sticky, and scrolls along with the content of the list.
*/
footer?: FileListHeaderOrFooter;
- showAppDownloadBanner?: boolean;
/**
* The logged in user, if any.
*
@@ -203,7 +202,6 @@ export const FileList: React.FC<FileListProps> = ({
footer,
user,
annotatedFiles,
- showAppDownloadBanner,
isMagicSearchResult,
selectable,
selected,
@@ -276,8 +274,6 @@ export const FileList: React.FC<FileListProps> = ({
timeStampList.push(getVacuumItem(timeStampList));
if (footer) {
timeStampList.push(asFullSpanListItem(footer));
- } else if (showAppDownloadBanner) {
- timeStampList.push(getAppDownloadFooter());
}
if (publicCollectionGalleryContext.credentials) {
@@ -399,35 +395,6 @@ export const FileList: React.FC<FileListProps> = ({
};
};
- const getAppDownloadFooter = (): TimeStampListItem => ({
- height: FOOTER_HEIGHT,
- item: (
- <FooterContainer span={columns}>
- <Typography variant="small" sx={{ color: "text.faint" }}>
- <Trans
- i18nKey={"install_mobile_app"}
- components={{
- a: (
- <Link
- href="https://play.google.com/store/apps/details?id=io.ente.photos"
- target="_blank"
- rel="noopener"
- />
- ),
- b: (
- <Link
- href="https://apps.apple.com/in/app/ente-photos/id1542026904"
- target="_blank"
- rel="noopener"
- />
- ),
- }}
- />
- </Typography>
- </FooterContainer>
- ),
- });
-
const getAlbumsFooter = (): TimeStampListItem => ({
height: publicCollectionGalleryContext.referralCode
? ALBUM_FOOTER_HEIGHT_WITH_REFERRAL
@@ -966,18 +933,6 @@ const DateContainer = styled(ListItemContainer)(
`,
);
-const FooterContainer = styled(ListItemContainer)`
- margin-bottom: 0.75rem;
- @media (max-width: 540px) {
- font-size: 12px;
- margin-bottom: 0.5rem;
- }
- text-align: center;
- justify-content: center;
- align-items: flex-end;
- margin-top: calc(2rem + 20px);
-`;
-
const AlbumFooterContainer = styled(ListItemContainer, {
shouldForwardProp: (propName) => propName != "hasReferral",
})<{ hasReferral: boolean }>`
diff --git a/web/apps/photos/src/components/FileListWithViewer.tsx b/web/apps/photos/src/components/FileListWithViewer.tsx
index 3386588ec6..a332c70364 100644
--- a/web/apps/photos/src/components/FileListWithViewer.tsx
+++ b/web/apps/photos/src/components/FileListWithViewer.tsx
@@ -58,7 +58,6 @@ export type FileListWithViewerProps = {
| "modePlus"
| "header"
| "footer"
- | "showAppDownloadBanner"
| "isMagicSearchResult"
| "selectable"
| "selected"
@@ -98,7 +97,6 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({
user,
files,
enableDownload,
- showAppDownloadBanner,
isMagicSearchResult,
selectable,
selected,
@@ -186,7 +184,6 @@ export const FileListWithViewer: React.FC<FileListWithViewerProps> = ({
header,
footer,
user,
- showAppDownloadBanner,
isMagicSearchResult,
selectable,
selected,
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 7e3d14bc72..0cd16af4ee 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -1,7 +1,7 @@
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import FileUploadOutlinedIcon from "@mui/icons-material/FileUploadOutlined";
import MenuIcon from "@mui/icons-material/Menu";
-import { IconButton, Stack, Typography } from "@mui/material";
+import { IconButton, Link, Stack, Typography } from "@mui/material";
import { AuthenticateUser } from "components/AuthenticateUser";
import { GalleryBarAndListHeader } from "components/Collections/GalleryBarAndListHeader";
import { DownloadStatusNotifications } from "components/DownloadStatusNotifications";
@@ -967,6 +967,14 @@ const Page: React.FC = () => {
[],
);
+ const showAppDownloadFooter =
+ state.collectionFiles.length < 30 && !isInSearchMode;
+
+ const fileListFooter = useMemo(
+ () => (showAppDownloadFooter ? createAppDownloadFooter() : undefined),
+ [showAppDownloadFooter],
+ );
+
const showSelectionBar =
selected.count > 0 && selected.collectionID === activeCollectionID;
@@ -1149,12 +1157,10 @@ const Page: React.FC = () => {
mode={barMode}
modePlus={isInSearchMode ? "search" : barMode}
header={fileListHeader}
+ footer={fileListFooter}
user={user}
files={filteredFiles}
enableDownload={true}
- showAppDownloadBanner={
- state.collectionFiles.length < 30 && !isInSearchMode
- }
isMagicSearchResult={state.searchSuggestion?.type == "clip"}
selectable={true}
selected={selected}
@@ -1383,3 +1389,39 @@ const handleSubscriptionCompletionRedirectIfNeeded = async (
}
}
};
+
+const createAppDownloadFooter = (): FileListHeaderOrFooter => ({
+ item: (
+ <Typography
+ variant="small"
+ sx={{
+ alignSelf: "flex-end",
+ marginInline: "auto",
+ marginBlock: 0.75,
+ textAlign: "center",
+ color: "text.faint",
+ }}
+ >
+ <Trans
+ i18nKey={"install_mobile_app"}
+ components={{
+ a: (
+ <Link
+ href="https://play.google.com/store/apps/details?id=io.ente.photos"
+ target="_blank"
+ rel="noopener"
+ />
+ ),
+ b: (
+ <Link
+ href="https://apps.apple.com/in/app/ente-photos/id1542026904"
+ target="_blank"
+ rel="noopener"
+ />
+ ),
+ }}
+ />
+ </Typography>
+ ),
+ height: 90,
+});