import React from 'react'; import {Image, StyleSheet} from 'react-native'; import {useSelector} from 'react-redux'; import {RootState} from '../../store/rootreducer'; import {ScreenType} from '../../types'; const PROFILE_DIM = 100; interface AvatarProps { style?: object; userXId: string | undefined; screenType: ScreenType; } const Avatar: React.FC = ({style, screenType, userXId}) => { const {avatar} = useSelector((state: RootState) => userXId ? state.userX[screenType][userXId] : state.user, ); return ( ); }; const styles = StyleSheet.create({ image: { height: PROFILE_DIM, width: PROFILE_DIM, borderRadius: PROFILE_DIM / 2, }, }); export default Avatar;