summaryrefslogtreecommitdiffstats
path: root/html/src/components/modal/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'html/src/components/modal/index.tsx')
-rw-r--r--html/src/components/modal/index.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/html/src/components/modal/index.tsx b/html/src/components/modal/index.tsx
new file mode 100644
index 0000000..558a218
--- /dev/null
+++ b/html/src/components/modal/index.tsx
@@ -0,0 +1,27 @@
+import { h, Component, ComponentChildren } from 'preact';
+
+import './modal.scss';
+
+interface Props {
+ show: boolean;
+ children: ComponentChildren;
+}
+
+export class Modal extends Component<Props> {
+ constructor(props: Props) {
+ super(props);
+ }
+
+ render({ show, children }: Props) {
+ return (
+ show && (
+ <div className="modal">
+ <div className="modal-background" />
+ <div className="modal-content">
+ <div className="box">{children}</div>
+ </div>
+ </div>
+ )
+ );
+ }
+}