Updated SongCardGrids in HomeView to use itemDimension
This commit is contained in:
@@ -5,7 +5,8 @@ import { Heading, VStack } from 'native-base';
|
||||
|
||||
type SongCardGrid = {
|
||||
songs: Parameters<typeof SongCard>[0][];
|
||||
maxItemPerRow?: number,
|
||||
maxItemsPerRow?: number,
|
||||
itemDimension?: number,
|
||||
heading?: JSX.Element,
|
||||
}
|
||||
|
||||
@@ -13,8 +14,9 @@ const SongCardGrid = (props: SongCardGrid) => {
|
||||
return <VStack>
|
||||
<Heading>{props.heading}</Heading>
|
||||
<FlatGrid
|
||||
itemDimension={250}
|
||||
additionalRowStyle={{ justifyContent: 'space-between' }}
|
||||
maxItemsPerRow={props.maxItemsPerRow}
|
||||
itemDimension={props.itemDimension ?? (props.maxItemsPerRow ? undefined : 150)}
|
||||
additionalRowStyle={{ justifyContent: 'flex-start' }}
|
||||
data={props.songs}
|
||||
renderItem={({ item }) => <SongCard {...item} /> }
|
||||
spacing={10}
|
||||
|
||||
Reference in New Issue
Block a user