|
1 | 1 | import * as React from 'react';
|
2 |
| -import { StyleSheet } from 'react-native'; |
| 2 | +import { StyleSheet, View } from 'react-native'; |
3 | 3 |
|
4 |
| -import { MD3Elevation, Surface, Text } from 'react-native-paper'; |
| 4 | +import { MD3Elevation, Surface, Text, MD3Colors } from 'react-native-paper'; |
5 | 5 |
|
6 | 6 | import { useExampleTheme } from '..';
|
7 | 7 | import { isWeb } from '../../utils';
|
@@ -31,6 +31,23 @@ const SurfaceExample = () => {
|
31 | 31 | </Text>
|
32 | 32 | </Surface>
|
33 | 33 | ))}
|
| 34 | + |
| 35 | + <View style={styles.horizontalSurfacesContainer}> |
| 36 | + <Surface style={styles.horizontalSurface}> |
| 37 | + <Text style={styles.centerText}>Left</Text> |
| 38 | + </Surface> |
| 39 | + <Surface style={styles.horizontalSurface}> |
| 40 | + <Text style={styles.centerText}>Right</Text> |
| 41 | + </Surface> |
| 42 | + </View> |
| 43 | + <View style={styles.verticalSurfacesContainer}> |
| 44 | + <Surface style={styles.verticalSurface}> |
| 45 | + <Text style={styles.centerText}>Top</Text> |
| 46 | + </Surface> |
| 47 | + <Surface style={styles.verticalSurface}> |
| 48 | + <Text style={styles.centerText}>Bottom</Text> |
| 49 | + </Surface> |
| 50 | + </View> |
34 | 51 | </ScreenWrapper>
|
35 | 52 | );
|
36 | 53 | };
|
@@ -61,6 +78,37 @@ const styles = StyleSheet.create({
|
61 | 78 | alignItems: 'center',
|
62 | 79 | justifyContent: 'center',
|
63 | 80 | },
|
| 81 | + |
| 82 | + horizontalSurfacesContainer: { |
| 83 | + flexDirection: 'row', |
| 84 | + justifyContent: 'space-between', |
| 85 | + width: '100%', |
| 86 | + marginBottom: 20, |
| 87 | + borderColor: MD3Colors.tertiary50, |
| 88 | + padding: 10, |
| 89 | + borderWidth: 1, |
| 90 | + }, |
| 91 | + horizontalSurface: { |
| 92 | + width: '48%', |
| 93 | + }, |
| 94 | + |
| 95 | + verticalSurfacesContainer: { |
| 96 | + height: 400, |
| 97 | + justifyContent: 'space-between', |
| 98 | + width: '100%', |
| 99 | + marginBottom: 100, |
| 100 | + borderColor: MD3Colors.tertiary50, |
| 101 | + padding: 10, |
| 102 | + borderWidth: 1, |
| 103 | + }, |
| 104 | + verticalSurface: { |
| 105 | + height: '48%', |
| 106 | + justifyContent: 'center', |
| 107 | + }, |
| 108 | + |
| 109 | + centerText: { |
| 110 | + textAlign: 'center', |
| 111 | + }, |
64 | 112 | });
|
65 | 113 |
|
66 | 114 | export default SurfaceExample;
|
0 commit comments