Commit 183eecd34c4a182372cc1d025b6bf9accdfbda38
add placeholder for "new" private message
mix irving committed on 9/11/2017, 5:53:57 AMParent: cb6a0ba9926b48c9841ada130882bd5365d4d9b4
Files changed
message/html/layout/inbox.js | changed |
post/page/inbox.js | changed |
styles/mcss.js | changed |
message/html/layout/inbox.js | ||
---|---|---|
@@ -32,9 +32,9 @@ | ||
32 | 32 | |
33 | 33 | const myId = api.keys.sync.id() |
34 | 34 | const recps = msgRollup.value.content.recps |
35 | 35 | .map(recp => { |
36 | - // TODO check these things are feed links!!! | |
36 | + // TODO check these things are feed links!!! | |
37 | 37 | if (typeof recp === 'string') return recp |
38 | 38 | |
39 | 39 | if (recp.link) return recp.link |
40 | 40 | }) |
@@ -43,15 +43,15 @@ | ||
43 | 43 | .reduce((sofar, el) => sofar.includes(el) ? sofar : [...sofar, el], []) //.uniq |
44 | 44 | |
45 | 45 | const showNewMsg = newMsg && newMsg.value.author !== myId |
46 | 46 | |
47 | - // const dataset = newMsg | |
48 | - // ? { root: rootMsg.key, id: newMsg.key } | |
49 | - // : { id: root.key } | |
47 | + const openMessage = ev => { | |
48 | + ev.preventDefault() | |
49 | + ev.stopPropagation() | |
50 | + api.app.sync.goTo({ key: rootMsg.key }) | |
51 | + } | |
50 | 52 | |
51 | - const openMessage = () => api.app.sync.goTo({ key: rootMsg.key }) | |
52 | - | |
53 | - const card = h('Message -inbox-card', { // This is required for patchbay keyboard shortcut 'o' | |
53 | + const card = h('Message -inbox-card', { // class Message is required for patchbay keyboard shortcut 'o' | |
54 | 54 | attributes: { |
55 | 55 | tabindex: '0' |
56 | 56 | } |
57 | 57 | }, [ |
@@ -67,9 +67,9 @@ | ||
67 | 67 | showNewMsg |
68 | 68 | ? h('div.update', [ |
69 | 69 | h('span.replySymbol', '►'), |
70 | 70 | messageContent(newMsg), |
71 | - timestamp(newMsg || rootMsg), | |
71 | + timestamp(newMsg || rootMsg), | |
72 | 72 | ]) : '' |
73 | 73 | ]), |
74 | 74 | ]) |
75 | 75 | |
@@ -93,9 +93,9 @@ | ||
93 | 93 | case 1: |
94 | 94 | return '-half' |
95 | 95 | case 3: |
96 | 96 | return '-half' |
97 | - case 4: | |
97 | + case 4: | |
98 | 98 | return '-half' |
99 | 99 | case 5: |
100 | 100 | return '-quarter' |
101 | 101 | case 6: |
post/page/inbox.js | ||
---|---|---|
@@ -5,9 +5,9 @@ | ||
5 | 5 | const next = require('pull-next-step') |
6 | 6 | const ref = require('ssb-ref') |
7 | 7 | |
8 | 8 | exports.gives = nest({ |
9 | - 'post.page.inbox': true, | |
9 | + 'post.page.inbox': true, | |
10 | 10 | 'app.html.menuItem': true |
11 | 11 | }) |
12 | 12 | |
13 | 13 | exports.needs = nest({ |
@@ -26,23 +26,24 @@ | ||
26 | 26 | }) |
27 | 27 | |
28 | 28 | exports.create = function (api) { |
29 | 29 | return nest({ |
30 | - 'post.page.inbox': page, | |
30 | + 'post.page.inbox': page, | |
31 | 31 | 'app.html.menuItem': menuItem |
32 | 32 | }) |
33 | 33 | |
34 | 34 | function menuItem () { |
35 | 35 | return h('a', { |
36 | 36 | style: { order: 2 }, |
37 | - 'ev-click': () => api.app.sync.goTo({ page: 'inbox' }) | |
37 | + 'ev-click': () => api.app.sync.goTo({ page: 'inbox' }) // TODO goTo is patchbay | |
38 | 38 | }, '/inbox') |
39 | 39 | } |
40 | 40 | |
41 | 41 | function page (location) { |
42 | 42 | const id = api.keys.sync.id() |
43 | 43 | |
44 | 44 | // TODO - create a postNew page |
45 | + // | |
45 | 46 | // const composer = api.message.html.compose({ |
46 | 47 | // meta: { type: 'post' }, |
47 | 48 | // prepublish: meta => { |
48 | 49 | // meta.recps = [id, ...(meta.mentions || [])] |
@@ -50,17 +51,23 @@ | ||
50 | 51 | // return meta |
51 | 52 | // }, |
52 | 53 | // placeholder: 'Write a private message. \n\n@mention users in the first message to start a private thread.'} |
53 | 54 | // ) |
54 | - | |
55 | + | |
55 | 56 | const newMsgCount = Value(0) |
56 | - const { filterMenu, filterDownThrough, filterUpThrough, resetFeed } = api.app.html.filter(draw) | |
57 | - const { container, content } = api.app.html.scroller({ prepend: [ | |
57 | + const { filterMenu, filterDownThrough, filterUpThrough, resetFeed } = api.app.html.filter(draw) // TODO dep on patchbay | |
58 | + | |
59 | + // TODO - develop a better way to do styled pages with scroller | |
60 | + const { container, content } = api.app.html.scroller({ prepend: [ // TODO dep on patchbay | |
58 | 61 | h('div', { style: {'margin-left': '9rem', display: 'flex', 'align-items': 'baseline'} }, [ |
59 | - h('button', { 'ev-click': draw, stlye: {'margin-left': 0} }, 'REFRESH'), | |
60 | - h('span', ['New Messages: ', newMsgCount]), | |
62 | + h('button.new', { | |
63 | + style: { 'margin-right': 'auto' }, | |
64 | + 'ev-click': () => api.app.sync.goTo({ page: 'private' }) // TODO replace with custom page | |
65 | + }, 'New'), | |
66 | + h('span', [newMsgCount, ' new messages']), | |
67 | + h('button.refresh', { 'ev-click': draw, stlye: {'margin-left': 0} }, 'REFRESH'), | |
61 | 68 | ]), |
62 | - filterMenu | |
69 | + filterMenu | |
63 | 70 | ] }) |
64 | 71 | |
65 | 72 | function draw () { |
66 | 73 | newMsgCount.set(0) |
@@ -91,5 +98,4 @@ | ||
91 | 98 | return container |
92 | 99 | } |
93 | 100 | } |
94 | 101 | |
95 | - |
styles/mcss.js | ||
---|---|---|
@@ -52,8 +52,13 @@ | ||
52 | 52 | } |
53 | 53 | |
54 | 54 | section.content { |
55 | 55 | max-width: 40rem |
56 | + | |
57 | + text-overflow: ellipsis | |
58 | + white-space: nowrap | |
59 | + overflow: hidden | |
60 | + | |
56 | 61 | margin: 0 |
57 | 62 | |
58 | 63 | header { |
59 | 64 | display: flex |
@@ -73,9 +78,9 @@ | ||
73 | 78 | display: flex |
74 | 79 | flex-wrap: wrap |
75 | 80 | margin-left: 2rem |
76 | 81 | |
77 | - span.replySymcol { | |
82 | + span.replySymbol { | |
78 | 83 | color: #666 |
79 | 84 | margin-right: .3rem |
80 | 85 | } |
81 | 86 |
Built with git-ssb-web