git ssb

2+

mixmix / ticktack



Commit c9b7a28a4959b299b99666ef8ac687c2618da2cc

add about.html.avatar, making linking to profiles easier

mix irving committed on 8/29/2017, 2:02:29 AM
Parent: 47c13dae1c311219de77ffac244274f248275f29

Files changed

about/index.jschanged
about/html/avatar.jsadded
about/html/avatar.mcssadded
app/html/link.mcsschanged
app/html/thread-card.jschanged
app/html/thread-card.mcsschanged
app/html/thread.jschanged
about/index.jsView
@@ -1,5 +1,8 @@
11 module.exports = {
22 async: {
33 suggest: require('./async/suggest')
4- }
4+ },
5+ html: {
6+ avatar: require('./html/avatar')
7+ },
58 }
about/html/avatar.jsView
@@ -1,0 +1,22 @@
1+const nest = require('depnest')
2+const { h } = require('mutant')
3+
4+exports.needs = nest({
5+ 'about.html.image': 'first',
6+ 'app.html.link': 'first'
7+})
8+
9+exports.gives = nest('about.html.avatar')
10+
11+exports.create = function (api) {
12+ return nest('about.html.avatar', feed => {
13+ const Link = api.app.html.link
14+
15+ return Link(
16+ { page: 'userShow', feed },
17+ api.about.html.image(feed)
18+ )
19+
20+ })
21+}
22+
about/html/avatar.mcssView
@@ -1,0 +1,5 @@
1+Avatar {
2+ $avatarSmall
3+ margin-right: .5rem
4+}
5+
app/html/link.mcssView
@@ -1,6 +1,7 @@
11 Link {
22 color: #222
3+ cursor: pointer
34
45 -string {
56 :hover {
67 text-decoration: underline
app/html/thread-card.jsView
@@ -8,9 +8,9 @@
88 exports.needs = nest({
99 'keys.sync.id': 'first',
1010 'history.sync.push': 'first',
1111 'about.obs.name': 'first',
12- 'about.html.image': 'first',
12+ 'about.html.avatar': 'first',
1313 'message.html.markdown': 'first',
1414 'translations.sync.strings': 'first',
1515 'unread.sync.isUnread': 'first'
1616 })
@@ -47,9 +47,9 @@
4747
4848 return msg.value.content.recps
4949 .map(link => isString(link) ? link : link.link)
5050 .filter(link => link !== myId)
51- .map(api.about.html.image)
51+ .map(api.about.html.avatar)
5252 }
5353 else if(msg.value.content.channel)
5454 return '#'+msg.value.content.channel
5555 }
@@ -92,11 +92,11 @@
9292 // id is only here to help morphdom morph accurately
9393
9494 var className = thread.unread ? '-unread': ''
9595
96- return h('ThreadCard', { id, className, 'ev-click': onClick, }, [
96+ return h('ThreadCard', { id, className }, [
9797 h('div.context', threadIcon(thread)),
98- h('div.content', [
98+ h('div.content', {'ev-click': onClick}, [
9999 subjectEl,
100100 replySample ? h('div.reply', [
101101 h('i.fa.fa-caret-left'),
102102 replySample
app/html/thread-card.mcssView
@@ -7,21 +7,25 @@
77 div.context {
88 display: flex
99 margin-right: 1rem
1010 font-weight: inherit
11- img {
12- $avatarSmall
13- margin-right: .5rem
14- }
1511 }
1612
1713 div.content {
1814 flex-grow: 1
1915
16+ cursor: pointer
2017 padding: 1rem
2118 border: 1px solid #ddd
2219 border-radius: 2px
2320
21+ transition: all .5s ease
22+
23+ :hover {
24+ background-color: #fff
25+ border: 1px solid #fff
26+ }
27+
2428 div.subject {
2529 font-size: 1.2rem
2630 margin-bottom: .3rem
2731
app/html/thread.jsView
@@ -4,9 +4,9 @@
44
55 exports.gives = nest('app.html.thread')
66
77 exports.needs = nest({
8- 'about.html.image': 'first',
8+ 'about.html.avatar': 'first',
99 'feed.obs.thread': 'first',
1010 'keys.sync.id': 'first',
1111 'message.html.markdown': 'first',
1212 'unread.sync.markRead': 'first',
@@ -35,9 +35,9 @@
3535 ])
3636 }))
3737 ])
3838 : h('div.other-chunk', [
39- h('div.avatar', when(author, api.about.html.image(author()))),
39+ h('div.avatar', when(author, api.about.html.avatar(author()))),
4040 h('div.msgs', map(chunk, msg => {
4141 return h('div.msg-row', [
4242 message(msg),
4343 h('div.spacer')

Built with git-ssb-web