summaryrefslogtreecommitdiffstats
path: root/html/src/components/modal/index.tsx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:54:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:54:31 +0000
commit3b4936b6f2b870f9f2444ebb6ce1ca2de3f49d9f (patch)
treec91ab0ac9447b25f91c05e901212c2142fb95953 /html/src/components/modal/index.tsx
parentInitial commit. (diff)
downloadttyd-6c52e44f492ddf2c353c53c5d1ecf7251b792555.tar.xz
ttyd-6c52e44f492ddf2c353c53c5d1ecf7251b792555.zip
Adding upstream version 1.7.4.upstream/1.7.4
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>
+ )
+ );
+ }
+}