git ssb

16+

Dominic / patchbay



Commit de41793084dc0680dd57842ec2fec0c18ac702e9

minimal profile page - activity feed only

mix irving committed on 2/27/2017, 4:56:05 AM
Parent: 8add0eb62b2365fd3bb77841ce09980a414c8d85

Files changed

message/html/compose.jschanged
router/html/page/profile.jsadded
message/html/compose.jsView
@@ -17,9 +17,9 @@
1717
1818 exports.gives = nest('message.html.compose')
1919
2020 exports.create = function (api) {
21- return nest('message.html.compose', compose)
21+ return nest({ 'message.html.compose': compose })
2222
2323 function compose ({ shrink = true, meta, prepublish, placeholder = 'Write a message' }, cb) {
2424 var files = []
2525 var filesById = {}
router/html/page/profile.jsView
@@ -1,0 +1,73 @@
1+const nest = require('depnest')
2+const ref = require('ssb-ref')
3+const Scroller = require('pull-scroll')
4+const pull = require('pull-stream')
5+const { h, watch } = require('mutant')
6+const next = require('../../../junk/next-stepper')
7+
8+exports.gives = nest({
9+ 'router.html.page': true
10+})
11+// menu_items
12+
13+exports.needs = nest({
14+ 'about.obs': {
15+ 'name': 'first'
16+ // 'description': 'first',
17+ // 'image': 'first',
18+ // 'imageUrl',
19+ // 'names',
20+ // 'images',
21+ },
22+ 'keys.sync.id': 'first',
23+ 'main.html.scroller': 'first',
24+ 'message.html.render': 'first',
25+ 'sbot.pull.userFeed': 'first'
26+})
27+
28+
29+exports.create = function (api) {
30+ return nest({
31+ 'router.html.page': page
32+ })
33+ // menu_items: () => h('a', {
34+ // href: '#'+self_id,
35+ // style: { order: 1 }
36+ // }, '/profile')
37+
38+ function page (id) {
39+ if (!ref.isFeed(id)) return
40+
41+ const profile = h('Profile', [
42+ // h('section.edit', api.about.edit(id)),
43+ // h('section.relationships', api.contact.relationships(id)),
44+ h('section.activity', [
45+ h('header', 'Activity')
46+ // ideally the scroller content would go in here
47+ ])
48+ ])
49+
50+ var { container, content } = api.main.html.scroller({ prepend: profile })
51+
52+ const name = api.about.obs.name(id)
53+ watch(name, name => container.title = '@'+name)
54+ container.id = id
55+
56+ pull(
57+ api.sbot.pull.userFeed({id: id, old: false, live: true}),
58+ Scroller(container, content, api.message.html.render, true, false)
59+ )
60+
61+ //how to handle when have scrolled past the start???
62+
63+ pull(
64+ next(api.sbot.pull.userFeed, { id: id, reverse: true, limit: 50, live: false }, ['value', 'sequence']),
65+ // pull.through(console.log.bind(console)),
66+ Scroller(container, content, api.message.html.render, false, false)
67+ )
68+
69+ return container
70+ }
71+}
72+
73+

Built with git-ssb-web