git ssb

16+

Dominic / patchbay



Commit b4a12543a07fd041ced6d5f8589af61a578fc331

add actual styling to About widget, small bugfixes

mix irving authored on 12/20/2016, 8:46:07 AM
Michael Williams committed on 12/23/2016, 7:27:16 AM
Parent: b8e6d427ed5866257d6c408c54c6b498b598353c

Files changed

modules_basic/about.jschanged
modules_basic/about.jsView
@@ -12,9 +12,14 @@
1212 }
1313
1414 var mcss = `
1515 About {
16- background-color: red
16 + display: flex
17 + flex-wrap: wrap
18 +
19 + header {
20 + margin-right: .4rem
21 + }
1722 }
1823 `
1924
2025 exports.create = function (api) {
@@ -30,23 +35,25 @@
3035 var { about: aboutId, name, image, description } = about
3136
3237 // if(!image && !name) return
3338
34- return h('.About', {}, [
39 + return h('div', {className: 'About'}, [
3540 verb({ aboutId, authorId: msg.value.author }),
36- profile({ aboutId, name, image, description })
41 + profile({ aboutId, name, image, description, api })
3742 ])
3843 }
3944 }
4045
4146
4247 function verb ({ aboutId, authorId }) {
43- return authorId === aboutId
44- ? h('span', 'self-identifies as')
45- : h('span', ['identifies ', idLink(aboutId), ' as '])
48 + var content = authorId === aboutId
49 + ? 'self-identifies as'
50 + : ['identifies ', idLink(aboutId), ' as']
51 +
52 + return h('header', content)
4653 }
4754
48-function profile ({ aboutId, name, image, description }) {
55 +function profile ({ aboutId, name, image, description, api }) {
4956 return h('div', [
5057 name
5158 ? h('a', {href:'#'+aboutId}, name)
5259 : null,
@@ -57,9 +64,11 @@
5764 ])
5865 }
5966
6067 function idLink (id) {
61- return h('a', {href:'#'+id}, id)
68 + if (!id) return null
69 +
70 + return h('a', {href:'#'+id}, id.slice(0,9) + '...')
6271 }
6372
6473 function asLink (ln) {
6574 return typeof ln === 'string' ? ln : ln.link

Built with git-ssb-web