From 68265173f13957a24c5dd4f4c7eb88b6f16347b4 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Wed, 20 Dec 2023 17:18:43 -0800 Subject: [PATCH] CustomProfileFields: Use styled UserItem for (unknown user) Since #5790 last month, UserItem has been prepared to gracefully handle users we don't know about. Use that, instead of special-casing with a plain ZulipTextIntl, which we'd been doing since 2022-06 (0a108312c) when CustomProfileFields was added. The change won't be visible unless a given user object is actually absent; that'll start happening when we do #5808. See screenshots: https://github.com/zulip/zulip-mobile/pull/5809#issuecomment-1868051890 --- src/account-info/CustomProfileFields.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/account-info/CustomProfileFields.js b/src/account-info/CustomProfileFields.js index 9fbf2a41967..1cd0df55b59 100644 --- a/src/account-info/CustomProfileFields.js +++ b/src/account-info/CustomProfileFields.js @@ -5,10 +5,8 @@ import { View } from 'react-native'; import { type UserOrBot, type UserId } from '../api/modelTypes'; import WebLink from '../common/WebLink'; import ZulipText from '../common/ZulipText'; -import ZulipTextIntl from '../common/ZulipTextIntl'; import { ensureUnreachable } from '../generics'; import { useSelector } from '../react-redux'; -import { tryGetUserForId } from '../selectors'; import { type CustomProfileFieldValue, getCustomProfileFieldsForUser, @@ -16,15 +14,12 @@ import { import UserItem from '../users/UserItem'; import { useNavigation } from '../react-navigation'; -/* eslint-disable no-shadow */ - type Props = {| +user: UserOrBot, |}; function CustomProfileFieldUser(props: {| +userId: UserId |}): React.Node { const { userId } = props; - const user = useSelector(state => tryGetUserForId(state, userId)); const navigation = useNavigation(); const onPress = React.useCallback( @@ -34,10 +29,6 @@ function CustomProfileFieldUser(props: {| +userId: UserId |}): React.Node { [navigation], ); - if (!user) { - return ; - } - return ; }