Fix dialog
This commit is contained in:
parent
38d6464f55
commit
1548bcd378
6 changed files with 19 additions and 30 deletions
|
@ -6,10 +6,7 @@ import { accountLogout } from "@ente/accounts/services/logout";
|
|||
import { APPS, APP_TITLES } from "@ente/shared/apps/constants";
|
||||
import { Overlay } from "@ente/shared/components/Container";
|
||||
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
|
||||
import type {
|
||||
DialogBoxAttributesV2,
|
||||
SetDialogBoxAttributesV2,
|
||||
} from "@ente/shared/components/DialogBoxV2/types";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import { AppNavbar } from "@ente/shared/components/Navbar/app";
|
||||
import { useLocalState } from "@ente/shared/hooks/useLocalState";
|
||||
|
@ -28,7 +25,7 @@ import "styles/global.css";
|
|||
interface AppContextProps {
|
||||
isMobile: boolean;
|
||||
showNavBar: (show: boolean) => void;
|
||||
setDialogBoxAttributesV2: SetDialogBoxAttributesV2;
|
||||
setDialogBoxAttributesV2: (attrs: DialogBoxAttributesV2) => void;
|
||||
logout: () => void;
|
||||
}
|
||||
|
||||
|
@ -39,8 +36,9 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||
|
||||
const [showNavbar, setShowNavBar] = useState(false);
|
||||
|
||||
const [dialogBoxAttributeV2, setDialogBoxAttributesV2] =
|
||||
useState<DialogBoxAttributesV2>();
|
||||
const [dialogBoxAttributeV2, setDialogBoxAttributesV2] = useState<
|
||||
DialogBoxAttributesV2 | undefined
|
||||
>();
|
||||
|
||||
const [dialogBoxV2View, setDialogBoxV2View] = useState(false);
|
||||
|
||||
|
@ -106,8 +104,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||
value={{
|
||||
isMobile,
|
||||
showNavBar,
|
||||
setDialogBoxAttributesV2:
|
||||
setDialogBoxAttributesV2 as any,
|
||||
setDialogBoxAttributesV2,
|
||||
logout,
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -12,10 +12,7 @@ import {
|
|||
} from "@ente/shared/apps/constants";
|
||||
import { Overlay } from "@ente/shared/components/Container";
|
||||
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
|
||||
import type {
|
||||
DialogBoxAttributesV2,
|
||||
SetDialogBoxAttributesV2,
|
||||
} from "@ente/shared/components/DialogBoxV2/types";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import { MessageContainer } from "@ente/shared/components/MessageContainer";
|
||||
import { AppNavbar } from "@ente/shared/components/Navbar/app";
|
||||
|
@ -43,7 +40,7 @@ type AppContextType = {
|
|||
themeColor: THEME_COLOR;
|
||||
setThemeColor: (themeColor: THEME_COLOR) => void;
|
||||
somethingWentWrong: () => void;
|
||||
setDialogBoxAttributesV2: SetDialogBoxAttributesV2;
|
||||
setDialogBoxAttributesV2: (attrs: DialogBoxAttributesV2) => void;
|
||||
logout: () => void;
|
||||
};
|
||||
|
||||
|
@ -59,8 +56,9 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||
const [showNavbar, setShowNavBar] = useState(false);
|
||||
const isLoadingBarRunning = useRef<boolean>(false);
|
||||
const loadingBar = useRef<LoadingBarRef>(null);
|
||||
const [dialogBoxAttributeV2, setDialogBoxAttributesV2] =
|
||||
useState<DialogBoxAttributesV2>({});
|
||||
const [dialogBoxAttributeV2, setDialogBoxAttributesV2] = useState<
|
||||
DialogBoxAttributesV2 | undefined
|
||||
>();
|
||||
const [dialogBoxV2View, setDialogBoxV2View] = useState(false);
|
||||
const isMobile = useMediaQuery("(max-width:428px)");
|
||||
const [themeColor, setThemeColor] = useLocalState(
|
||||
|
|
|
@ -18,10 +18,7 @@ import {
|
|||
SetDialogBoxAttributes,
|
||||
} from "@ente/shared/components/DialogBox/types";
|
||||
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
|
||||
import type {
|
||||
DialogBoxAttributesV2,
|
||||
SetDialogBoxAttributesV2,
|
||||
} from "@ente/shared/components/DialogBoxV2/types";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import { MessageContainer } from "@ente/shared/components/MessageContainer";
|
||||
import { AppNavbar } from "@ente/shared/components/Navbar/app";
|
||||
|
@ -96,7 +93,7 @@ type AppContextType = {
|
|||
themeColor: THEME_COLOR;
|
||||
setThemeColor: (themeColor: THEME_COLOR) => void;
|
||||
somethingWentWrong: () => void;
|
||||
setDialogBoxAttributesV2: SetDialogBoxAttributesV2;
|
||||
setDialogBoxAttributesV2: (attrs: DialogBoxAttributesV2) => void;
|
||||
isCFProxyDisabled: boolean;
|
||||
setIsCFProxyDisabled: (disabled: boolean) => void;
|
||||
logout: () => void;
|
||||
|
@ -118,8 +115,9 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||
const isLoadingBarRunning = useRef(false);
|
||||
const loadingBar = useRef(null);
|
||||
const [dialogMessage, setDialogMessage] = useState<DialogBoxAttributes>();
|
||||
const [dialogBoxAttributeV2, setDialogBoxAttributesV2] =
|
||||
useState<DialogBoxAttributesV2>();
|
||||
const [dialogBoxAttributeV2, setDialogBoxAttributesV2] = useState<
|
||||
DialogBoxAttributesV2 | undefined
|
||||
>();
|
||||
useState<DialogBoxAttributes>(null);
|
||||
const [messageDialogView, setMessageDialogView] = useState(false);
|
||||
const [dialogBoxV2View, setDialogBoxV2View] = useState(false);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { TwoFactorType } from "@ente/accounts/constants/twofactor";
|
||||
import type { SetDialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import { APPS } from "./constants";
|
||||
|
||||
export interface PageProps {
|
||||
appContext: {
|
||||
showNavBar: (show: boolean) => void;
|
||||
isMobile: boolean;
|
||||
setDialogBoxAttributesV2: SetDialogBoxAttributesV2;
|
||||
setDialogBoxAttributesV2: (attrs: DialogBoxAttributesV2) => void;
|
||||
logout: () => void;
|
||||
};
|
||||
appName: APPS;
|
||||
|
|
|
@ -15,7 +15,7 @@ import type { DialogBoxAttributesV2 } from "./types";
|
|||
type IProps = React.PropsWithChildren<
|
||||
Omit<DialogProps, "onClose"> & {
|
||||
onClose: () => void;
|
||||
attributes: DialogBoxAttributesV2;
|
||||
attributes?: DialogBoxAttributesV2;
|
||||
}
|
||||
>;
|
||||
|
||||
|
|
|
@ -39,7 +39,3 @@ export interface DialogBoxAttributesV2 {
|
|||
}[];
|
||||
buttonDirection?: "row" | "column";
|
||||
}
|
||||
|
||||
export type SetDialogBoxAttributesV2 = React.Dispatch<
|
||||
React.SetStateAction<DialogBoxAttributesV2>
|
||||
>;
|
||||
|
|
Loading…
Add table
Reference in a new issue