Changeset View
Changeset View
Standalone View
Standalone View
native/chat/settings/thread-settings-avatar.react.js
// @flow | // @flow | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { View } from 'react-native'; | import { View } from 'react-native'; | ||||
import { useGetAvatarForThread } from 'lib/shared/avatar-utils.js'; | |||||
import { type ResolvedThreadInfo } from 'lib/types/thread-types.js'; | import { type ResolvedThreadInfo } from 'lib/types/thread-types.js'; | ||||
import Avatar from '../../components/avatar.react.js'; | import ThreadAvatar from '../../components/thread-avatar.react.js'; | ||||
import { useStyles } from '../../themes/colors.js'; | import { useStyles } from '../../themes/colors.js'; | ||||
type Props = { | type Props = { | ||||
+threadInfo: ResolvedThreadInfo, | +threadInfo: ResolvedThreadInfo, | ||||
}; | }; | ||||
function ThreadSettingsAvatar(props: Props): React.Node { | function ThreadSettingsAvatar(props: Props): React.Node { | ||||
const styles = useStyles(unboundStyles); | const styles = useStyles(unboundStyles); | ||||
const avatarInfo = useGetAvatarForThread(props.threadInfo); | |||||
return ( | return ( | ||||
<View style={styles.container}> | <View style={styles.container}> | ||||
<Avatar size="profile" avatarInfo={avatarInfo} /> | <ThreadAvatar size="profile" threadInfo={props.threadInfo} /> | ||||
</View> | </View> | ||||
); | ); | ||||
} | } | ||||
const unboundStyles = { | const unboundStyles = { | ||||
container: { | container: { | ||||
alignItems: 'center', | alignItems: 'center', | ||||
backgroundColor: 'panelForeground', | backgroundColor: 'panelForeground', | ||||
Show All 9 Lines |