Skip to content

armgit / ente

Public Imported from GitHub
0

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

The open prop is necessary to get the animation to work

Manav Rathi13584c613723
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index dc694e32b1..7d9466eabc 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -129,7 +129,7 @@ export default function App({ Component, pageProps }: AppProps) {
>();
useState<DialogBoxAttributes>(null);
const [messageDialogView, setMessageDialogView] = useState(false);
- const [shouldShowWhatsNew, setShouldShowWhatsNew] = useState(true);
+ const [openWhatsNew, setOpenWhatsNew] = useState(true);
const [dialogBoxV2View, setDialogBoxV2View] = useState(false);
const [watchFolderView, setWatchFolderView] = useState(false);
const [watchFolderFiles, setWatchFolderFiles] = useState<FileList>(null);
@@ -387,9 +387,12 @@ export default function App({ Component, pageProps }: AppProps) {
onClose={closeDialogBoxV2}
attributes={dialogBoxAttributeV2}
/>
- {shouldShowWhatsNew && (
- <WhatsNew onClose={() => setShouldShowWhatsNew(false)} />
- )}
+
+ <WhatsNew
+ open={openWhatsNew}
+ onClose={() => setOpenWhatsNew(false)}
+ />
+
<Notification
open={notificationView}
onClose={closeNotification}
diff --git a/web/packages/new/photos/components/WhatsNew.tsx b/web/packages/new/photos/components/WhatsNew.tsx
index 2e50f2f68c..b074f8b231 100644
--- a/web/packages/new/photos/components/WhatsNew.tsx
+++ b/web/packages/new/photos/components/WhatsNew.tsx
@@ -9,10 +9,23 @@ import {
styled,
useMediaQuery,
} from "@mui/material";
+import Slide from "@mui/material/Slide";
+import { TransitionProps } from "@mui/material/transitions";
import React from "react";
+const Transition = React.forwardRef(function Transition(
+ props: TransitionProps & {
+ children: React.ReactElement
+ },
+ ref: React.Ref<unknown>,
+) {
+ return <Slide direction="up" ref={ref} {...props} />;
+});
+
interface WhatsNewProps {
- /** Invoked by the component when it wants to get closed. */
+ /** Set this to `true` to show the dialog. */
+ open: boolean;
+ /** Invoked by the dialog when it wants to get closed. */
onClose: () => void;
}
@@ -20,11 +33,15 @@ interface WhatsNewProps {
* Show a dialog showing a short summary of interesting-for-the-user things in
* this release of the desktop app.
*/
-export const WhatsNew: React.FC<WhatsNewProps> = ({ onClose }) => {
+export const WhatsNew: React.FC<WhatsNewProps> = ({ open, onClose }) => {
const fullScreen = useMediaQuery("(max-width: 428px)");
return (
- <Dialog open={true} fullScreen={fullScreen} maxWidth="xs">
+ <Dialog
+ {...{ open, fullScreen }}
+ maxWidth="xs"
+ TransitionComponent={Transition}
+ >
<DialogTitle>{"What's new"}</DialogTitle>
<DialogContent>
<DialogContentText>