@@ -3,6 +3,8 @@ import React from 'react';
3
3
import type { Node } from 'react' ;
4
4
import { View } from 'react-native' ;
5
5
6
+ import Emoji from '../emoji/Emoji' ;
7
+ import { emojiTypeFromReactionType } from '../emoji/data' ;
6
8
import type { UserOrBot } from '../types' ;
7
9
import styles , { createStyleSheet } from '../styles' ;
8
10
import { useSelector } from '../react-redux' ;
@@ -21,6 +23,7 @@ const componentStyles = createStyleSheet({
21
23
} ,
22
24
statusWrapper : {
23
25
justifyContent : 'center' ,
26
+ alignItems : 'center' ,
24
27
flexDirection : 'row' ,
25
28
} ,
26
29
presenceStatusIndicator : {
@@ -42,6 +45,9 @@ export default function AccountDetails(props: Props): Node {
42
45
43
46
const ownUser = useSelector ( getOwnUser ) ;
44
47
const userStatusText = useSelector ( state => getUserStatus ( state , props . user . user_id ) . status_text ) ;
48
+ const userStatusEmoji = useSelector (
49
+ state => getUserStatus ( state , props . user . user_id ) . status_emoji ,
50
+ ) ;
45
51
46
52
const isSelf = user . user_id === ownUser . user_id ;
47
53
@@ -70,9 +76,22 @@ export default function AccountDetails(props: Props): Node {
70
76
/>
71
77
< ZulipText style = { [ styles . largerText , styles . halfMarginRight ] } text = { user . full_name } />
72
78
</ View >
73
- { userStatusText !== null && (
74
- < ZulipText style = { [ styles . largerText , componentStyles . statusText ] } text = { userStatusText } />
75
- ) }
79
+ < View style = { componentStyles . statusWrapper } >
80
+ { userStatusEmoji && (
81
+ < Emoji
82
+ code = { userStatusEmoji . emoji_code }
83
+ type = { emojiTypeFromReactionType ( userStatusEmoji . reaction_type ) }
84
+ size = { 24 }
85
+ />
86
+ ) }
87
+ { userStatusEmoji && userStatusText !== null && < View style = { { width : 2 } } /> }
88
+ { userStatusText !== null && (
89
+ < ZulipText
90
+ style = { [ styles . largerText , componentStyles . statusText ] }
91
+ text = { userStatusText }
92
+ />
93
+ ) }
94
+ </ View >
76
95
{ ! isSelf && (
77
96
< View >
78
97
< ActivityText style = { styles . largerText } user = { user } />
0 commit comments