Files: 7458998a2a59e0edaf11b6ce83867a72f96577d6 / app / page / userShow.js
1009 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | exports.gives = nest('app.page.userShow') |
5 | |
6 | exports.needs = nest({ |
7 | 'translations.sync.strings': 'first', |
8 | 'app.html.link': 'first', |
9 | 'app.html.nav': 'first', |
10 | 'about.html.image': 'first', |
11 | 'about.obs.name': 'first', |
12 | 'keys.sync.id': 'first', |
13 | }) |
14 | |
15 | exports.create = (api) => { |
16 | var strings = api.translations.sync.strings() |
17 | |
18 | return nest('app.page.userShow', userShow) |
19 | |
20 | function userShow (location) { |
21 | |
22 | const { feed } = location |
23 | const Link = api.app.html.link |
24 | const myId = api.keys.sync.id() |
25 | var name = api.about.html.name(feed) |
26 | |
27 | return h('Page -userShow', {title: api.about.obs.name(feed)}, [ |
28 | api.about.html.image(feed), |
29 | h('div', strings.followButton), |
30 | h('div', strings.friendsInCommon), |
31 | feed !== myId |
32 | ? Link({ page: 'threadNew', feed }, strings.newThread) |
33 | : '', |
34 | h('div', strings.userConvesationsWith, name), |
35 | h('div', name, strings.userIsInGroups), |
36 | ]) |
37 | } |
38 | } |
39 | |
40 | |
41 | |
42 |
Built with git-ssb-web