Commit aafdb2602c252860c5f5e92fd9c319fc6ce960ad
groupNew flow
mix irving committed on 8/18/2017, 6:58:40 AMParent: e13726c12dd37e510f6ffbc69ef6e0bae607bc89
Files changed
app/page/groupFind.js | changed |
app/page/groupFind.mcss | changed |
app/page/threadNew.js | changed |
app/page/threadNew.mcss | changed |
translations/sync.js | changed |
app/page/groupFind.js | ||
---|---|---|
@@ -13,9 +13,9 @@ | ||
13 | 13 | return nest('app.page.groupFind', groupFind) |
14 | 14 | |
15 | 15 | function groupFind (location) { |
16 | 16 | const strings = api.translations.sync.strings() |
17 | - const input = Value() | |
17 | + const input = Value('') | |
18 | 18 | |
19 | 19 | // CHANNEL != GROUP |
20 | 20 | // note we're using channels in initial approximation of groups |
21 | 21 | const suggester = api.channel.async.suggest() |
@@ -41,9 +41,19 @@ | ||
41 | 41 | h('pre.key', group.subtitle || ' '), // subscribed or not |
42 | 42 | ]) |
43 | 43 | ) |
44 | 44 | })), |
45 | - // computed([input, suggester.sync], (input, sync) => input && !sync ? 'Loading...' : '') | |
45 | + computed([input, groups], (input, groups) => { | |
46 | + if (input.length && groups.length === 0) { | |
47 | + return h('div.groupNotFound', [ | |
48 | + h('div.info', strings.groupFind.state.groupNotFound), | |
49 | + Link( | |
50 | + { page: 'threadNew', channel: input, flash: strings.groupFind.flash.createFirstThread }, | |
51 | + h('Button -primary', strings.groupFind.action.newGroup) | |
52 | + ) | |
53 | + ]) | |
54 | + } | |
55 | + }) | |
46 | 56 | ]) |
47 | 57 | ]) |
48 | 58 | } |
49 | 59 | } |
app/page/groupFind.mcss | ||
---|---|---|
@@ -58,7 +58,13 @@ | ||
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
61 | 61 | } |
62 | + div.groupNotFound { | |
63 | + div.info { | |
64 | + text-align: center | |
65 | + margin-bottom: 1rem | |
66 | + } | |
67 | + } | |
62 | 68 | } |
63 | 69 | } |
64 | 70 |
app/page/threadNew.js | ||
---|---|---|
@@ -68,9 +68,9 @@ | ||
68 | 68 | |
69 | 69 | function threadNewChannel (location) { |
70 | 70 | const strings = api.translations.sync.strings() |
71 | 71 | |
72 | - const { channel } = location | |
72 | + const { channel, flash } = location | |
73 | 73 | |
74 | 74 | const meta = Struct({ |
75 | 75 | type: 'post', |
76 | 76 | channel, |
@@ -82,8 +82,9 @@ | ||
82 | 82 | ) |
83 | 83 | |
84 | 84 | return h('Page -threadNew', {title: strings.threadNew.pageTitle}, [ |
85 | 85 | h('div.container', [ |
86 | + flash ? h('div.flash', flash) : '', | |
86 | 87 | h('div.field -channel', [ |
87 | 88 | h('div.label', strings.threadNew.field.channel), |
88 | 89 | h('div.recps', [ |
89 | 90 | h('div.recp', [ |
app/page/threadNew.mcss | ||
---|---|---|
@@ -1,7 +1,13 @@ | ||
1 | 1 | Page -threadNew { |
2 | 2 | |
3 | 3 | div.container { |
4 | + div.flash { | |
5 | + margin-bottom: 2rem; | |
6 | + background: #fff; | |
7 | + padding: 1rem; | |
8 | + } | |
9 | + | |
4 | 10 | div.field { |
5 | 11 | margin-bottom: .5rem |
6 | 12 | |
7 | 13 | display: flex |
@@ -23,8 +29,9 @@ | ||
23 | 29 | display: flex |
24 | 30 | |
25 | 31 | div.recp { |
26 | 32 | padding: .3rem |
33 | + min-width: 5rem | |
27 | 34 | $borderSubtle |
28 | 35 | border-radius: 6rem |
29 | 36 | background-color: #fff |
30 | 37 | |
@@ -36,14 +43,12 @@ | ||
36 | 43 | img { |
37 | 44 | width: 2rem |
38 | 45 | height: 2rem |
39 | 46 | border-radius: 2rem |
40 | - | |
41 | - margin-right: 1rem | |
42 | 47 | } |
43 | 48 | |
44 | 49 | div.name { |
45 | - margin-right: .5rem | |
50 | + margin: 0 .5rem | |
46 | 51 | } |
47 | 52 | } |
48 | 53 | } |
49 | 54 |
translations/sync.js | ||
---|---|---|
@@ -22,9 +22,16 @@ | ||
22 | 22 | errorNotFound: "The page wasn't found", |
23 | 23 | groupNew: "New Group", |
24 | 24 | groupFind: { |
25 | 25 | action: { |
26 | - findAGroup: 'Find Group' | |
26 | + findAGroup: 'Find Group', | |
27 | + newGroup: 'Create this group' | |
28 | + }, | |
29 | + state: { | |
30 | + groupNotFound: 'This group does not exist yet.' | |
31 | + }, | |
32 | + flash: { | |
33 | + createFirstThread: 'Start this group by posting the first thread.' | |
27 | 34 | } |
28 | 35 | }, |
29 | 36 | groupIndex: "Group Index", |
30 | 37 | //stub: should not be shown on released software! |
Built with git-ssb-web