git ssb

2+

mixmix / ticktack



Commit 00db2720562a9536989a440889c17cb7fdad9c30

finish integrating patch-profile

mix irving committed on 8/24/2017, 10:12:44 AM
Parent: 0dbc55f6a25a24a93278c698eec26ac13c826026

Files changed

app/html/thread.mcsschanged
app/page/userEdit.jschanged
app/page/userShow.jschanged
app/page/userShow.mcsschanged
app/page/userEdit.mcssadded
config.jschanged
package-lock.jsonchanged
package.jsonchanged
router/sync/routes.jschanged
translations/en.jschanged
app/html/thread.mcssView
@@ -65,9 +65,9 @@
6565 div.msg { $roundBottom }
6666 }
6767
6868 div.msg {
69- line-height: 1.2rem
69+ line-height: 1.2
7070 background-color: #fff
7171 padding: 0 .7rem
7272 border-radius: 4px
7373 }
app/page/userEdit.jsView
@@ -12,21 +12,27 @@
1212 exports.create = (api) => {
1313 return nest('app.page.userEdit', userEdit)
1414
1515 function userEdit (location) {
16- // location is an object { feed, page: 'userEdit' }
16+ // location is an object { feed, page: 'userEdit' }
17+ const { feed } = location
1718
1819 const strings = api.translations.sync.strings()
1920
2021 const options = Object.assign({}, location, {
21- name: strings.userEdit.section.name,
22- image: strings.userEdit.section.image,
23- cancel: strings.userEdit.action.cancel,
24- save: strings.userEdit.action.save,
22+ feed,
23+ labels: {
24+ name: strings.userEdit.section.name,
25+ avatar: strings.userEdit.section.avatar,
26+ instructionCrop: strings.userEdit.instruction.crop,
27+ okay: strings.userEdit.action.okay,
28+ cancel: strings.userEdit.action.cancel,
29+ save: strings.userEdit.action.save,
30+ }
2531 })
2632
2733 const callback = (err, didEdit) => {
28- if (err) throw new Error ('Error editing profile', err)
34+ if (err) throw new Error ('Error editing profile', err)
2935
3036 api.history.sync.push({ page: 'userShow', feed })
3137 }
3238
app/page/userShow.jsView
@@ -54,16 +54,16 @@
5454 h('Button', { disabled: 'disabled' }, strings.loading )
5555 )
5656
5757
58- const threads = MutantArray()
58+ const threads = MutantArray()
5959 pull(
6060 // next(api.feed.pull.private, {reverse: true, limit: 100, live: false}, ['value', 'timestamp']),
6161 // api.feed.pull.private({reverse: true, limit: 100, live: false}),
6262 api.feed.pull.private({reverse: true, live: false}),
6363 pull.filter(msg => {
6464 const recps = get(msg, 'value.content.recps')
65- if (!recps) return
65+ if (!recps) return
6666
6767 return recps
6868 .map(r => typeof r === 'object' ? r.link : r)
6969 .includes(feed)
@@ -76,19 +76,23 @@
7676 const Link = api.app.html.link
7777
7878 return h('Page -userShow', {title: name}, [
7979 h('div.container', [
80+ h('header', [
81+ h('h1', name),
82+ Link({ page: 'userEdit', feed }, h('i.fa.fa-pencil'))
83+ ]),
8084 api.about.html.image(feed),
8185 feed !== myId
8286 ? h('div.friendship', [
8387 h('div.state', ourRelationship),
8488 followButton
8589 ]) : '',
8690
87- Link({ page: 'userEdit', feed }, h('Button', [ h('i.fa.fa-pencil') ])),
88-
91+
8992 // h('div', '...friends in common'),
9093 // h('div', '...groups this person is in'),
94+
9195 feed !== myId
9296 ? Link({ page: 'threadNew', feed }, h('Button -primary', strings.userShow.action.directMessage))
9397 : '',
9498 h('div.threads', map(threads, api.app.html.threadCard))
@@ -97,10 +101,4 @@
97101 }
98102 }
99103
100104
101-
102-
103-
104-
105-
106-
app/page/userShow.mcssView
@@ -1,7 +1,23 @@
11 Page -userShow {
22 div.container {
3+ header {
4+ display: flex
5+ align-items: baseline
36
7+ h1 {
8+ margin-right: 1rem
9+ }
10+ div.Link {
11+ color: #666
12+ :hover {
13+ $colorPrimaryFG
14+ }
15+ }
16+ }
17+
18+ img.Avatar {}
19+
420 div.friendship {
521 display: flex
622 align-items: center
723
@@ -9,9 +25,9 @@
925
1026 div.state { flex-basis: 12rem }
1127 div.Button {}
1228 }
13-
1429
30+ div.threads {}
1531 }
1632 }
1733
app/page/userEdit.mcssView
@@ -1,0 +1,7 @@
1+Page -userEdit {
2+ div.container {
3+ max-width: 40rem
4+
5+ }
6+}
7+
config.jsView
@@ -2,9 +2,9 @@
22 const nest = require('depnest')
33 const ssbKeys = require('ssb-keys')
44 const Path = require('path')
55
6-const appName = 'ssb' //'ticktack-ssb'
6+const appName = 'ticktack'
77 const opts = process.env.ssb_appname== 'ssb' ? {} : require('./default-config.json')
88
99 exports.gives = nest('config.sync.load')
1010 exports.create = (api) => {
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 197011 bytes
New file size: 198685 bytes
package.jsonView
@@ -32,8 +32,9 @@
3232 "morphdom": "^2.3.3",
3333 "mutant": "^3.21.2",
3434 "obv-debounce": "^1.0.2",
3535 "open-external": "^0.1.1",
36+ "patch-profile": "^1.0.1",
3637 "patch-settings": "^1.0.0",
3738 "patchcore": "^1.10.0",
3839 "pull-next": "^1.0.1",
3940 "pull-obv": "^1.3.0",
router/sync/routes.jsView
@@ -22,9 +22,9 @@
2222 exports.create = (api) => {
2323 return nest('router.sync.routes', (sofar = []) => {
2424 const pages = api.app.page
2525 // route format: [ routeValidator, routeFunction ]
26-
26+
2727 const routes = [
2828
2929 // Thread pages
3030 [ location => location.page === 'threadNew' && isFeed(location.feed), pages.threadNew ],
translations/en.jsView
@@ -38,11 +38,15 @@
3838 threadShow: 'Direct Messages',
3939 userEdit: {
4040 section: {
4141 name: 'Name',
42- image: 'Image'
42+ avatar: 'Avatar'
4343 },
44+ instruction: {
45+ crop: 'Click and drag to crop your avatar'
46+ },
4447 action: {
48+ okay: 'Okay',
4549 cancel: 'Cancel',
4650 save: 'Save'
4751 }
4852 },

Built with git-ssb-web