Files: 98233c821a36cfebd65825ed3c2c4e9474f43e6e / app / html / channelCard.js
617 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | exports.gives = nest('app.html.channelCard') |
5 | |
6 | exports.needs = nest({ |
7 | 'history.sync.push': 'first', |
8 | 'channel.html.subscribe': 'first' |
9 | }) |
10 | |
11 | exports.create = function (api) { |
12 | return nest('app.html.channelCard', (channel) => { |
13 | const goToChannel = () => { |
14 | api.history.sync.push({ page: 'channelShow', channel: channel }) |
15 | } |
16 | |
17 | return h('ChannelCard', [ |
18 | h('div.content', [ |
19 | h('div.text', [ |
20 | h('h2', {'ev-click': goToChannel}, channel), |
21 | api.channel.html.subscribe(channel) |
22 | ]) |
23 | ]) |
24 | ]) |
25 | }) |
26 | } |
27 |
Built with git-ssb-web