Commit 00db2720562a9536989a440889c17cb7fdad9c30
finish integrating patch-profile
mix irving committed on 8/24/2017, 10:12:44 AMParent: 0dbc55f6a25a24a93278c698eec26ac13c826026
Files changed
app/html/thread.mcss | changed |
app/page/userEdit.js | changed |
app/page/userShow.js | changed |
app/page/userShow.mcss | changed |
app/page/userEdit.mcss | added |
config.js | changed |
package-lock.json | changed |
package.json | changed |
router/sync/routes.js | changed |
translations/en.js | changed |
app/html/thread.mcss | ||
---|---|---|
@@ -65,9 +65,9 @@ | ||
65 | 65 | div.msg { $roundBottom } |
66 | 66 | } |
67 | 67 | |
68 | 68 | div.msg { |
69 | - line-height: 1.2rem | |
69 | + line-height: 1.2 | |
70 | 70 | background-color: #fff |
71 | 71 | padding: 0 .7rem |
72 | 72 | border-radius: 4px |
73 | 73 | } |
app/page/userEdit.js | ||
---|---|---|
@@ -12,21 +12,27 @@ | ||
12 | 12 | exports.create = (api) => { |
13 | 13 | return nest('app.page.userEdit', userEdit) |
14 | 14 | |
15 | 15 | function userEdit (location) { |
16 | - // location is an object { feed, page: 'userEdit' } | |
16 | + // location is an object { feed, page: 'userEdit' } | |
17 | + const { feed } = location | |
17 | 18 | |
18 | 19 | const strings = api.translations.sync.strings() |
19 | 20 | |
20 | 21 | 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 | + } | |
25 | 31 | }) |
26 | 32 | |
27 | 33 | const callback = (err, didEdit) => { |
28 | - if (err) throw new Error ('Error editing profile', err) | |
34 | + if (err) throw new Error ('Error editing profile', err) | |
29 | 35 | |
30 | 36 | api.history.sync.push({ page: 'userShow', feed }) |
31 | 37 | } |
32 | 38 |
app/page/userShow.js | ||
---|---|---|
@@ -54,16 +54,16 @@ | ||
54 | 54 | h('Button', { disabled: 'disabled' }, strings.loading ) |
55 | 55 | ) |
56 | 56 | |
57 | 57 | |
58 | - const threads = MutantArray() | |
58 | + const threads = MutantArray() | |
59 | 59 | pull( |
60 | 60 | // next(api.feed.pull.private, {reverse: true, limit: 100, live: false}, ['value', 'timestamp']), |
61 | 61 | // api.feed.pull.private({reverse: true, limit: 100, live: false}), |
62 | 62 | api.feed.pull.private({reverse: true, live: false}), |
63 | 63 | pull.filter(msg => { |
64 | 64 | const recps = get(msg, 'value.content.recps') |
65 | - if (!recps) return | |
65 | + if (!recps) return | |
66 | 66 | |
67 | 67 | return recps |
68 | 68 | .map(r => typeof r === 'object' ? r.link : r) |
69 | 69 | .includes(feed) |
@@ -76,19 +76,23 @@ | ||
76 | 76 | const Link = api.app.html.link |
77 | 77 | |
78 | 78 | return h('Page -userShow', {title: name}, [ |
79 | 79 | h('div.container', [ |
80 | + h('header', [ | |
81 | + h('h1', name), | |
82 | + Link({ page: 'userEdit', feed }, h('i.fa.fa-pencil')) | |
83 | + ]), | |
80 | 84 | api.about.html.image(feed), |
81 | 85 | feed !== myId |
82 | 86 | ? h('div.friendship', [ |
83 | 87 | h('div.state', ourRelationship), |
84 | 88 | followButton |
85 | 89 | ]) : '', |
86 | 90 | |
87 | - Link({ page: 'userEdit', feed }, h('Button', [ h('i.fa.fa-pencil') ])), | |
88 | - | |
91 | + | |
89 | 92 | // h('div', '...friends in common'), |
90 | 93 | // h('div', '...groups this person is in'), |
94 | + | |
91 | 95 | feed !== myId |
92 | 96 | ? Link({ page: 'threadNew', feed }, h('Button -primary', strings.userShow.action.directMessage)) |
93 | 97 | : '', |
94 | 98 | h('div.threads', map(threads, api.app.html.threadCard)) |
@@ -97,10 +101,4 @@ | ||
97 | 101 | } |
98 | 102 | } |
99 | 103 | |
100 | 104 | |
101 | - | |
102 | - | |
103 | - | |
104 | - | |
105 | - | |
106 | - |
app/page/userShow.mcss | ||
---|---|---|
@@ -1,7 +1,23 @@ | ||
1 | 1 | Page -userShow { |
2 | 2 | div.container { |
3 | + header { | |
4 | + display: flex | |
5 | + align-items: baseline | |
3 | 6 | |
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 | + | |
4 | 20 | div.friendship { |
5 | 21 | display: flex |
6 | 22 | align-items: center |
7 | 23 | |
@@ -9,9 +25,9 @@ | ||
9 | 25 | |
10 | 26 | div.state { flex-basis: 12rem } |
11 | 27 | div.Button {} |
12 | 28 | } |
13 | - | |
14 | 29 | |
30 | + div.threads {} | |
15 | 31 | } |
16 | 32 | } |
17 | 33 |
app/page/userEdit.mcss | ||
---|---|---|
@@ -1,0 +1,7 @@ | ||
1 | +Page -userEdit { | |
2 | + div.container { | |
3 | + max-width: 40rem | |
4 | + | |
5 | + } | |
6 | +} | |
7 | + |
config.js | ||
---|---|---|
@@ -2,9 +2,9 @@ | ||
2 | 2 | const nest = require('depnest') |
3 | 3 | const ssbKeys = require('ssb-keys') |
4 | 4 | const Path = require('path') |
5 | 5 | |
6 | -const appName = 'ssb' //'ticktack-ssb' | |
6 | +const appName = 'ticktack' | |
7 | 7 | const opts = process.env.ssb_appname== 'ssb' ? {} : require('./default-config.json') |
8 | 8 | |
9 | 9 | exports.gives = nest('config.sync.load') |
10 | 10 | exports.create = (api) => { |
package-lock.json | ||
---|---|---|
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.json | ||
---|---|---|
@@ -32,8 +32,9 @@ | ||
32 | 32 | "morphdom": "^2.3.3", |
33 | 33 | "mutant": "^3.21.2", |
34 | 34 | "obv-debounce": "^1.0.2", |
35 | 35 | "open-external": "^0.1.1", |
36 | + "patch-profile": "^1.0.1", | |
36 | 37 | "patch-settings": "^1.0.0", |
37 | 38 | "patchcore": "^1.10.0", |
38 | 39 | "pull-next": "^1.0.1", |
39 | 40 | "pull-obv": "^1.3.0", |
router/sync/routes.js | ||
---|---|---|
@@ -22,9 +22,9 @@ | ||
22 | 22 | exports.create = (api) => { |
23 | 23 | return nest('router.sync.routes', (sofar = []) => { |
24 | 24 | const pages = api.app.page |
25 | 25 | // route format: [ routeValidator, routeFunction ] |
26 | - | |
26 | + | |
27 | 27 | const routes = [ |
28 | 28 | |
29 | 29 | // Thread pages |
30 | 30 | [ location => location.page === 'threadNew' && isFeed(location.feed), pages.threadNew ], |
translations/en.js | ||
---|---|---|
@@ -38,11 +38,15 @@ | ||
38 | 38 | threadShow: 'Direct Messages', |
39 | 39 | userEdit: { |
40 | 40 | section: { |
41 | 41 | name: 'Name', |
42 | - image: 'Image' | |
42 | + avatar: 'Avatar' | |
43 | 43 | }, |
44 | + instruction: { | |
45 | + crop: 'Click and drag to crop your avatar' | |
46 | + }, | |
44 | 47 | action: { |
48 | + okay: 'Okay', | |
45 | 49 | cancel: 'Cancel', |
46 | 50 | save: 'Save' |
47 | 51 | } |
48 | 52 | }, |
Built with git-ssb-web