-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathThemeExample.tsx
More file actions
43 lines (38 loc) · 1.23 KB
/
ThemeExample.tsx
File metadata and controls
43 lines (38 loc) · 1.23 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
import * as React from 'react';
import { StyleSheet } from 'react-native';
import type { StackNavigationProp } from '@react-navigation/stack';
import { List, PaperProvider, Banner } from 'react-native-paper';
import ScreenWrapper from '../ScreenWrapper';
type Props = {
navigation: StackNavigationProp<{ [key: string]: undefined }>;
};
const ThemeExample = ({ navigation }: Props) => {
return (
<PaperProvider>
<ScreenWrapper contentContainerStyle={styles.container}>
<Banner visible>
React Native Paper automatically adapts theme based on system
preferences. Please change system theme to dark/light to see the
effect
</Banner>
<List.Section title={`Theme based on the source color`}>
<List.Item
title="Themed Sport App"
description="Go to the example"
onPress={() => navigation.navigate('teamsList')}
right={(props) => (
<List.Icon iconSize={32} {...props} icon="arrow-right" />
)}
/>
</List.Section>
</ScreenWrapper>
</PaperProvider>
);
};
ThemeExample.title = 'Theme';
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default ThemeExample;