Commit 1071420830e9c0d65973ba8c83523dba1402a931
Merge branch 'master' of github.com:ticktackim/ticktack-wp1 into m
Dominic Tarr committed on 8/14/2017, 11:46:24 PMParent: de0ef825a9ce79b779be739bf4566c0077448919
Parent: f3409d0dc8b00fb3846783f9e510314430c1ecd1
Files changed
app/html/link.mcss | added |
app/index.js | changed |
app/page/userShow.js | changed |
app/page/threadNew.js | added |
router/sync/routes.js | changed |
app/html/link.mcss | ||
---|---|---|
@@ -1,0 +1,6 @@ | ||
1 | +Link { | |
2 | + color: blue | |
3 | + :hover { | |
4 | + text-decoration: underline | |
5 | + } | |
6 | +} |
app/index.js | ||
---|---|---|
@@ -21,7 +21,11 @@ | ||
21 | 21 | settings: require('./page/settings'), |
22 | 22 | threadShow: require('./page/threadShow'), |
23 | 23 | userFind: require('./page/userFind'), |
24 | 24 | userShow: require('./page/userShow'), |
25 | + threadNew: require('./page/threadNew'), | |
26 | + threadShow: require('./page/threadShow'), | |
25 | 27 | } |
26 | 28 | } |
27 | 29 | |
30 | + | |
31 | + |
app/page/userShow.js | ||
---|---|---|
@@ -3,19 +3,34 @@ | ||
3 | 3 | |
4 | 4 | exports.gives = nest('app.page.userShow') |
5 | 5 | |
6 | 6 | exports.needs = nest({ |
7 | - 'app.html.nav': 'first' | |
7 | + 'app.html.link': 'first', | |
8 | + 'app.html.nav': 'first', | |
9 | + 'about.html.image': 'first', | |
10 | + 'about.obs.name': 'first', | |
11 | + 'keys.sync.id': 'first', | |
8 | 12 | }) |
9 | 13 | |
10 | 14 | exports.create = (api) => { |
11 | 15 | return nest('app.page.userShow', userShow) |
12 | 16 | |
13 | 17 | function userShow (location) { |
14 | 18 | |
19 | + const { feed } = location | |
20 | + const Link = api.app.html.link | |
21 | + const myId = api.keys.sync.id() | |
22 | + | |
15 | 23 | return h('Page -userShow', [ |
16 | - h('h1', 'User show'), | |
24 | + h('h1', api.about.obs.name(feed)), | |
17 | 25 | api.app.html.nav(), |
18 | - h('p', `key: ${location.key}`) | |
26 | + api.about.html.image(feed), | |
27 | + h('div', 'follow button'), | |
28 | + h('div', 'friends in common'), | |
29 | + feed !== myId | |
30 | + ? Link({ page: 'threadNew', feed }, 'New Thread') | |
31 | + : '', | |
32 | + h('div', 'conversations you\'ve had with dominic'), | |
33 | + h('div', 'groups dominic is in'), | |
19 | 34 | ]) |
20 | 35 | } |
21 | 36 | } |
app/page/threadNew.js | ||
---|---|---|
@@ -1,0 +1,26 @@ | ||
1 | +const nest = require('depnest') | |
2 | +const { h } = require('mutant') | |
3 | + | |
4 | +exports.gives = nest('app.page.threadNew') | |
5 | + | |
6 | +exports.needs = nest({ | |
7 | + 'about.html.image': 'first', | |
8 | + 'about.obs.name': 'first', | |
9 | + 'app.html.nav': 'first', | |
10 | + 'app.html.thread': 'first', | |
11 | +}) | |
12 | + | |
13 | +exports.create = (api) => { | |
14 | + return nest('app.page.threadNew', threadNew) | |
15 | + | |
16 | + function threadNew (location) { | |
17 | + const { feed } = location | |
18 | + | |
19 | + return h('Page -threadNew', [ | |
20 | + h('h1', ['New thread with ', api.about.obs.name(feed)]), | |
21 | + api.about.html.image(feed), | |
22 | + api.app.html.nav(), | |
23 | + h('div', 'compose box') // a special one which takes us to threadShow | |
24 | + ]) | |
25 | + } | |
26 | +} |
router/sync/routes.js | ||
---|---|---|
@@ -12,9 +12,10 @@ | ||
12 | 12 | 'app.page.groupNew': 'first', |
13 | 13 | 'app.page.groupShow': 'first', |
14 | 14 | 'app.page.userFind': 'first', |
15 | 15 | 'app.page.userShow': 'first', |
16 | - 'app.page.threadShow': 'first' | |
16 | + 'app.page.threadNew': 'first', | |
17 | + 'app.page.threadShow': 'first', | |
17 | 18 | }) |
18 | 19 | |
19 | 20 | exports.create = (api) => { |
20 | 21 | return nest('router.sync.routes', (sofar = []) => { |
@@ -31,16 +32,17 @@ | ||
31 | 32 | [ location => location.page === 'groupIndex', pages.groupIndex ], |
32 | 33 | [ location => location.page === 'groupNew', pages.groupNew ], |
33 | 34 | [ location => location.type === 'groupShow' && isMsg(location.key), pages.groupShow ], |
34 | 35 | |
36 | + // Thread pages | |
37 | + // QUESTION - should this be for private threads + group threads? | |
38 | + [ location => location.page === 'threadNew' && isFeed(location.feed), pages.threadNew ], | |
39 | + [ location => isMsg(location.key), pages.threadShow ], | |
40 | + | |
35 | 41 | // User pages |
36 | 42 | [ location => location.page === 'userFind', pages.userFind ], |
37 | 43 | [ location => isFeed(location.feed), pages.userShow ], |
38 | 44 | |
39 | - // Thread pages | |
40 | - // QUESTION - should this be for private threads + group threads? | |
41 | - [ location => isMsg(location.key), pages.threadShow ], | |
42 | - | |
43 | 45 | // Error page |
44 | 46 | [ location => true, pages.error ] |
45 | 47 | ] |
46 | 48 |
Built with git-ssb-web