blob: ea0bdb65d6d3289947f332f4f96604477095e714 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 | import React from 'react';
import {StyleSheet} from 'react-native';
import {useSelector} from 'react-redux';
import {RootState} from '../../store/rootreducer';
import {ScreenType} from '../../types';
import {Avatar} from '../common';
const PROFILE_DIM = 100;
interface TaggAvatarProps {
  style?: object;
  userXId: string | undefined;
  screenType: ScreenType;
}
const TaggAvatar: React.FC<TaggAvatarProps> = ({
  style,
  screenType,
  userXId,
}) => {
  const {avatar} = useSelector((state: RootState) =>
    userXId ? state.userX[screenType][userXId] : state.user,
  );
  return <Avatar style={[styles.image, style]} uri={avatar} />;
};
const styles = StyleSheet.create({
  image: {
    height: PROFILE_DIM,
    width: PROFILE_DIM,
    borderRadius: PROFILE_DIM / 2,
  },
});
export default TaggAvatar;
 |