git ssb

1+

Daan Patchwork / patchwork



Tree: afdcd2c2e04a1a406e0fb9e3efbe92ebfd65e1e2

Files: afdcd2c2e04a1a406e0fb9e3efbe92ebfd65e1e2 / lib / sheet / display.js

541 bytesRaw
1const h = require('mutant/h')
2
3module.exports = function (handler) {
4 const { content, footer, classList, onMount, attributes } = handler(done)
5
6 let fullAttributes = { className: 'Sheet', classList }
7 if (attributes !== undefined) {
8 fullAttributes = { ...attributes, ...fullAttributes }
9 }
10 const container = h('div', fullAttributes, [
11 h('section', [content]),
12 h('footer', [footer])
13 ])
14
15 document.body.appendChild(container)
16
17 if (onMount) onMount()
18
19 function done () {
20 document.body.removeChild(container)
21 }
22}
23

Built with git-ssb-web