-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
82 lines (79 loc) · 2.25 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { StyleSheet, Text, View } from "react-native";
import Deck from "./src/Deck";
import { Card, Button } from "@rneui/themed";
const DATA = [
{
id: 1,
text: "Card #1",
uri: "https://images.pexels.com/photos/3979134/pexels-photo-3979134.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 2,
text: "Card #2",
uri: "https://images.pexels.com/photos/3852204/pexels-photo-3852204.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 3,
text: "Card #3",
uri: "https://images.pexels.com/photos/3973089/pexels-photo-3973089.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 4,
text: "Card #4",
uri: "https://images.pexels.com/photos/3852136/pexels-photo-3852136.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 5,
text: "Card #5",
uri: "https://images.pexels.com/photos/3852037/pexels-photo-3852037.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 6,
text: "Card #6",
uri: "https://images.pexels.com/photos/3852204/pexels-photo-3852204.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 7,
text: "Card #7",
uri: "https://images.pexels.com/photos/3973089/pexels-photo-3973089.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
{
id: 8,
text: "Card #8",
uri: "https://images.pexels.com/photos/3852136/pexels-photo-3852136.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
},
];
export default function App() {
const renderCard = (item) => {
return (
<Card key={item?.id}>
<Card.Image source={{ uri: item?.uri }} />
<Card.Title style={{ textAlign: "left" }}>{item?.text}</Card.Title>
<Text style={{ marginBottom: 10 }}>
I can customise the Card Further.
</Text>
<Button
icon={{ name: "code" }}
background={{ color: "white" }}
title={"View Now !"}
/>
</Card>
);
};
return (
<View style={styles.container}>
<Deck
data={DATA}
renderCard={renderCard}
onSwipeLeft={(item) => console.log("item", item)}
onSwipeRight={() => {}}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
},
});