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,16 @@ 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 { useResolvedThreadInfo } from 'lib/utils/entity-helpers.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 +31,28 @@ const styles = useStyles(unboundStyles); const colors = useColors(); + const resolvedThreadInfo = useResolvedThreadInfo(threadInfo); + const avatarInfo = useGetAvatarForThread(resolvedThreadInfo); + 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 ( ); @@ -63,6 +91,9 @@ } const unboundStyles = { + avatarContainer: { + marginRight: 8, + }, currentValue: { flex: 1, }, @@ -82,6 +113,9 @@ fontStyle: 'italic', paddingLeft: 2, }, + parentContainer: { + flexDirection: 'row', + }, row: { backgroundColor: 'panelForeground', flexDirection: 'row',