forked from callstack/react-native-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSurfaceExample.tsx
45 lines (38 loc) · 894 Bytes
/
SurfaceExample.tsx
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
import * as React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { Text, Surface, useTheme } from 'react-native-paper';
const SurfaceExample = () => {
const {
colors: { background },
} = useTheme();
return (
<ScrollView
style={[styles.container, { backgroundColor: background }]}
contentContainerStyle={styles.content}
>
{[1, 2, 4, 6, 12].map((i) => (
<Surface key={i} style={[styles.surface, { elevation: i }]}>
<Text>{i}</Text>
</Surface>
))}
</ScrollView>
);
};
SurfaceExample.title = 'Surface';
const styles = StyleSheet.create({
container: {
flex: 1,
},
content: {
padding: 24,
alignItems: 'center',
},
surface: {
margin: 24,
height: 80,
width: 80,
alignItems: 'center',
justifyContent: 'center',
},
});
export default SurfaceExample;