From 96a746fa9b5fe2a469735666fb7149a107ca9643 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 11 Jun 2019 16:30:55 +0300 Subject: Visitor bubbles in Thread --- vnext/src/ui/helpers/BubbleStyle.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 vnext/src/ui/helpers/BubbleStyle.js (limited to 'vnext/src/ui/helpers') diff --git a/vnext/src/ui/helpers/BubbleStyle.js b/vnext/src/ui/helpers/BubbleStyle.js new file mode 100644 index 00000000..570b7337 --- /dev/null +++ b/vnext/src/ui/helpers/BubbleStyle.js @@ -0,0 +1,24 @@ +export function bubbleStyle(me, msg) { + const isMe = me.uid === msg.user.uid; + const color = isMe ? '#fff' : '#222'; + const background = isMe ? '#ec4b98' : '#eee'; + return { + background: background, + color: color, + padding: '12px', + display: 'inline-block' + }; +} + +export function chatItemStyle(me, msg) { + const isMe = me.uid === msg.user.uid; + const alignment = isMe ? 'flex-end' : 'flex-start'; + return { + padding: '3px 6px', + listStyle: 'none', + margin: '10px 0', + display: 'flex', + flexDirection: 'column', + alignItems: alignment + }; +} -- cgit v1.2.3