Skip to content

Commit

Permalink
Using local data to show cards
Browse files Browse the repository at this point in the history
  • Loading branch information
skantus committed Apr 8, 2020
1 parent 79bdd6c commit 3dd75d3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type NavigationProps = {
interface Card {
id: number | string;
title: string;
imageUri: string;
imageUri: ImageURISource;
description: string;
items?: CardItem[];
}
Expand Down
17 changes: 7 additions & 10 deletions src/api/data/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@ const data = [
{
id: 1,
title: 'BEATSMUSIC',
imageUri:
'https://static.stereogum.com/uploads/2014/01/Beats-Music-logo-640x423.jpg',
imageUri: require('src/images/1.jpg'),
description: 'Music',
},
{
id: 2,
title: 'STARBOY',
imageUri:
'https://i.pinimg.com/originals/3a/f0/e5/3af0e55ea66ea69e35145fb108b4a636.jpg',
imageUri: require('src/images/2.jpg'),
description: 'The weeknd',
},
{
id: 3,
title: 'MOSAIC',
imageUri:
'https://filmmusicreporter.com/wp-content/uploads/2018/05/mosaic.jpg',
description: 'Music for live',
title: 'HEADER',
imageUri: require('src/images/3.jpg'),
description: 'Anthem of love',
},
{
id: 4,
title: 'FINDING NEVERLAND',
imageUri: 'https://m.media-amazon.com/images/I/81qxkUUs5dL._SS500_.jpg',
imageUri: require('src/images/4.jpg'),
description: 'The album',
},
{
id: 5,
title: 'BARABAS',
imageUri: 'https://f4.bcbits.com/img/a2939269798_10.jpg',
imageUri: require('src/images/5.jpg'),
description: 'Elevator music dance',
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Card = (props: Props) => {
<ScaleAndOpacity isHidden={isHidden} animateOnDidMount={animateOnDidMount}>
<TouchableOpacity onPress={onPressed} disabled={!props.onPress}>
<ImageBackground
source={{uri: item?.imageUri}}
source={item?.imageUri}
style={styles.container}
imageStyle={styles.image}>
<Text style={styles.title}>{item?.title}</Text>
Expand Down
Binary file added src/images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3dd75d3

Please sign in to comment.