git ssb

2+

mixmix / ticktack



Commit 1071420830e9c0d65973ba8c83523dba1402a931

Merge branch 'master' of github.com:ticktackim/ticktack-wp1 into m

Dominic Tarr committed on 8/14/2017, 11:46:24 PM
Parent: de0ef825a9ce79b779be739bf4566c0077448919
Parent: f3409d0dc8b00fb3846783f9e510314430c1ecd1

Files changed

app/html/link.mcssadded
app/index.jschanged
app/page/userShow.jschanged
app/page/threadNew.jsadded
router/sync/routes.jschanged
app/html/link.mcssView
@@ -1,0 +1,6 @@
1+Link {
2+ color: blue
3+ :hover {
4+ text-decoration: underline
5+ }
6+}
app/index.jsView
@@ -21,7 +21,11 @@
2121 settings: require('./page/settings'),
2222 threadShow: require('./page/threadShow'),
2323 userFind: require('./page/userFind'),
2424 userShow: require('./page/userShow'),
25+ threadNew: require('./page/threadNew'),
26+ threadShow: require('./page/threadShow'),
2527 }
2628 }
2729
30+
31+
app/page/userShow.jsView
@@ -3,19 +3,34 @@
33
44 exports.gives = nest('app.page.userShow')
55
66 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',
812 })
913
1014 exports.create = (api) => {
1115 return nest('app.page.userShow', userShow)
1216
1317 function userShow (location) {
1418
19+ const { feed } = location
20+ const Link = api.app.html.link
21+ const myId = api.keys.sync.id()
22+
1523 return h('Page -userShow', [
16- h('h1', 'User show'),
24+ h('h1', api.about.obs.name(feed)),
1725 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'),
1934 ])
2035 }
2136 }
app/page/threadNew.jsView
@@ -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.jsView
@@ -12,9 +12,10 @@
1212 'app.page.groupNew': 'first',
1313 'app.page.groupShow': 'first',
1414 'app.page.userFind': 'first',
1515 'app.page.userShow': 'first',
16- 'app.page.threadShow': 'first'
16+ 'app.page.threadNew': 'first',
17+ 'app.page.threadShow': 'first',
1718 })
1819
1920 exports.create = (api) => {
2021 return nest('router.sync.routes', (sofar = []) => {
@@ -31,16 +32,17 @@
3132 [ location => location.page === 'groupIndex', pages.groupIndex ],
3233 [ location => location.page === 'groupNew', pages.groupNew ],
3334 [ location => location.type === 'groupShow' && isMsg(location.key), pages.groupShow ],
3435
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+
3541 // User pages
3642 [ location => location.page === 'userFind', pages.userFind ],
3743 [ location => isFeed(location.feed), pages.userShow ],
3844
39- // Thread pages
40- // QUESTION - should this be for private threads + group threads?
41- [ location => isMsg(location.key), pages.threadShow ],
42-
4345 // Error page
4446 [ location => true, pages.error ]
4547 ]
4648

Built with git-ssb-web