-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCard.js
45 lines (43 loc) · 977 Bytes
/
Card.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
import * as React from "react";
import { View, Text, StyleSheet, Pressable } from "react-native";
export default function Card({ onPress, isTurnedOver, children }) {
return (
<Pressable
style={isTurnedOver ? styles.cardUp : styles.cardDown}
onPress={onPress}
>
{isTurnedOver ? (
<Text style={styles.text}>{children}</Text>
) : (
<Text style={styles.text}>?</Text>
)}
</Pressable>
);
}
const styles = StyleSheet.create({
cardUp: {
width: 100,
height: 100,
margin: 10,
borderColor: "#334155",
borderRadius: 25,
alignItems: "center",
justifyContent: "center",
backgroundColor: "#1e293b",
},
cardDown: {
width: 100,
height: 100,
margin: 10,
borderWidth: 10,
borderColor: "#334155",
borderRadius: "25%",
backgroundColor: "#1e293b",
alignItems: "center",
justifyContent: "center",
},
text: {
fontSize: 46,
color: "#334155",
},
});