forked from callstack/react-native-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCardExample.tsx
119 lines (114 loc) · 3.49 KB
/
CardExample.tsx
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import * as React from 'react';
import { Alert, ScrollView, StyleSheet } from 'react-native';
import {
Avatar,
Paragraph,
Card,
Button,
IconButton,
useTheme,
} from 'react-native-paper';
const CardExample = () => {
const {
colors: { background },
} = useTheme();
return (
<ScrollView
style={[styles.container, { backgroundColor: background }]}
contentContainerStyle={styles.content}
>
<Card style={styles.card}>
<Card.Cover source={require('../../assets/images/wrecked-ship.jpg')} />
<Card.Title title="Abandoned Ship" />
<Card.Content>
<Paragraph>
The Abandoned Ship is a wrecked ship located on Route 108 in Hoenn,
originally being a ship named the S.S. Cactus. The second part of
the ship can only be accessed by using Dive and contains the
Scanner.
</Paragraph>
</Card.Content>
</Card>
<Card style={styles.card}>
<Card.Cover source={require('../../assets/images/forest.jpg')} />
<Card.Actions>
<Button onPress={() => {}}>Share</Button>
<Button onPress={() => {}}>Explore</Button>
</Card.Actions>
</Card>
<Card style={styles.card}>
<Card.Title
title="Berries that are trimmed at the end"
subtitle="Omega Ruby"
left={(props: any) => <Avatar.Icon {...props} icon="folder" />}
right={(props: any) => (
<IconButton {...props} icon="dots-vertical" onPress={() => {}} />
)}
/>
<Card.Content>
<Paragraph>
Dotted around the Hoenn region, you will find loamy soil, many of
which are housing berries. Once you have picked the berries, then
you have the ability to use that loamy soil to grow your own
berries. These can be any berry and will require attention to get
the best crop.
</Paragraph>
</Card.Content>
</Card>
<Card style={styles.card}>
<Card.Cover source={require('../../assets/images/strawberries.jpg')} />
<Card.Title
title="Just Strawberries"
subtitle="... and only Strawberries"
right={(props: any) => (
<IconButton {...props} icon="chevron-down" onPress={() => {}} />
)}
/>
</Card>
<Card
style={styles.card}
onPress={() => {
Alert.alert('The Chameleon is Pressed');
}}
>
<Card.Cover source={require('../../assets/images/chameleon.jpg')} />
<Card.Title title="Pressable Chameleon" />
<Card.Content>
<Paragraph>
This is a pressable chameleon. If you press me, I will alert.
</Paragraph>
</Card.Content>
</Card>
<Card
style={styles.card}
onLongPress={() => {
Alert.alert('The City is Long Pressed');
}}
>
<Card.Cover source={require('../../assets/images/city.jpg')} />
<Card.Title
title="Long Pressable City"
left={(props) => <Avatar.Icon {...props} icon="city" />}
/>
<Card.Content>
<Paragraph>
This is a long press only city. If you long press me, I will alert.
</Paragraph>
</Card.Content>
</Card>
</ScrollView>
);
};
CardExample.title = 'Card';
const styles = StyleSheet.create({
container: {
flex: 1,
},
content: {
padding: 4,
},
card: {
margin: 4,
},
});
export default CardExample;