|
@@ -98,14 +98,22 @@ export const Profile: FC<Props> = ({
|
|
|
</View>
|
|
|
);
|
|
|
|
|
|
- return tbt_rank && tbt_rank >= 1 ? (
|
|
|
+ return (
|
|
|
<View style={adaptiveStyle(TBTStyles.badgeRoot, {})}>
|
|
|
<View style={adaptiveStyle(TBTStyles.badgeWrapper, {})}>
|
|
|
- {badge_tbt ? <Rank color={colors[tbt_rank - 1]} /> : null}
|
|
|
- <Text style={adaptiveStyle([ScoreStyles.scoreNameText], {})}>TBT # {tbt_rank}</Text>
|
|
|
+ {badge_tbt && tbt_rank ? (
|
|
|
+ <Rank color={colors[tbt_rank - 1]} />
|
|
|
+ ) : (
|
|
|
+ <View style={adaptiveStyle(ProfileStyles.badge, {})} />
|
|
|
+ )}
|
|
|
+ {tbt_rank && tbt_rank >= 1 ? (
|
|
|
+ <Text style={adaptiveStyle([ScoreStyles.scoreNameText], {})}>TBT # {tbt_rank}</Text>
|
|
|
+ ) : (
|
|
|
+ <View style={{ height: 11 }} />
|
|
|
+ )}
|
|
|
</View>
|
|
|
</View>
|
|
|
- ) : null;
|
|
|
+ );
|
|
|
};
|
|
|
|
|
|
const EmptyScore: FC<{ scoreName: string }> = ({ scoreName }) => {
|
|
@@ -118,18 +126,21 @@ export const Profile: FC<Props> = ({
|
|
|
};
|
|
|
|
|
|
return (
|
|
|
- <View
|
|
|
- style={{ backgroundColor: Colors.FILL_LIGHT, borderRadius: 8, padding: 6, marginBottom: 12 }}
|
|
|
- >
|
|
|
- <TouchableOpacity onPress={() => handlePress()}>
|
|
|
- <View style={adaptiveStyle(ProfileStyles.profileRoot, {})}>
|
|
|
- <View style={{ paddingLeft: 20 }}>
|
|
|
- {index + 1 < 100 ? (
|
|
|
- <View>
|
|
|
- <Text style={adaptiveStyle(ScoreStyles.rankText, {})}>{index + 1}</Text>
|
|
|
- </View>
|
|
|
- ) : null}
|
|
|
- <View style={{ marginLeft: 5 }}>
|
|
|
+ <View style={ProfileStyles.wrapper}>
|
|
|
+ <View
|
|
|
+ style={[
|
|
|
+ ProfileStyles.index,
|
|
|
+ {
|
|
|
+ width: index + 1 < 100 ? 26 : 38
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Text style={adaptiveStyle(ScoreStyles.rankText, {})}>{index + 1}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={{ flex: 1, paddingLeft: 8, paddingRight: 3, paddingBottom: 3 }}>
|
|
|
+ <TouchableOpacity onPress={() => handlePress()}>
|
|
|
+ <View style={adaptiveStyle(ProfileStyles.profileRoot, {})}>
|
|
|
+ <View style={ProfileStyles.avatarContainer}>
|
|
|
{avatar ? (
|
|
|
<Image
|
|
|
style={adaptiveStyle(ProfileStyles.profileAvatar, {})}
|
|
@@ -143,68 +154,70 @@ export const Profile: FC<Props> = ({
|
|
|
/>
|
|
|
)}
|
|
|
</View>
|
|
|
- </View>
|
|
|
- <View style={adaptiveStyle(ProfileStyles.profileDataRoot, {})}>
|
|
|
- <Text
|
|
|
- style={adaptiveStyle(
|
|
|
- [ProfileStyles.profileFirstLastName, { fontSize: getFontSize(14), flex: 0 }],
|
|
|
- {}
|
|
|
- )}
|
|
|
- >
|
|
|
- {first_name ?? ''} {last_name ?? ''}
|
|
|
- </Text>
|
|
|
- <View style={adaptiveStyle(ProfileStyles.profileDataContainer, {})}>
|
|
|
- <View style={adaptiveStyle(ProfileStyles.profileDataWrapper, {})}>
|
|
|
- <Text style={adaptiveStyle(ProfileStyles.profileAge, {})}>
|
|
|
- Age: {date_of_birth ?? ''}
|
|
|
- </Text>
|
|
|
- <Image
|
|
|
- source={{ uri: flagBaseUri + homebase_flag }}
|
|
|
- style={adaptiveStyle(ProfileStyles.countryFlag, {})}
|
|
|
- />
|
|
|
- {homebase2_flag && homebase2_flag !== homebase_flag ? (
|
|
|
+ <View style={adaptiveStyle(ProfileStyles.profileDataRoot, {})}>
|
|
|
+ <Text
|
|
|
+ style={adaptiveStyle(
|
|
|
+ [ProfileStyles.profileFirstLastName, { fontSize: getFontSize(14), flex: 0 }],
|
|
|
+ {}
|
|
|
+ )}
|
|
|
+ >
|
|
|
+ {first_name ?? ''} {last_name ?? ''}
|
|
|
+ </Text>
|
|
|
+ <View style={adaptiveStyle(ProfileStyles.profileDataContainer, {})}>
|
|
|
+ <View style={adaptiveStyle(ProfileStyles.profileDataWrapper, {})}>
|
|
|
+ <Text style={adaptiveStyle(ProfileStyles.profileAge, {})}>
|
|
|
+ Age: {date_of_birth ?? ''}
|
|
|
+ </Text>
|
|
|
<Image
|
|
|
- source={{ uri: flagBaseUri + homebase2_flag }}
|
|
|
- style={adaptiveStyle([ProfileStyles.countryFlag, { marginLeft: -15 }], {})}
|
|
|
+ source={{ uri: flagBaseUri + homebase_flag }}
|
|
|
+ style={adaptiveStyle(ProfileStyles.countryFlag, {})}
|
|
|
/>
|
|
|
- ) : null}
|
|
|
- <View style={adaptiveStyle(ProfileStyles.badgesWrapper, {})}>
|
|
|
- {auth ? <TickIcon /> : null}
|
|
|
- {badge_un ? <UNIcon /> : null}
|
|
|
- {badge_1281 ? <NMIcon /> : null}
|
|
|
+ {homebase2_flag && homebase2_flag !== homebase_flag ? (
|
|
|
+ <Image
|
|
|
+ source={{ uri: flagBaseUri + homebase2_flag }}
|
|
|
+ style={adaptiveStyle([ProfileStyles.countryFlag, { marginLeft: -15 }], {})}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
+ <View style={adaptiveStyle(ProfileStyles.badgesWrapper, {})}>
|
|
|
+ {auth ? <TickIcon /> : null}
|
|
|
+ {badge_un ? <UNIcon /> : null}
|
|
|
+ {badge_1281 ? <NMIcon /> : null}
|
|
|
+ </View>
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- </View>
|
|
|
- </TouchableOpacity>
|
|
|
- <View style={adaptiveStyle(ScoreStyles.rankingWrapper, {})}>
|
|
|
- <View style={adaptiveStyle(ScoreStyles.nmWrapper, {})}>
|
|
|
- <Text style={adaptiveStyle(ScoreStyles.activeScoreRanking, {})}>
|
|
|
- {score[active_score]}
|
|
|
- </Text>
|
|
|
- <Text style={adaptiveStyle(ScoreStyles.activeScoreName, {})}>
|
|
|
- {scoreNames[active_score]}
|
|
|
- </Text>
|
|
|
- <TBRanking />
|
|
|
- </View>
|
|
|
+ </TouchableOpacity>
|
|
|
+ <View style={adaptiveStyle(ScoreStyles.rankingWrapper, {})}>
|
|
|
+ <View style={adaptiveStyle(ScoreStyles.nmWrapper, {})}>
|
|
|
+ <View style={ScoreStyles.score}>
|
|
|
+ <Text style={adaptiveStyle(ScoreStyles.activeScoreRanking, {})}>
|
|
|
+ {score[active_score]}
|
|
|
+ </Text>
|
|
|
+ <Text style={adaptiveStyle(ScoreStyles.activeScoreName, {})}>
|
|
|
+ {scoreNames[active_score]}
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ <TBRanking />
|
|
|
+ </View>
|
|
|
|
|
|
- <View style={adaptiveStyle(ScoreStyles.rankingScoresWrapper, {})}>
|
|
|
- {score.map((number, index) => {
|
|
|
- if (scoreNames[index] === 'SLOW' && number >= 4500)
|
|
|
- return <EmptyScore key={index} scoreName={scoreNames[index]} />;
|
|
|
- if (scoreNames[index] === 'YES' && number >= 10000)
|
|
|
- return <EmptyScore key={index} scoreName={scoreNames[index]} />;
|
|
|
- if (!number) return <EmptyScore key={index} scoreName={scoreNames[index]} />;
|
|
|
- return (
|
|
|
- <View key={index} style={adaptiveStyle(ScoreStyles.scoreWrapper, {})}>
|
|
|
- <Text style={adaptiveStyle([ScoreStyles.scoreHeaderText], {})}>{number}</Text>
|
|
|
- <Text style={adaptiveStyle([ScoreStyles.scoreNameText], {})}>
|
|
|
- {scoreNames[index]}
|
|
|
- </Text>
|
|
|
- </View>
|
|
|
- );
|
|
|
- })}
|
|
|
+ <View style={adaptiveStyle(ScoreStyles.rankingScoresWrapper, {})}>
|
|
|
+ {score.map((number, index) => {
|
|
|
+ if (scoreNames[index] === 'SLOW' && number >= 4500)
|
|
|
+ return <EmptyScore key={index} scoreName={scoreNames[index]} />;
|
|
|
+ if (scoreNames[index] === 'YES' && number >= 10000)
|
|
|
+ return <EmptyScore key={index} scoreName={scoreNames[index]} />;
|
|
|
+ if (!number) return <EmptyScore key={index} scoreName={scoreNames[index]} />;
|
|
|
+ return (
|
|
|
+ <View key={index} style={adaptiveStyle(ScoreStyles.scoreWrapper, {})}>
|
|
|
+ <Text style={adaptiveStyle([ScoreStyles.scoreHeaderText], {})}>{number}</Text>
|
|
|
+ <Text style={adaptiveStyle([ScoreStyles.scoreNameText], {})}>
|
|
|
+ {scoreNames[index]}
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </View>
|
|
|
</View>
|
|
|
</View>
|
|
|
{modalType && (
|