git ssb

0+

Zach! / music-visions



Tree: 600dbebbcf63259dc62efc29572bad058dff0f50

Files: 600dbebbcf63259dc62efc29572bad058dff0f50 / views / song.js

572 bytesRaw
1const html = require('choo/html')
2
3module.exports = view
4
5function view (state, emit) {
6 var song = state.songs.find(song => song.title == state.params.song.replace(/-/g,' '))
7 console.log({song})
8 return html`
9 <div class='wrapper'>
10 <div id='track' class='track'>
11 <h1>${song.title}</h1>
12 <div id='text'>
13 ${song.post.map(function (post){ return html`<p>${post}</p>`})}
14 </div>
15 <a href='/#songbook' onclick=${close}>x close x</a>
16 </div>
17 </div>
18 `
19
20 function close () {
21 emit('close',song.title)
22 }
23}
24

Built with git-ssb-web