Message Views
Render individual SSB messages. Useful alone, or in msg-list/msg-thread.
import Card Oneline Notification from 'patchkit-msg-view'// or:import Card from 'patchkit-msg-view/card'import Oneline from 'patchkit-msg-view/oneline'import Notification from 'patchkit-msg-view/notification' const onSelect = {...}const onToggleStar = {...}const onFlag = msg reason ... <Card = = // = = = = = = /> <Oneline = // = = = /> <Notification = = />
Options:
msg
: Required. The ssb message objectonToggleStar
: Called when dig button is hit. Should publish the vote message.onFlag
: Called when a flag is published (reason
is a string) or unpublished (reason
is falsey). Should publish the vote message.onSelect
: Optional, called when the message is opened.forceRaw
: Render as raw data? ("Force" because usually raw is only used for unknown message types.)forceExpanded
: Automatically expand card?listView
: Render the card in listview mode?selectiveUpdate
: Use a change counter on the message to control shouldComponentUpdate? (Helps with performance.)
Styles
Use the .less file:
"node_modules/patchkit-msg-view/styles.less"
Or individual:
"node_modules/patchkit-msg-view/card.less" "node_modules/patchkit-msg-view/oneline.less" "node_modules/patchkit-msg-view/notifiction.less"