removed dupliacte popupCC in dom and now using two function less
This commit is contained in:
@@ -362,12 +362,12 @@ const PlayView = ({ songId }: PlayViewProps) => {
|
|||||||
[
|
[
|
||||||
'lastScore',
|
'lastScore',
|
||||||
songHistory.data?.history.at(0)?.score ?? 0,
|
songHistory.data?.history.at(0)?.score ?? 0,
|
||||||
() => <Clock color={statColor} />,
|
<Clock key={'lS'} color={statColor} />,
|
||||||
] as const,
|
] as const,
|
||||||
[
|
[
|
||||||
'bestScore',
|
'bestScore',
|
||||||
songHistory.data?.best ?? 0,
|
songHistory.data?.best ?? 0,
|
||||||
() => <Cup color={statColor} />,
|
<Cup key={'bS'} color={statColor} />,
|
||||||
],
|
],
|
||||||
] as const
|
] as const
|
||||||
).map(([label, value, icon]) => (
|
).map(([label, value, icon]) => (
|
||||||
@@ -388,7 +388,7 @@ const PlayView = ({ songId }: PlayViewProps) => {
|
|||||||
gap: 5,
|
gap: 5,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{icon()}
|
{icon}
|
||||||
<Text color={statColor} fontSize={12} bold>
|
<Text color={statColor} fontSize={12} bold>
|
||||||
{value}
|
{value}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -483,36 +483,6 @@ const PlayView = ({ songId }: PlayViewProps) => {
|
|||||||
setShouldPlay(true);
|
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>
|
</SafeAreaView>
|
||||||
{colorScheme === 'dark' && (
|
{colorScheme === 'dark' && (
|
||||||
<LinearGradient
|
<LinearGradient
|
||||||
|
|||||||
Reference in New Issue
Block a user