diff --git a/src/components/index.ts b/src/components/index.ts index 58d22f0..6949452 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -2,3 +2,4 @@ export * from "./base"; export * from "./title-bar"; export * from "./drawing-item"; export * from "./create-edit-bar"; +export * from "./modal"; diff --git a/src/components/modal.tsx b/src/components/modal.tsx new file mode 100644 index 0000000..a57eddb --- /dev/null +++ b/src/components/modal.tsx @@ -0,0 +1,55 @@ +import styled from "@emotion/styled"; +import { useState } from "react"; +import { POP_UP_WIDTH } from "../style"; +import { Group, Text, Button } from "./base"; + +export type ModalProps = { + title?: string, + description?: string, + opened: boolean, + onSubmit: (response: "Ok" | "Ignore") => void +} + +export const Modal = (props: ModalProps) => { + const { title, description, opened, onSubmit } = props; + const ModalBackground = styled.div` + position: absolute; + top: 0px; + height: 100%; + + left: 0px; + min-width: 100%; + background-color: gray; + opacity: 0.4; + `; + const ModalContainer = styled.div` + position: absolute; + top: 120px; + min-height: 120px; + + left: ${(POP_UP_WIDTH - 380) / 2}px; + min-width: 380px; + + padding: 10px; + z-index: 999; + + border: 2px black solid; + border-radius: 4px; + background-color: white; + `; + return <> +