aboutsummaryrefslogtreecommitdiff
path: root/src/view/components
diff options
context:
space:
mode:
authorJoris2023-09-09 13:50:17 +0200
committerJoris2023-09-09 13:50:17 +0200
commit82429caf3c2886c2d94e09d020e645b06bd4680d (patch)
tree3183bf0c687c25e17fd36a23ced58fd1e6e29dda /src/view/components
parent08a5f3519f29cd486d7fe4c295e5d5c7f031104a (diff)
Allow to open book detail in modal
Diffstat (limited to 'src/view/components')
-rw-r--r--src/view/components/modal.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/view/components/modal.ts b/src/view/components/modal.ts
new file mode 100644
index 0000000..fe08272
--- /dev/null
+++ b/src/view/components/modal.ts
@@ -0,0 +1,26 @@
+import { h, Html } from 'lib/rx'
+
+interface Params {
+ content: Html,
+ onClose: () => void
+}
+
+export function view({ content, onClose }: Params): Html {
+ return h('div',
+ { className: 'g-Modal',
+ onclick: () => onClose()
+ },
+ h('div',
+ { className: 'g-Modal__Content',
+ onclick: (e: Event) => e.stopPropagation()
+ },
+ h('button',
+ { className: 'g-Modal__Close',
+ onclick: () => onClose()
+ },
+ '✖'
+ ),
+ content
+ )
+ )
+}