[FIX] Reviwed comments on the RP

This commit is contained in:
mathysPaul
2023-11-17 00:28:22 +01:00
parent 36316b0333
commit 22722082eb
9 changed files with 166 additions and 168 deletions
+21 -27
View File
@@ -20,7 +20,7 @@ type ScaffoldDesktopCCProps = {
user: User;
logo: string;
routeName: string;
menu: readonly{
menu: readonly {
type: 'main' | 'sub';
title: TranslationKey;
icon: Icon;
@@ -36,31 +36,25 @@ const SongHistory = (props: { quantity: number }) => {
);
const navigation = useNavigation();
const musics =
songHistory
.map((h) => h.data)
.filter((data): data is Song => data !== undefined)
.filter(
(song, i, array) =>
array.map((s) => s.id).findIndex((id) => id == song.id) == i
)
?.slice(0, props.quantity)
.map((song: Song) => (
<View
key={'short-history-tab' + song.id}
style={{
paddingHorizontal: 16,
paddingVertical: 10,
flex: 1,
}}
>
<TouchableOpacity
onPress={() => navigation.navigate('Song', { songId: song.id })}
>
<Text numberOfLines={1}>{song.name}</Text>
</TouchableOpacity>
</View>
))
const musics = songHistory
.map((h) => h.data)
.filter((data): data is Song => data !== undefined)
.filter((song, i, array) => array.map((s) => s.id).findIndex((id) => id == song.id) == i)
?.slice(0, props.quantity)
.map((song: Song) => (
<View
key={'short-history-tab' + song.id}
style={{
paddingHorizontal: 16,
paddingVertical: 10,
flex: 1,
}}
>
<TouchableOpacity onPress={() => navigation.navigate('Song', { songId: song.id })}>
<Text numberOfLines={1}>{song.name}</Text>
</TouchableOpacity>
</View>
));
if (!playHistoryQuery.data || playHistoryQuery.isLoading || !songHistory) {
return <LoadingView />;
@@ -158,7 +152,7 @@ const ScaffoldDesktopCC = (props: ScaffoldDesktopCCProps) => {
</View>
</View>
{!isSmallScreen && (
<View style={{width: '100%'}}>
<View style={{ width: '100%' }}>
<Divider my="2" _light={{ bg: colors.black[500] }} _dark={{ bg: '#FFF' }} />
<Spacer height="xs" />
<Text