git ssb

2+

mixmix / ticktack



Tree: 0e154203de9454a9f8f6a7ecc08aa6f661819f6d

Files: 0e154203de9454a9f8f6a7ecc08aa6f661819f6d / 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