git ssb

0+

wanderer🌟 / %yCkm4no/U8C2k0Z658j…



forked from mixmix / patch-inbox

Commit 183eecd34c4a182372cc1d025b6bf9accdfbda38

add placeholder for "new" private message

mix irving committed on 9/11/2017, 5:53:57 AM
Parent: cb6a0ba9926b48c9841ada130882bd5365d4d9b4

Files changed

message/html/layout/inbox.jschanged
post/page/inbox.jschanged
styles/mcss.jschanged
message/html/layout/inbox.jsView
@@ -32,9 +32,9 @@
3232
3333 const myId = api.keys.sync.id()
3434 const recps = msgRollup.value.content.recps
3535 .map(recp => {
36- // TODO check these things are feed links!!!
36+ // TODO check these things are feed links!!!
3737 if (typeof recp === 'string') return recp
3838
3939 if (recp.link) return recp.link
4040 })
@@ -43,15 +43,15 @@
4343 .reduce((sofar, el) => sofar.includes(el) ? sofar : [...sofar, el], []) //.uniq
4444
4545 const showNewMsg = newMsg && newMsg.value.author !== myId
4646
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+ }
5052
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'
5454 attributes: {
5555 tabindex: '0'
5656 }
5757 }, [
@@ -67,9 +67,9 @@
6767 showNewMsg
6868 ? h('div.update', [
6969 h('span.replySymbol', '►'),
7070 messageContent(newMsg),
71- timestamp(newMsg || rootMsg),
71+ timestamp(newMsg || rootMsg),
7272 ]) : ''
7373 ]),
7474 ])
7575
@@ -93,9 +93,9 @@
9393 case 1:
9494 return '-half'
9595 case 3:
9696 return '-half'
97- case 4:
97+ case 4:
9898 return '-half'
9999 case 5:
100100 return '-quarter'
101101 case 6:
post/page/inbox.jsView
@@ -5,9 +5,9 @@
55 const next = require('pull-next-step')
66 const ref = require('ssb-ref')
77
88 exports.gives = nest({
9- 'post.page.inbox': true,
9+ 'post.page.inbox': true,
1010 'app.html.menuItem': true
1111 })
1212
1313 exports.needs = nest({
@@ -26,23 +26,24 @@
2626 })
2727
2828 exports.create = function (api) {
2929 return nest({
30- 'post.page.inbox': page,
30+ 'post.page.inbox': page,
3131 'app.html.menuItem': menuItem
3232 })
3333
3434 function menuItem () {
3535 return h('a', {
3636 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
3838 }, '/inbox')
3939 }
4040
4141 function page (location) {
4242 const id = api.keys.sync.id()
4343
4444 // TODO - create a postNew page
45+ //
4546 // const composer = api.message.html.compose({
4647 // meta: { type: 'post' },
4748 // prepublish: meta => {
4849 // meta.recps = [id, ...(meta.mentions || [])]
@@ -50,17 +51,23 @@
5051 // return meta
5152 // },
5253 // placeholder: 'Write a private message. \n\n@mention users in the first message to start a private thread.'}
5354 // )
54-
55+
5556 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
5861 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'),
6168 ]),
62- filterMenu
69+ filterMenu
6370 ] })
6471
6572 function draw () {
6673 newMsgCount.set(0)
@@ -91,5 +98,4 @@
9198 return container
9299 }
93100 }
94101
95-
styles/mcss.jsView
@@ -52,8 +52,13 @@
5252 }
5353
5454 section.content {
5555 max-width: 40rem
56+
57+ text-overflow: ellipsis
58+ white-space: nowrap
59+ overflow: hidden
60+
5661 margin: 0
5762
5863 header {
5964 display: flex
@@ -73,9 +78,9 @@
7378 display: flex
7479 flex-wrap: wrap
7580 margin-left: 2rem
7681
77- span.replySymcol {
82+ span.replySymbol {
7883 color: #666
7984 margin-right: .3rem
8085 }
8186

Built with git-ssb-web