mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-14 01:54:59 +08:00
46 lines
1020 B
JavaScript
46 lines
1020 B
JavaScript
/* @flow */
|
|
|
|
import * as React from 'react';
|
|
import { View, StyleSheet } from 'react-native';
|
|
import {
|
|
Caption,
|
|
Headline,
|
|
Paragraph,
|
|
Subheading,
|
|
Title,
|
|
withTheme,
|
|
} from 'react-native-paper';
|
|
import type { Theme } from 'react-native-paper/types';
|
|
|
|
type Props = {
|
|
theme: Theme,
|
|
};
|
|
|
|
class TextExample extends React.Component<Props> {
|
|
static title = 'Typography';
|
|
|
|
render() {
|
|
const { theme: { colors: { background } } } = this.props;
|
|
return (
|
|
<View style={[styles.container, { backgroundColor: background }]}>
|
|
<Caption style={styles.text}>Caption</Caption>
|
|
<Paragraph style={styles.text}>Paragraph</Paragraph>
|
|
<Subheading style={styles.text}>Subheading</Subheading>
|
|
<Title style={styles.text}>Title</Title>
|
|
<Headline style={styles.text}>Headline</Headline>
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
padding: 16,
|
|
flex: 1,
|
|
},
|
|
text: {
|
|
marginVertical: 4,
|
|
},
|
|
});
|
|
|
|
export default withTheme(TextExample);
|