diff --git a/native/chat/settings/thread-settings-child-thread.react.js b/native/chat/settings/thread-settings-child-thread.react.js --- a/native/chat/settings/thread-settings-child-thread.react.js +++ b/native/chat/settings/thread-settings-child-thread.react.js @@ -3,12 +3,15 @@ import * as React from 'react'; import { View, Platform } from 'react-native'; +import { useGetAvatarForThread } from 'lib/shared/avatar-utils.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; +import Avatar from '../../components/avatar.react.js'; import Button from '../../components/button.react.js'; import ThreadIcon from '../../components/thread-icon.react.js'; import ThreadPill from '../../components/thread-pill.react.js'; import { useColors, useStyles } from '../../themes/colors.js'; +import { useShouldRenderAvatars } from '../../utils/avatar-utils.js'; import { useNavigateToThread } from '../message-list-types.js'; type Props = { @@ -27,12 +30,27 @@ const styles = useStyles(unboundStyles); const colors = useColors(); + const avatarInfo = useGetAvatarForThread(threadInfo); + const shouldRenderAvatars = useShouldRenderAvatars(); + + const avatar = React.useMemo(() => { + if (!shouldRenderAvatars) { + return null; + } + return ( + + + + ); + }, [avatarInfo, shouldRenderAvatars, styles.avatarContainer]); + const firstItem = props.firstListItem ? null : styles.topBorder; const lastItem = props.lastListItem ? styles.lastButton : null; return ( + ); +} + +type ThreadSettingsParentProps = { + +threadInfo: ThreadInfo, + +parentThreadInfo: ?ThreadInfo, +}; +function ThreadSettingsParent(props: ThreadSettingsParentProps): React.Node { + const { threadInfo, parentThreadInfo } = props; + const styles = useStyles(unboundStyles); let parent; if (parentThreadInfo) { - parent = ( - - ); + parent = ; } else if (threadInfo.parentThreadID) { parent = ( = - React.memo(ThreadSettingsParent); +const ConnectedThreadSettingsParent: React.ComponentType = + React.memo(ThreadSettingsParent); export default ConnectedThreadSettingsParent;