Files: b65df85068d01bbc7fd6b0ba8686cccbae6928ee / modules / avatar-name.js
337 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.needs = { signifier: 'first' } |
4 | |
5 | exports.gives = 'avatar_name' |
6 | |
7 | exports.create = function (api) { |
8 | |
9 | return function name (id) { |
10 | var n = h('span', id.substring(0, 10)) |
11 | |
12 | api.signifier(id, function (_, names) { |
13 | if(names.length) n.textContent = names[0].name |
14 | }) |
15 | |
16 | return n |
17 | } |
18 | } |
19 | |
20 |
Built with git-ssb-web