git ssb

16+

Dominic / patchbay



Commit 00b7dc676f3599b4be16806c7ce93abbd9c724c5

add compose (WIP) and use flexbox

Dominic Tarr committed on 5/14/2016, 12:06:14 PM
Parent: 251a4d7b1477eafd58a6093249e659cf49f23e0c

Files changed

modules/feed.jschanged
modules/main.jschanged
modules/message.jschanged
modules/tabs.jschanged
modules/thread.jschanged
modules/feed.jsView
@@ -1,13 +1,15 @@
11 var ref = require('ssb-ref')
22 var ui = require('../ui')
3-
3+var Scroller = require('pull-scroll')
44 exports.screen_view = function (id, sbot) {
5- if(ref.isFeed(id))
5+ if(ref.isFeed(id)) {
6+
67 return ui.createStream(
7- sbot.createUserStream({id: id, limit: 100, reverse: true}),
8+ sbot.createUserStream({id: id, reverse: true}),
89 ui.createRenderers(exports.message_render, sbot)
910 )
11+ }
1012 }
1113
1214 exports.message_render = []
1315
modules/main.jsView
@@ -1,18 +1,33 @@
1-
1+var h = require('hyperscript')
22 var ui = require('../ui')
3+var u = require('../util')
4+var pull = require('pull-stream')
5+var Scroller = require('pull-scroll')
36
47 exports.screen_view = function (path, sbot) {
5- if(path === '/')
6- return ui.createStream(
7- sbot.createLogStream({limit: 100, reverse: true}),
8- ui.createRenderers(exports.message_render, sbot)
8+ if(path === '/') {
9+
10+ var content = h('div.column')
11+ var div = h('div.column', {style: {'overflow':'auto'}},
12+ u.decorate(exports.message_compose, {}, function (d, e, v) {
13+ return d(e, v, sbot)
14+ }),
15+ content
916 )
17+ var render = ui.createRenderers(exports.message_render, sbot)
18+
19+ pull(
20+ sbot.createLogStream({reverse: true}),
21+ Scroller(div, content, render, false, false)
22+ )
23+
24+ return div
25+ }
1026 }
1127
1228 exports.message_render = []
29+exports.message_compose = []
1330
1431
1532
1633
17-
18-
modules/message.jsView
@@ -29,15 +29,15 @@
2929 })
3030 )
3131
3232 if(el)
33- return h('div.message',
34- h('div.title',
33+ return h('div.message.column',
34+ h('div.title.row',
3535 h('div.avatar', map(exports.avatar, msg.value.author)),
36- h('div.metadata', map(exports.message_meta, msg))
36+ h('div.message_meta.row', map(exports.message_meta, msg))
3737 ),
38- h('div.content', el),
39- h('div.footer',
38+ h('div.message_content', el),
39+ h('div.message_actions.row',
4040 h('div.actions', map(exports.message_action))
4141 ),
4242 backlinks
4343 )
modules/tabs.jsView
@@ -17,8 +17,9 @@
1717 })
1818 }
1919
2020 var tabs = Tabs()
21+ tabs.classList.add('screen')
2122 var main = screen('/')
2223 if(main) tabs.add('main', main, true)
2324
2425 tabs.onclick = function (ev) {
@@ -40,11 +41,4 @@
4041
4142 exports.message_render = []
4243 exports.screen_view = []
4344
44-
45-
46-
47-
48-
49-
50-
modules/thread.jsView
@@ -2,8 +2,11 @@
22 var pull = require('pull-stream')
33 var Cat = require('pull-cat')
44 var Sort = require('pull-sort')
55 var ref = require('ssb-ref')
6+var h = require('hyperscript')
7+var u = require('../util')
8+var Scroller = require('pull-scroll')
69
710 function once (cont) {
811 var ended = false
912 return function (abort, cb) {
@@ -39,15 +42,37 @@
3942 )
4043 }
4144
4245 exports.screen_view = function (id, sbot) {
43- if(ref.isMsg(id))
46+ if(ref.isMsg(id)) {
47+ var content = h('div.column')
48+ var div = h('div.column', {style: {'overflow':'auto'}},
49+ h('div', content),
50+ u.decorate(exports.message_compose, {root: id}, function (d, e, v) {
51+ return d(e, v, sbot)
52+ })
53+ )
54+ var render = ui.createRenderers(exports.message_render, sbot)
55+
56+ pull(
57+ threadStream(id, sbot),
58+ Scroller(div, content, render, false, false)
59+ )
60+
61+ return div
62+ }
63+
4464 return ui.createStream(
45- threadStream(id, sbot),
4665 ui.createRenderers(exports.message_render, sbot)
4766 )
4867 }
4968
5069 exports.message_render = []
70+exports.message_compose = []
5171
5272
5373
74+
75+
76+
77+
78+

Built with git-ssb-web