git ssb

2+

mixmix / ticktack



Tree: a893a560b31905d216fdb21487f862a094bb7d6f

Files: a893a560b31905d216fdb21487f862a094bb7d6f / app / html / warning.js

908 bytesRaw
1const nest = require('depnest')
2const { h, watch } = require('mutant')
3
4exports.gives = nest('app.html.warning')
5
6exports.needs = nest({
7 'app.html.lightbox': 'first',
8 'app.obs.pluginsOk': 'first',
9 'translations.sync.strings': 'first'
10})
11
12exports.create = (api) => {
13 var seenWarning = false
14
15 return nest('app.html.warning', function warning () {
16 if (seenWarning) return
17
18 const t = api.translations.sync.strings().pluginsOk
19
20 const lightbox = api.app.html.lightbox(
21 h('div', [
22 h('h1', t.heading),
23 h('p', t.description),
24 h('p', t.advice),
25 h('Button', {
26 'ev-click': () => {
27 lightbox.close()
28 seenWarning = true
29 }},
30 t.action.ok
31 )
32 ])
33 )
34
35 watch(
36 api.app.obs.pluginsOk(),
37 isOk => {
38 if (isOk === false) lightbox.open()
39 }
40 )
41
42 return lightbox
43 })
44}
45
46

Built with git-ssb-web