-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.js
More file actions
54 lines (52 loc) · 1.84 KB
/
Card.js
File metadata and controls
54 lines (52 loc) · 1.84 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
import React from 'react';
import { StyleSheet, Text, View, FlatList, ScrollView, Alert, Image } from 'react-native';
export default class Card extends React.Component {
// Nav options can be defined as a function of the screen's props:
static navigationOptions = ({ navigation }) => ({
title: `${navigation.state.params.card.name}`,
});
render() {
// The screen's current route is passed in to `props.navigation.state`:
const { card } = this.props.navigation.state.params;
return (
<View style={styles.container}>
<ScrollView>
<Text style={[styles.header, styles.bold]} >{card.name}</Text>
<Text style={styles.listItem} ><Text style={styles.boldAndUnderlined}>Colors:</Text> {card.colors}</Text>
<Text style={styles.listItem} ><Text style={styles.boldAndUnderlined}>CMC:</Text> { card.cmc }</Text>
<Text style={styles.listItem} ><Text style={styles.boldAndUnderlined}>Type:</Text> { card.type }</Text>
<Text style={styles.listItem} ><Text style={styles.boldAndUnderlined}>Rarity:</Text> { card.rarity }</Text>
<Text style={styles.listItem} ><Text style={styles.boldAndUnderlined}>No.:</Text> { card.number }</Text>
<Text style={styles.listItem} ><Text style={styles.boldAndUnderlined}>Text:</Text> { card.text }</Text>
<Image style={{ width: 223, height: 311, marginTop: 10 }} source={{ uri: card.imageUrl }}/>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
padding: 10,
flex: 1,
backgroundColor: '#fff',
},
header: {
fontSize: 24,
marginBottom: 25,
width: 300
},
list: {
width: 300
},
listItem: {
fontSize: 18,
marginBottom: 5
},
boldAndUnderlined: {
fontWeight: 'bold',
textDecorationLine: 'underline'
},
bold: {
fontWeight: 'bold'
}
});