git ssb

2+

mixmix / ticktack



Tree: e22f86c7bff5c868d467f4c68c8873d068278f1f

Files: e22f86c7bff5c868d467f4c68c8873d068278f1f / app / page / userFind.js

1249 bytesRaw
1const nest = require('depnest')
2const { h, Value, computed, map } = require('mutant')
3
4exports.gives = nest('app.page.userFind')
5
6exports.needs = nest({
7 'about.html.image': 'first',
8 'app.html.link': 'first',
9 'about.async.suggest': 'first',
10 'translations.sync.strings': 'first',
11})
12
13exports.create = (api) => {
14 return nest('app.page.userFind', userFind)
15
16 function userFind (location) {
17 const strings = api.translations.sync.strings()
18 const input = Value()
19
20 const suggester = api.about.async.suggest()
21 const users = computed(input, input => suggester(input))
22
23 const Link = api.app.html.link
24
25 return h('Page -userFind', {title: strings.userFind.pageTitle}, [
26 h('div.container', [
27 h('div.search', [
28 h('i.fa.fa-search'),
29 h('input', {
30 placeholder: strings.userFind.action.findAUser,
31 'ev-input': e => input.set(e.target.value)
32 }),
33 ]),
34 h('div.results', map(users, user => {
35 return Link({ feed: user.id },
36 h('div.result', [
37 api.about.html.image(user.id),
38 h('div.alias', user.title),
39 h('pre.key', user.id),
40 ])
41 )
42 }))
43 ])
44 ])
45 }
46}
47
48
49
50
51

Built with git-ssb-web