git ssb

2+

mixmix / ticktack



Tree: adca29179dee2177af6fefa725c91581ffef5395

Files: adca29179dee2177af6fefa725c91581ffef5395 / app / html / lightbox.js

552 bytesRaw
1const nest = require('depnest')
2const { h, when, Value } = require('mutant')
3
4exports.gives = nest('app.html.lightbox')
5
6exports.create = (api) => {
7 return nest('app.html.lightbox', (content, isOpen) => {
8 if (typeof isOpen !== 'function') isOpen = Value(false)
9
10 const closeMe = () => isOpen.set(false)
11
12 const lb = h('Lightbox', { className: when(isOpen, '-open', '-close'), 'ev-click': closeMe },
13 h('div.content', {'ev-click': (ev) => ev.stopPropagation()}, [
14 content
15 ]))
16
17 lb.close = closeMe
18
19 return lb
20 })
21}
22

Built with git-ssb-web