git ssb

2+

mixmix / ticktack



Commit aafdb2602c252860c5f5e92fd9c319fc6ce960ad

groupNew flow

mix irving committed on 8/18/2017, 6:58:40 AM
Parent: e13726c12dd37e510f6ffbc69ef6e0bae607bc89

Files changed

app/page/groupFind.jschanged
app/page/groupFind.mcsschanged
app/page/threadNew.jschanged
app/page/threadNew.mcsschanged
translations/sync.jschanged
app/page/groupFind.jsView
@@ -13,9 +13,9 @@
1313 return nest('app.page.groupFind', groupFind)
1414
1515 function groupFind (location) {
1616 const strings = api.translations.sync.strings()
17- const input = Value()
17+ const input = Value('')
1818
1919 // CHANNEL != GROUP
2020 // note we're using channels in initial approximation of groups
2121 const suggester = api.channel.async.suggest()
@@ -41,9 +41,19 @@
4141 h('pre.key', group.subtitle || ' '), // subscribed or not
4242 ])
4343 )
4444 })),
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+ })
4656 ])
4757 ])
4858 }
4959 }
app/page/groupFind.mcssView
@@ -58,7 +58,13 @@
5858 }
5959 }
6060 }
6161 }
62+ div.groupNotFound {
63+ div.info {
64+ text-align: center
65+ margin-bottom: 1rem
66+ }
67+ }
6268 }
6369 }
6470
app/page/threadNew.jsView
@@ -68,9 +68,9 @@
6868
6969 function threadNewChannel (location) {
7070 const strings = api.translations.sync.strings()
7171
72- const { channel } = location
72+ const { channel, flash } = location
7373
7474 const meta = Struct({
7575 type: 'post',
7676 channel,
@@ -82,8 +82,9 @@
8282 )
8383
8484 return h('Page -threadNew', {title: strings.threadNew.pageTitle}, [
8585 h('div.container', [
86+ flash ? h('div.flash', flash) : '',
8687 h('div.field -channel', [
8788 h('div.label', strings.threadNew.field.channel),
8889 h('div.recps', [
8990 h('div.recp', [
app/page/threadNew.mcssView
@@ -1,7 +1,13 @@
11 Page -threadNew {
22
33 div.container {
4+ div.flash {
5+ margin-bottom: 2rem;
6+ background: #fff;
7+ padding: 1rem;
8+ }
9+
410 div.field {
511 margin-bottom: .5rem
612
713 display: flex
@@ -23,8 +29,9 @@
2329 display: flex
2430
2531 div.recp {
2632 padding: .3rem
33+ min-width: 5rem
2734 $borderSubtle
2835 border-radius: 6rem
2936 background-color: #fff
3037
@@ -36,14 +43,12 @@
3643 img {
3744 width: 2rem
3845 height: 2rem
3946 border-radius: 2rem
40-
41- margin-right: 1rem
4247 }
4348
4449 div.name {
45- margin-right: .5rem
50+ margin: 0 .5rem
4651 }
4752 }
4853 }
4954
translations/sync.jsView
@@ -22,9 +22,16 @@
2222 errorNotFound: "The page wasn't found",
2323 groupNew: "New Group",
2424 groupFind: {
2525 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.'
2734 }
2835 },
2936 groupIndex: "Group Index",
3037 //stub: should not be shown on released software!

Built with git-ssb-web