|
@@ -0,0 +1,130 @@
|
|
|
+import React, { FC } from 'react';
|
|
|
+import { Text, View } from 'react-native';
|
|
|
+import { Image } from 'expo-image';
|
|
|
+
|
|
|
+import { API_HOST } from '../../../../constants';
|
|
|
+import { styles } from './styles';
|
|
|
+import { getFontSize } from '../../../../utils';
|
|
|
+import { Colors } from '../../../../theme';
|
|
|
+
|
|
|
+import TickIcon from '../../../../../assets/icons/tick.svg';
|
|
|
+import UNIcon from '../../../../../assets/icons/un_icon.svg';
|
|
|
+import NMIcon from '../../../../../assets/icons/nm_icon.svg';
|
|
|
+
|
|
|
+type Props = {
|
|
|
+ avatar: string;
|
|
|
+ first_name: string;
|
|
|
+ last_name: string;
|
|
|
+ date_of_birth: number;
|
|
|
+ homebase_flag: string;
|
|
|
+ homebase2_flag: string;
|
|
|
+ index: number;
|
|
|
+ score: any[];
|
|
|
+ tbt_score: number;
|
|
|
+};
|
|
|
+
|
|
|
+//TODO: Profile
|
|
|
+export const Profile: FC<Props> = ({
|
|
|
+ avatar,
|
|
|
+ first_name,
|
|
|
+ last_name,
|
|
|
+ date_of_birth,
|
|
|
+ homebase_flag,
|
|
|
+ homebase2_flag,
|
|
|
+ index,
|
|
|
+ score,
|
|
|
+ tbt_score
|
|
|
+}) => {
|
|
|
+ const scoreNames = ['NM1301', 'DARE', 'UN', 'UN+', 'TCC', 'YES', 'SLOW', 'WHS', 'KYE'];
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <View style={{ alignItems: 'center', flexDirection: 'row', gap: 10, marginBottom: 5 }}>
|
|
|
+ <View>
|
|
|
+ <Text style={styles.rankText}>{index + 1}</Text>
|
|
|
+ </View>
|
|
|
+ <View>
|
|
|
+ <Image
|
|
|
+ style={{ borderRadius: 24, width: 48, height: 48 }}
|
|
|
+ source={{ uri: API_HOST + '/img/avatars/' + avatar }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View style={{ gap: 5, width: '75%' }}>
|
|
|
+ <Text style={[styles.headerText, { fontSize: getFontSize(14), flex: 0 }]}>
|
|
|
+ {first_name} {last_name}
|
|
|
+ </Text>
|
|
|
+ <View style={{ display: 'flex', justifyContent: 'space-between', flexDirection: 'row' }}>
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ display: 'flex',
|
|
|
+ flexDirection: 'row',
|
|
|
+ gap: 10,
|
|
|
+ alignItems: 'center'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ style={{ color: Colors.DARK_BLUE, fontWeight: '600', fontSize: getFontSize(12) }}
|
|
|
+ >
|
|
|
+ Age: {date_of_birth}
|
|
|
+ </Text>
|
|
|
+ <Image
|
|
|
+ source={{ uri: API_HOST + '/img/flags_new/' + homebase_flag }}
|
|
|
+ style={styles.countryFlag}
|
|
|
+ />
|
|
|
+ {homebase2_flag ? (
|
|
|
+ <Image
|
|
|
+ source={{ uri: API_HOST + '/img/flags_new/' + homebase2_flag }}
|
|
|
+ style={[styles.countryFlag, { marginLeft: -15 }]}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
+ <View style={{ display: 'flex', flexDirection: 'row', gap: 10 }}>
|
|
|
+ <TickIcon />
|
|
|
+ <UNIcon />
|
|
|
+ <NMIcon />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ display: 'flex',
|
|
|
+ flexDirection: 'row',
|
|
|
+ justifyContent: 'space-evenly',
|
|
|
+ marginBottom: 15
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {/*TBT Score*/}
|
|
|
+ {/*<View*/}
|
|
|
+ {/* style={{*/}
|
|
|
+ {/* display: 'flex',*/}
|
|
|
+ {/* marginTop: 10*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/*>*/}
|
|
|
+ {/* <View style={{ display: 'flex', alignItems: 'center' }}>*/}
|
|
|
+ {/* <Text style={[styles.headerText, { flex: 0 }]}>Icon</Text>*/}
|
|
|
+ {/* <Text style={[styles.titleText, { flex: 0 }]}>TBT #{tbt_score}</Text>*/}
|
|
|
+ {/* </View>*/}
|
|
|
+ {/*</View>*/}
|
|
|
+
|
|
|
+ {score.map((number, index) => {
|
|
|
+ if (!number) return;
|
|
|
+ return (
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ display: 'flex',
|
|
|
+ marginTop: 10
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <View style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
+ <Text style={[styles.headerText, { flex: 0 }]}>{number}</Text>
|
|
|
+ <Text style={[styles.titleText, { flex: 0 }]}>{scoreNames[index]}</Text>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </View>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+};
|