You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
800 B
27 lines
800 B
import {ReactNode, useState} from "react";
|
|
import "../style/popup.css"
|
|
|
|
export interface PopupProps {
|
|
children: ReactNode[] | ReactNode,
|
|
displayState: boolean,
|
|
onClose: () => void
|
|
}
|
|
|
|
export default function Popup({children, displayState, onClose}: PopupProps) {
|
|
return (
|
|
<div id="popup-background"
|
|
style={{
|
|
display: displayState ? 'flex' : 'none',
|
|
position: "absolute",
|
|
width: "78%",
|
|
height: "79%",
|
|
overflow:"hidden"
|
|
}}
|
|
onClick={onClose}>
|
|
<div id="content" onClick={event => event.stopPropagation()}>
|
|
<button id="close-button" onClick={onClose}>X</button>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
} |