diff options
Diffstat (limited to 'src/view/components')
-rw-r--r-- | src/view/components/modal.ts | 26 |
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 + ) + ) +} |