summaryrefslogtreecommitdiffstats
path: root/html/src/components/modal/index.tsx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-08 13:16:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-08 13:16:47 +0000
commit4f5226cb7a97f86421a94fcc75c59fe6d709ae02 (patch)
tree1a2cab09cbbc1040650fe21c0a9cef15d2ccb6ee /html/src/components/modal/index.tsx
parentInitial commit. (diff)
downloadttyd-4f5226cb7a97f86421a94fcc75c59fe6d709ae02.tar.xz
ttyd-4f5226cb7a97f86421a94fcc75c59fe6d709ae02.zip
Adding upstream version 1.6.3.upstream/1.6.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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>
+ )
+ );
+ }
+}