Fixes, cleanup from first PR reread

This commit is contained in:
Clément Le Bihan
2023-11-28 14:43:16 +01:00
parent 3b24cefd3f
commit 3b89387b12
5 changed files with 32 additions and 60 deletions

View File

@@ -42,8 +42,6 @@ const StarProgress = (props: StarProgressProps) => {
style={{
position: 'absolute',
left: `${(step / props.max) * 100}%`,
// top: '50%',
// transform: 'translate(-50%, -55%)',
}}
/>
);

View File

@@ -42,7 +42,7 @@ const cards = [
const GoldenRatio = () => {
const screenSize = useBreakpointValue({ base: 'small', md: 'big' });
const isPhone = screenSize === 'small';
// return (<GoldenRatioPanel direction='column' header={<>r</>}>test</GoldenRatioPanel>)
return (
<GoldenRatioPanel
direction={isPhone ? 'column' : 'row'}

View File

@@ -1,8 +1,5 @@
import { View, ViewStyle } from 'react-native';
const bigSideRatio = 1000;
const smallSideRatio = 618;
const bigSizePercent = '61.8%';
const smallSizePercent = '38.2%';

View File

@@ -310,6 +310,7 @@ const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
}
return (
<View style={{ display: 'flex', flex: 1, backgroundColor: '#cdd4fd' }}>
<SafeAreaView
style={{
flexGrow: 1,
@@ -335,36 +336,36 @@ const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
zIndex: 100,
}}
>
{/* <PopupCC
title={translate('selectPlayMode')}
description={translate('selectPlayModeExplaination')}
isVisible={type === undefined}
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 () => setType('practice')}
/>
<ButtonBase
style={{}}
type="filled"
title={translate('playBtn')}
onPress={async () => setType('normal')}
/>
</Row>
</PopupCC> */}
<PopupCC
title={translate('selectPlayMode')}
description={translate('selectPlayModeExplaination')}
isVisible={type === undefined}
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 () => setType('practice')}
/>
<ButtonBase
style={{}}
type="filled"
title={translate('playBtn')}
onPress={async () => setType('normal')}
/>
</Row>
</PopupCC>
{(
[
[

View File

@@ -14,30 +14,6 @@ const HomeView = (props: RouteProps<{}>) => {
const navigation = useNavigation();
const screenSize = useBreakpointValue({ base: 'small', md: 'big' });
const isPhone = screenSize === 'small';
const artistsQueries = useQueries(
(songsQuery.data ?? []).map((song) => API.getArtist(song.artistId))
);
// React.useEffect(() => {
// if (!songsQuery.data) return;
// if (artistsQueries.every((query) => !query.isLoading)) return;
// (songsQuery.data ?? [])
// .filter((song) =>
// artistsQueries.find((artistQuery) => artistQuery.data?.id === song.artistId)
// )
// .forEach((song, index) => {
// if (index > 3) return;
// cards[index]!.image = song.cover;
// cards[index]!.title = song.name;
// cards[index]!.artist = artistsQueries.find(
// (artistQuery) => artistQuery.data?.id === song.artistId
// )!.data!.name;
// cards[index]!.onPress = () => {
// navigation.navigate('Play', { songId: song.id });
// };
// });
// }, [artistsQueries]);
return (
<ScaffoldCC routeName={props.route.name}>