removed dupliacte popupCC in dom and now using two function less

This commit is contained in:
Clément Le Bihan
2024-01-07 00:26:07 +01:00
parent 22c93b7571
commit 96d8e649c8

View File

@@ -362,12 +362,12 @@ const PlayView = ({ songId }: PlayViewProps) => {
[
'lastScore',
songHistory.data?.history.at(0)?.score ?? 0,
() => <Clock color={statColor} />,
<Clock key={'lS'} color={statColor} />,
] as const,
[
'bestScore',
songHistory.data?.best ?? 0,
() => <Cup color={statColor} />,
<Cup key={'bS'} color={statColor} />,
],
] as const
).map(([label, value, icon]) => (
@@ -388,7 +388,7 @@ const PlayView = ({ songId }: PlayViewProps) => {
gap: 5,
}}
>
{icon()}
{icon}
<Text color={statColor} fontSize={12} bold>
{value}
</Text>
@@ -483,36 +483,6 @@ const PlayView = ({ songId }: PlayViewProps) => {
setShouldPlay(true);
}}
/>
<PopupCC
title={translate('selectPlayMode')}
description={translate('selectPlayModeExplaination')}
isVisible={!playType}
setIsVisible={
navigation.canGoBack()
? (isVisible) => {
if (!isVisible) {
// If we dismiss the popup, Go to previous page
navigation.goBack();
}
}
: undefined
}
>
<Row style={{ justifyContent: 'space-between' }}>
<ButtonBase
style={{}}
type="outlined"
title={translate('practiceBtn')}
onPress={async () => setPlayType('practice')}
/>
<ButtonBase
style={{}}
type="filled"
title={translate('playBtn')}
onPress={async () => setPlayType('normal')}
/>
</Row>
</PopupCC>
</SafeAreaView>
{colorScheme === 'dark' && (
<LinearGradient