aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/helpers/BubbleStyle.js
blob: f44f726e8873820d9f44817b043a8509a2364643 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export function bubbleStyle(me, msg) {
    const isMe = me.uid === msg.user.uid;
    const color = isMe ? '#fff' : '#222';
    const background = isMe ? '#ec4b98' : 'var(--border-color)';
    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
    };
}