renamed panel to popup since that's kinda what it is lmao
This commit is contained in:
24
src/views/components/common/Popup/Popup.module.scss
Normal file
24
src/views/components/common/Popup/Popup.module.scss
Normal file
@@ -0,0 +1,24 @@
|
||||
@import 'src/views/styles/base.module.scss';
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
||||
&.overlay {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 2147483647;
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
overflow-y: auto;
|
||||
z-index: 2147483647;
|
||||
background-color: $white;
|
||||
box-shadow: 0px 12px 30px 0px #323e5f29;
|
||||
transition: box-shadow 0.15s;
|
||||
}
|
||||
32
src/views/components/common/Popup/Popup.tsx
Normal file
32
src/views/components/common/Popup/Popup.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import classNames from 'classnames';
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
import styles from './Popup.module.scss';
|
||||
|
||||
interface Props {
|
||||
testId?: string;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
/** Should it display a subtle dark overlay over the rest of the screen */
|
||||
overlay?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export default function Popup(props: PropsWithChildren<Props>) {
|
||||
return (
|
||||
<div
|
||||
style={props.style}
|
||||
className={classNames(
|
||||
styles.container,
|
||||
{
|
||||
[styles.overlay]: props.overlay,
|
||||
},
|
||||
props.className
|
||||
)}
|
||||
data-testid={props.testId}
|
||||
>
|
||||
<div className={styles.body}>{props.children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user