Files: 5477cb7eccf839bf6a1c666a5a2808a6ead826f1 / about / html / avatar.js
538 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | exports.gives = nest('about.html.avatar') |
5 | |
6 | exports.needs = nest({ |
7 | 'about.obs': { |
8 | color: 'first', |
9 | imageUrl: 'first' |
10 | }, |
11 | 'about.html.link': 'first' |
12 | }) |
13 | |
14 | exports.create = function (api) { |
15 | return nest('about.html.avatar', avatar) |
16 | |
17 | function avatar (id) { |
18 | return api.about.html.link(id, |
19 | h('img', { |
20 | className: 'Avatar', |
21 | style: { 'background-color': api.about.obs.color(id) }, |
22 | src: api.about.obs.imageUrl(id) |
23 | }) |
24 | ) |
25 | } |
26 | } |
27 | |
28 |
Built with git-ssb-web