git ssb

16+

Dominic / patchbay



Commit 8e75010c68d2c079e58d57c19ae1919e2b878d31

add sbot connection indicator back in finally!

mix irving committed on 9/1/2017, 3:24:47 AM
Parent: dc283efb2799619e2251a148cc5e98c6174f86f9

Files changed

app/html/menu.jschanged
app/html/menu.mcsschanged
app/html/menu.jsView
@@ -1,29 +1,29 @@
11 const nest = require('depnest')
2-const { h, Value } = require('mutant')
2 +const { h, Value, when } = require('mutant')
33
44 exports.gives = nest('app.html.menu')
55
66 exports.needs = nest({
7- app: {
8- 'html.menuItem': 'map',
9- 'sync.goTo': 'first'
10- }
7 + "app.html.menuItem": "map",
8 + "app.sync.goTo": "first",
9 + "sbot.obs.connection": "first"
1110 })
1211
1312 exports.create = function (api) {
1413 var _menu
1514
1615 return nest('app.html.menu', function menu () {
1716 if (_menu) return _menu
1817
19- var state = Value('')
18 + const hoverClass = Value('')
19 + const connectionClass = when(api.sbot.obs.connection, '', '-disconnected')
2020
2121 // TODO: move goTo out into each menuItem
2222 _menu = h('Menu', {
23- classList: [ state ],
24- 'ev-mouseover': () => state.set('-active'),
25- 'ev-mouseout': () => state.set('')
23 + classList: [ hoverClass, connectionClass ],
24 + 'ev-mouseover': () => hoverClass.set('-open'),
25 + 'ev-mouseout': () => hoverClass.set('')
2626 }, [
2727 h('div', api.app.html.menuItem(api.app.sync.goTo))
2828 ])
2929
app/html/menu.mcssView
@@ -16,12 +16,16 @@
1616 background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0) 1.5rem, #f5f5f5 1.5rem, #f5f5f5)
1717 z-index: 5
1818 }
1919
20- -active {
20 + -open {
2121 div {
2222 display: flex
2323 flex-direction: column
2424 }
2525 }
26 +
27 + -disconnected {
28 + background-color: red
29 + }
2630 }
2731

Built with git-ssb-web