git ssb

2+

mixmix / ticktack



Tree: bf250c5c301cdcd83a84b88c89dd0d55db5fb8d7

Files: bf250c5c301cdcd83a84b88c89dd0d55db5fb8d7 / about / html / avatar.js

644 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3
4exports.gives = nest('about.html.avatar')
5
6exports.needs = nest({
7 'about.obs.imageUrl': 'first',
8 'about.obs.color': 'first',
9 'history.sync.push': 'first'
10})
11
12exports.create = function (api) {
13 return nest('about.html.avatar', function (id, size = 'small') {
14 return h('img', {
15 classList: `Avatar -${size}`,
16 style: { 'background-color': api.about.obs.color(id) },
17 src: api.about.obs.imageUrl(id),
18 title: id,
19 'ev-click': e => {
20 e.stopPropagation()
21 api.history.sync.push({ page: 'userShow', feed: id })
22 }
23 })
24 })
25}
26
27

Built with git-ssb-web