17 lines
594 B
JavaScript
17 lines
594 B
JavaScript
import React, { Component, Fragment } from 'react';
|
|
import { Text } from 'react-native'
|
|
|
|
export default class Quote extends Component {
|
|
render() {
|
|
const { text, author } = this.props // destructuring
|
|
return (
|
|
<Fragment>
|
|
<Text style={styleText}>{text}</Text>
|
|
<Text style={styleAuthor}>— {author}</Text>
|
|
</Fragment>);
|
|
}
|
|
}
|
|
|
|
// Styling in React Native mit JavaScript
|
|
const styleText = { fontSize: 25, fontWeight: 'bold', color: 'black' };
|
|
const styleAuthor = { fontSize: 17, fontsStyle: 'italic', color: 'red' }; |