Skip to content

armgit / ente

Public Imported from GitHub
0

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

wf cleanup

Manav Rathie093a0de611e
diff --git a/web/apps/photos/src/components/WatchFolder.tsx b/web/apps/photos/src/components/WatchFolder.tsx
index fca3882958..1ab106082a 100644
--- a/web/apps/photos/src/components/WatchFolder.tsx
+++ b/web/apps/photos/src/components/WatchFolder.tsx
@@ -15,7 +15,6 @@ import type { CollectionMapping, FolderWatch } from "@/base/types/ipc";
import { CollectionMappingChoice } from "@/new/photos/components/CollectionMappingChoice";
import { DialogCloseIconButton } from "@/new/photos/components/mui/Dialog";
import { useAppContext } from "@/new/photos/types/context";
-import { FlexWrapper } from "@ente/shared/components/Container";
import AddIcon from "@mui/icons-material/Add";
import CheckIcon from "@mui/icons-material/Check";
import DoNotDisturbOutlinedIcon from "@mui/icons-material/DoNotDisturbOutlined";
@@ -29,7 +28,6 @@ import {
Stack,
Tooltip,
Typography,
- styled,
} from "@mui/material";
import { t } from "i18next";
import React, { useEffect, useState } from "react";
@@ -121,7 +119,7 @@ export const WatchFolder: React.FC<ModalVisibilityProps> = ({
onClose={onClose}
fullWidth
slotProps={{
- paper: { sx: { height: "448px", maxWidth: "414px" } },
+ paper: { sx: { height: "448px", maxWidth: "444px" } },
}}
>
<SpaceBetweenFlex sx={{ p: "16px 8px 0px 8px" }}>
@@ -157,31 +155,20 @@ interface WatchList {
removeWatch: (watch: FolderWatch) => void;
}
-const WatchList: React.FC<WatchList> = ({ watches, removeWatch }) => {
- return (watches ?? []).length === 0 ? (
+const WatchList: React.FC<WatchList> = ({ watches, removeWatch }) =>
+ (watches ?? []).length === 0 ? (
<NoWatches />
) : (
- <WatchesContainer>
- {watches.map((watch) => {
- return (
- <WatchEntry
- key={watch.folderPath}
- watch={watch}
- removeWatch={removeWatch}
- />
- );
- })}
- </WatchesContainer>
+ <Stack sx={{ gap: 2, flex: 1, overflowY: "auto", pb: 2, pr: 1 }}>
+ {watches.map((watch) => (
+ <WatchEntry
+ key={watch.folderPath}
+ watch={watch}
+ removeWatch={removeWatch}
+ />
+ ))}
+ </Stack>
);
-};
-
-const WatchesContainer = styled("div")(() => ({
- height: "278px",
- overflow: "auto",
- "&::-webkit-scrollbar": {
- width: "4px",
- },
-}));
const NoWatches: React.FC = () => {
return (
@@ -235,34 +222,27 @@ const WatchEntry: React.FC<WatchEntryProps> = ({ watch, removeWatch }) => {
};
return (
- <SpaceBetweenFlex>
- <Stack direction="row" sx={{ overflow: "hidden" }}>
+ <SpaceBetweenFlex sx={{ overflow: "hidden", flexShrink: 0 }}>
+ <Stack direction="row" sx={{ overflow: "hidden", gap: 1.5 }}>
{watch.collectionMapping === "root" ? (
<Tooltip title={t("uploaded_to_single_collection")}>
- <FolderOpenIcon />
+ <FolderOpenIcon color="secondary" />
</Tooltip>
) : (
<Tooltip title={t("uploaded_to_separate_collections")}>
- <FolderCopyOutlinedIcon />
+ <FolderCopyOutlinedIcon color="secondary" />
</Tooltip>
)}
- <EntryContainer>
+ <Stack sx={{ overflow: "hidden" }}>
<EntryHeading watch={watch} />
<FolderPath>{watch.folderPath}</FolderPath>
- </EntryContainer>
+ </Stack>
</Stack>
<EntryOptions {...{ confirmStopWatching }} />
</SpaceBetweenFlex>
);
};
-const EntryContainer = styled("div")({
- overflow: "hidden",
- marginLeft: "12px",
- marginRight: "6px",
- marginBottom: "12px",
-});
-
interface EntryHeadingProps {
watch: FolderWatch;
}
@@ -271,12 +251,19 @@ const EntryHeading: React.FC<EntryHeadingProps> = ({ watch }) => {
const folderPath = watch.folderPath;
return (
- <FlexWrapper gap={1}>
- <Typography>{basename(folderPath)}</Typography>
+ <Stack
+ direction="row"
+ sx={{
+ gap: 1,
+ alignItems: "center",
+ justifyContent: "flex-start",
+ }}
+ >
+ <Typography sx={{ flex: 1 }}>{basename(folderPath)}</Typography>
{watcher.isSyncingFolder(folderPath) && (
- <CircularProgress size={12} />
+ <CircularProgress size={15} sx={{ color: "stroke.muted" }} />
)}
- </FlexWrapper>
+ </Stack>
);
};
@@ -290,22 +277,20 @@ interface EntryOptionsProps {
confirmStopWatching: () => void;
}
-const EntryOptions: React.FC<EntryOptionsProps> = ({ confirmStopWatching }) => {
- return (
- <OverflowMenu
- ariaID={"watch-mapping-option"}
- menuPaperSxProps={{ backgroundColor: "background.paper2" }}
+const EntryOptions: React.FC<EntryOptionsProps> = ({ confirmStopWatching }) => (
+ <OverflowMenu
+ ariaID={"watch-mapping-option"}
+ menuPaperSxProps={{ backgroundColor: "background.paper2" }}
+ >
+ <OverflowMenuOption
+ color="critical"
+ onClick={confirmStopWatching}
+ startIcon={<DoNotDisturbOutlinedIcon />}
>
- <OverflowMenuOption
- color="critical"
- onClick={confirmStopWatching}
- startIcon={<DoNotDisturbOutlinedIcon />}
- >
- {t("stop_watching")}
- </OverflowMenuOption>
- </OverflowMenu>
- );
-};
+ {t("stop_watching")}
+ </OverflowMenuOption>
+ </OverflowMenu>
+);
/**
* Return true if all the paths in the given list are items that belong to the