Ensure emoji name is set for CustomStatusEmoji
This commit is contained in:
parent
af25983483
commit
9ebc0ab404
3 changed files with 18 additions and 14 deletions
|
|
@ -25,7 +25,7 @@ const style = StyleSheet.create({
|
|||
});
|
||||
|
||||
const CustomStatus = ({customStatus, customStatusExpired, isCustomStatusEnabled, isInfo}: Props) => {
|
||||
const showCustomStatusEmoji = Boolean(isCustomStatusEnabled && customStatus && !customStatusExpired);
|
||||
const showCustomStatusEmoji = Boolean(isCustomStatusEnabled && customStatus?.emoji && !customStatusExpired);
|
||||
|
||||
if (!showCustomStatusEmoji) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -15,17 +15,21 @@ interface ComponentProps {
|
|||
|
||||
const CustomStatusEmoji = ({customStatus, emojiSize = 16, style, testID}: ComponentProps) => {
|
||||
const testIdPrefix = testID ? `${testID}.` : '';
|
||||
return (
|
||||
<View
|
||||
style={style}
|
||||
testID={`${testIdPrefix}custom_status_emoji.${customStatus.emoji}`}
|
||||
>
|
||||
<Emoji
|
||||
size={emojiSize}
|
||||
emojiName={customStatus.emoji!}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
if (customStatus.emoji) {
|
||||
return (
|
||||
<View
|
||||
style={style}
|
||||
testID={`${testIdPrefix}custom_status_emoji.${customStatus.emoji}`}
|
||||
>
|
||||
<Emoji
|
||||
size={emojiSize}
|
||||
emojiName={customStatus.emoji!}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default CustomStatusEmoji;
|
||||
|
|
|
|||
|
|
@ -149,9 +149,9 @@ const UserItem = ({
|
|||
</Text>
|
||||
}
|
||||
</View>
|
||||
{isCustomStatusEnabled && !bot && customStatus && (
|
||||
{Boolean(isCustomStatusEnabled && !bot && customStatus?.emoji) && (
|
||||
<CustomStatusEmoji
|
||||
customStatus={customStatus}
|
||||
customStatus={customStatus!}
|
||||
style={style.icon}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue