-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.js
More file actions
68 lines (63 loc) · 1.33 KB
/
Card.js
File metadata and controls
68 lines (63 loc) · 1.33 KB
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
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Dimensions,
TouchableHighlight
} from 'react-native';
import CardTop from './CardTop'
class Card extends Component {
constructor(props) {
super(props)
}
toggleBigMode = () => this.props.onPress(this.props.index)
renderCardContents = (contents) => {
const {
cardTop,
card,
} = contents
return (
<View style={{
flex: 1,
backgroundColor: 'white',
width: Dimensions.get('window').width - 20,
marginHorizontal: 10,
borderRadius: 10,
overflow: 'scroll',
alignItems: 'center',
justifyContent: 'center'
}}>
<CardTop
cardTop={cardTop}
bigMode={this.props.bigMode}
/>
{this.props.bigMode && <View>
<Text style={styles.cardText}>
{card.text}
</Text>
</View>}
</View>
)
}
render() {
return (
<TouchableHighlight
activeOpacity={.5}
underlayColor="#0F1419"
onPress={this.toggleBigMode}
>
{this.renderCardContents(this.props.data)}
</TouchableHighlight>
)
}
}
const styles = StyleSheet.create({
cardText: {
fontSize: 20,
color: 'black',
backgroundColor: 'transparent',
margin: 20,
}
});
export default Card