Reusable
This commit is contained in:
@@ -71,7 +71,7 @@ import { TwoFactorSettings } from "ente-new/photos/components/sidebar/TwoFactorS
|
||||
import {
|
||||
confirmDisableMapsDialogAttributes,
|
||||
confirmEnableMapsDialogAttributes,
|
||||
} from "ente-new/photos/components/utils/dialog";
|
||||
} from "ente-new/photos/components/utils/dialog-attributes";
|
||||
import { downloadAppDialogAttributes } from "ente-new/photos/components/utils/download";
|
||||
import {
|
||||
useHLSGenerationStatusSnapshot,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||
import FileUploadOutlinedIcon from "@mui/icons-material/FileUploadOutlined";
|
||||
import InfoIcon from "@mui/icons-material/Info";
|
||||
import MenuIcon from "@mui/icons-material/Menu";
|
||||
import { IconButton, Stack, Typography } from "@mui/material";
|
||||
import { AuthenticateUser } from "components/AuthenticateUser";
|
||||
@@ -28,7 +27,6 @@ import { errorDialogAttributes } from "ente-base/components/utils/dialog";
|
||||
import { useIsSmallWidth } from "ente-base/components/utils/hooks";
|
||||
import { useModalVisibility } from "ente-base/components/utils/modal";
|
||||
import { useBaseContext } from "ente-base/context";
|
||||
import { pt } from "ente-base/i18n";
|
||||
import log from "ente-base/log";
|
||||
import {
|
||||
clearSessionStorage,
|
||||
@@ -71,6 +69,7 @@ import {
|
||||
useGalleryReducer,
|
||||
type GalleryBarMode,
|
||||
} from "ente-new/photos/components/gallery/reducer";
|
||||
import { notifyOthersFilesDialogAttributes } from "ente-new/photos/components/utils/dialog-attributes";
|
||||
import { useIsOffline } from "ente-new/photos/components/utils/use-is-offline";
|
||||
import { usePeopleStateSnapshot } from "ente-new/photos/components/utils/use-snapshot";
|
||||
import { shouldShowWhatsNew } from "ente-new/photos/services/changelog";
|
||||
@@ -666,12 +665,7 @@ const Page: React.FC = () => {
|
||||
}
|
||||
|
||||
if (notifyOtherFiles) {
|
||||
showMiniDialog({
|
||||
title: pt("Note"),
|
||||
icon: <InfoIcon />,
|
||||
message: pt("Files added by other users were not removed"),
|
||||
cancel: t("ok"),
|
||||
});
|
||||
showMiniDialog(notifyOthersFilesDialogAttributes());
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ import { FilePeopleList } from "ente-new/photos/components/PeopleList";
|
||||
import {
|
||||
confirmDisableMapsDialogAttributes,
|
||||
confirmEnableMapsDialogAttributes,
|
||||
} from "ente-new/photos/components/utils/dialog";
|
||||
} from "ente-new/photos/components/utils/dialog-attributes";
|
||||
import { useSettingsSnapshot } from "ente-new/photos/components/utils/use-snapshot";
|
||||
import {
|
||||
updateFileCaption,
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import { Link } from "@mui/material";
|
||||
import type { MiniDialogAttributes } from "ente-base/components/MiniDialog";
|
||||
import { t } from "i18next";
|
||||
import { Trans } from "react-i18next";
|
||||
|
||||
export const confirmEnableMapsDialogAttributes = (
|
||||
onConfirm: () => void,
|
||||
): MiniDialogAttributes => ({
|
||||
title: t("enable_maps_confirm"),
|
||||
message: (
|
||||
<Trans
|
||||
i18nKey={"enable_maps_confirm_message"}
|
||||
components={{
|
||||
a: (
|
||||
<Link
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
href="https://www.openstreetmap.org/"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
continue: { text: t("enable"), action: onConfirm },
|
||||
});
|
||||
|
||||
export const confirmDisableMapsDialogAttributes = (
|
||||
onConfirm: () => void,
|
||||
): MiniDialogAttributes => ({
|
||||
title: t("disable_maps_confirm"),
|
||||
message: <Trans i18nKey={"disable_maps_confirm_message"} />,
|
||||
continue: { text: t("disable"), color: "critical", action: onConfirm },
|
||||
});
|
||||
Reference in New Issue
Block a user