-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathQuote.js
49 lines (45 loc) · 936 Bytes
/
Quote.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
import React, { Component, PropTypes } from 'react'
import {
View,
Text,
StyleSheet,
Platform,
} from 'react-native'
class Quote extends Component {
render() {
return (
<View style={styles.quoteContainer}>
<Text style={styles.quoteText}>"{this.props.quoteText}"</Text>
<Text style={styles.sourceText}>- {this.props.quoteSource}</Text>
</View>
)
}
}
Quote.propTypes = {
quoteText: PropTypes.string.isRequired,
quoteSource: PropTypes.string.isRequired,
}
const styles = StyleSheet.create({
quoteContainer: {
flex: 1,
justifyContent: 'center',
},
quoteText: {
fontFamily: (Platform.OS === 'ios') ?
'AvenirNext-Bold' :
'Roboto',
fontSize: 36,
color: '#ffffff',
marginVertical: 30,
},
sourceText: {
fontFamily: (Platform.OS === 'ios') ?
'AvenirNext-Italic' :
'Roboto',
fontSize: 20,
color: '#F8F8F8',
textAlign: 'right',
fontStyle: 'italic',
},
})
export default Quote