Use different z-index for app-loading-screen

This commit is contained in:
Fedor Indutny 2021-12-04 00:04:34 +01:00 committed by GitHub
parent 874a019227
commit e46a1979c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 26 deletions

View file

@ -17,19 +17,20 @@ export type ActionSpec = {
style?: 'affirmative' | 'negative';
};
export type OwnProps = {
readonly moduleClassName?: string;
readonly actions?: Array<ActionSpec>;
readonly cancelText?: string;
readonly children?: React.ReactNode;
readonly i18n: LocalizerType;
readonly onCancel?: () => unknown;
readonly onClose: () => unknown;
readonly title?: string | React.ReactNode;
readonly theme?: Theme;
readonly hasXButton?: boolean;
readonly cancelButtonVariant?: ButtonVariant;
};
export type OwnProps = Readonly<{
moduleClassName?: string;
actions?: Array<ActionSpec>;
cancelText?: string;
children?: React.ReactNode;
i18n: LocalizerType;
onCancel?: () => unknown;
onClose: () => unknown;
title?: string | React.ReactNode;
theme?: Theme;
hasXButton?: boolean;
cancelButtonVariant?: ButtonVariant;
onTopOfEverything?: boolean;
}>;
export type Props = OwnProps;
@ -66,6 +67,7 @@ export const ConfirmationDialog = React.memo(
title,
hasXButton,
cancelButtonVariant,
onTopOfEverything,
}: Props) => {
const { close, overlayStyles, modalStyles } = useAnimated(onClose, {
getFrom: () => ({ opacity: 0, transform: 'scale(0.25)' }),
@ -91,7 +93,12 @@ export const ConfirmationDialog = React.memo(
const hasActions = Boolean(actions.length);
return (
<ModalHost onClose={close} theme={theme} overlayStyles={overlayStyles}>
<ModalHost
onTopOfEverything={onTopOfEverything}
onClose={close}
theme={theme}
overlayStyles={overlayStyles}
>
<animated.div style={modalStyles}>
<ModalWindow
hasXButton={hasXButton}