2021-05-13 18:57:37 +02:00
|
|
|
import styled from 'styled-components';
|
|
|
|
|
|
|
|
const DialogModalLayer = styled.div`
|
|
|
|
z-index: 9999;
|
|
|
|
display: flex;
|
2021-11-18 17:36:21 +02:00
|
|
|
position: fixed;
|
2021-05-13 18:57:37 +02:00
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-color: rgba(0,0,0,0.6);
|
|
|
|
align-items: flex-start;
|
|
|
|
justify-content: center;
|
2024-02-03 00:57:07 +02:00
|
|
|
|
|
|
|
overflow: auto;
|
|
|
|
scrollbar-width: none;
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-05-13 18:57:37 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const DialogRoot = styled.div`
|
|
|
|
background-color: ${props => props.theme.backgroundColor};
|
|
|
|
padding: 16px;
|
|
|
|
box-shadow: 6px 6px 20px rgba(0,0,0,0.5);
|
2021-08-16 16:20:14 +02:00
|
|
|
margin: 20px;
|
2021-05-13 18:57:37 +02:00
|
|
|
min-height: fit-content;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-08-16 16:20:14 +02:00
|
|
|
border-radius: 10px;
|
2021-05-13 18:57:37 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
interface Props {
|
2023-06-30 11:30:29 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
2021-05-13 18:57:37 +02:00
|
|
|
renderContent: Function;
|
2021-10-03 17:00:49 +02:00
|
|
|
className?: string;
|
2023-06-30 11:30:29 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
2021-10-03 17:00:49 +02:00
|
|
|
onClose?: Function;
|
2021-05-13 18:57:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function Dialog(props: Props) {
|
|
|
|
return (
|
2021-10-03 17:00:49 +02:00
|
|
|
<DialogModalLayer className={props.className}>
|
2021-05-13 18:57:37 +02:00
|
|
|
<DialogRoot>
|
|
|
|
{props.renderContent()}
|
|
|
|
</DialogRoot>
|
|
|
|
</DialogModalLayer>
|
|
|
|
);
|
|
|
|
}
|