mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-17 12:11:35 +08:00
* refactor: Add DarkTheme, new colors in theme & update components to use it * chore: Remove 'console.log' statements * chore: Change dark theme property from string to boolean * feat: Add ability to toggle the theme from the drawer * fix: Wrap typography example screen with 'withTheme' * style: Update components to use correct dark theme colors * style: Update dark theme primary color and rn-navigation toolbar now gets the color from the theme * style: Add color prop to DrawerItem and update the example * style: Change the unchecked color in both Checkbox and RadioButton * chore: Add `yarn-error.log` to `.gitignore` * chore: Use lodash instead of lodash.merge * chore: Address PR comments
77 lines
2.1 KiB
JavaScript
77 lines
2.1 KiB
JavaScript
/* @flow */
|
|
|
|
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { ScrollView, StyleSheet } from 'react-native';
|
|
import {
|
|
Title,
|
|
Caption,
|
|
Paragraph,
|
|
Card,
|
|
Button,
|
|
withTheme,
|
|
} from 'react-native-paper';
|
|
|
|
class CardExample extends Component {
|
|
static title = 'Card';
|
|
static propTypes = {
|
|
theme: PropTypes.object.isRequired,
|
|
};
|
|
render() {
|
|
const { theme: { colors: { background } } } = this.props;
|
|
return (
|
|
<ScrollView
|
|
style={[styles.container, { backgroundColor: background }]}
|
|
contentContainerStyle={styles.content}
|
|
>
|
|
<Card>
|
|
<Card.Cover source={require('../assets/wrecked-ship.jpg')} />
|
|
<Card.Content>
|
|
<Title>Abandoned Ship</Title>
|
|
<Paragraph>
|
|
The Abandoned Ship is a wrecked ship located on Route 108 in
|
|
Hoenn, originally being a ship named the S.S. Cactus. The second
|
|
part of the ship can only be accessed by using Dive and contains
|
|
the Scanner.
|
|
</Paragraph>
|
|
</Card.Content>
|
|
</Card>
|
|
<Card>
|
|
<Card.Cover source={require('../assets/forest.jpg')} />
|
|
<Card.Actions>
|
|
<Button primary>Cancel</Button>
|
|
<Button primary>Ok</Button>
|
|
</Card.Actions>
|
|
</Card>
|
|
<Card>
|
|
<Card.Content>
|
|
<Title>Berries</Title>
|
|
<Caption>Omega Ruby</Caption>
|
|
<Paragraph>
|
|
Dotted around the Hoenn region, you will find loamy soil, many of
|
|
which are housing berries. Once you have picked the berries, then
|
|
you have the ability to use that loamy soil to grow your own
|
|
berries. These can be any berry and will require attention to get
|
|
the best crop.
|
|
</Paragraph>
|
|
</Card.Content>
|
|
</Card>
|
|
<Card>
|
|
<Card.Cover source={require('../assets/strawberries.jpg')} />
|
|
</Card>
|
|
</ScrollView>
|
|
);
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
},
|
|
content: {
|
|
padding: 4,
|
|
},
|
|
});
|
|
|
|
export default withTheme(CardExample);
|