blob: d2886e1e2ad7c83dda8103ec9a01cff8b79bc892 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/**
* @param {import('../../api').User} me
* @param {import('../../api').Message} msg
* @returns { import('react').CSSProperties} CSS properties
*/
export function chatItemStyle(me, msg) {
const user = msg.user;
const isMe = me.uid === user.uid;
const alignment = isMe ? 'flex-end' : 'flex-start';
return {
padding: '3px 6px',
listStyle: 'none',
margin: '10px 0',
display: 'flex',
flexDirection: 'column',
alignItems: alignment
};
}
|