diff --git a/components/common/Alert/index.module.scss b/components/common/Alert/index.module.scss index c357e253..db0c2848 100644 --- a/components/common/Alert/index.module.scss +++ b/components/common/Alert/index.module.scss @@ -1,4 +1,4 @@ -.AlertWrapper { +.wrapper { align-items: center; display: flex; justify-content: center; @@ -10,7 +10,17 @@ z-index: 31; } -.Alert { +.overlay { + isolation: isolate; + position: fixed; + z-index: 9; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.alert { animation: $duration-modal-open cubic-bezier(0.16, 1, 0.3, 1) 0s 1 normal none running openModalDesktop; background: var(--dialog-bg); @@ -52,9 +62,21 @@ align-self: center; width: 100%; - .Button { + & > * { width: 100%; } } } + + @keyframes openModalDesktop { + 0% { + opacity: 0; + transform: scale(0.96); + } + + 100% { + // opacity: 1; + transform: scale(1); + } + } } diff --git a/components/common/Alert/index.tsx b/components/common/Alert/index.tsx index 5b07ae46..c71d42bf 100644 --- a/components/common/Alert/index.tsx +++ b/components/common/Alert/index.tsx @@ -21,44 +21,43 @@ const Alert = (props: Props) => { return ( - -
+ +
- {props.title ? ( + {props.title && ( {props.title} - ) : ( - '' )} - + {props.message} -
+
- ) diff --git a/components/common/Overlay/index.module.scss b/components/common/Overlay/index.module.scss index b8282ca9..15fbbb25 100644 --- a/components/common/Overlay/index.module.scss +++ b/components/common/Overlay/index.module.scss @@ -1,4 +1,5 @@ .overlay { + pointer-events: auto; isolation: isolate; position: fixed; z-index: 9; diff --git a/components/common/Overlay/index.tsx b/components/common/Overlay/index.tsx index e4d6efce..5cc81768 100644 --- a/components/common/Overlay/index.tsx +++ b/components/common/Overlay/index.tsx @@ -5,6 +5,7 @@ import styles from './index.module.scss' interface Props { visible: boolean open: boolean + onClick?: (event: React.MouseEvent) => void } const defaultProps = { @@ -12,13 +13,7 @@ const defaultProps = { } const Overlay = React.forwardRef(function Overlay( - { - visible: displayed, - open, - }: { - visible: boolean - open: boolean - }, + { visible: displayed, open, onClick }: Props, forwardedRef ) { const [visible, setVisible] = useState(open) @@ -42,7 +37,9 @@ const Overlay = React.forwardRef(function Overlay( }, [open]) function handleClick(event: React.MouseEvent) { - event.stopPropagation() + // event.stopPropagation() + console.log('Hey!') + if (onClick) onClick(event) } return visible ? (