Front: Home View: Song Card Grid

This commit is contained in:
Arthi-chaud
2022-10-07 11:30:56 +01:00
parent e17268c46c
commit cddf1b7ff7
3 changed files with 66 additions and 21 deletions
+26
View File
@@ -0,0 +1,26 @@
import React from 'react';
import SongCard from './SongCard';
import { FlatGrid } from 'react-native-super-grid';
import { Heading, VStack } from 'native-base';
type SongCardGrid = {
songs: Parameters<typeof SongCard>[0][];
maxItemPerRow?: number,
heading?: string
}
const SongCardGrid = (props: SongCardGrid) => {
return <VStack>
<Heading>{props.heading}</Heading>
<FlatGrid
maxItemsPerRow={props.maxItemPerRow ?? 5}
additionalRowStyle={{ justifyContent: 'space-between' }}
data={props.songs}
renderItem={({ item }) => <SongCard {...item} /> }
spacing={20}
/>
</VStack>
}
export default SongCardGrid;