Skip to content

Commit 352dfc9

Browse files
refactor: iOS Surface major refactoring (#3738)
1 parent 844a2b1 commit 352dfc9

37 files changed

+17775
-17995
lines changed

example/src/Examples/SurfaceExample.tsx

+50-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
2-
import { StyleSheet } from 'react-native';
2+
import { StyleSheet, View } from 'react-native';
33

4-
import { MD3Elevation, Surface, Text } from 'react-native-paper';
4+
import { MD3Elevation, Surface, Text, MD3Colors } from 'react-native-paper';
55

66
import { useExampleTheme } from '..';
77
import { isWeb } from '../../utils';
@@ -31,6 +31,23 @@ const SurfaceExample = () => {
3131
</Text>
3232
</Surface>
3333
))}
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>
3451
</ScreenWrapper>
3552
);
3653
};
@@ -61,6 +78,37 @@ const styles = StyleSheet.create({
6178
alignItems: 'center',
6279
justifyContent: 'center',
6380
},
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+
},
64112
});
65113

66114
export default SurfaceExample;

src/components/FAB/FAB.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ const FAB = forwardRef<View, Props>(
266266
},
267267
],
268268
},
269-
styles.container,
270269
!isV3 && styles.elevated,
271270
!isV3 && disabled && styles.disabled,
272271
style,
@@ -286,6 +285,7 @@ const FAB = forwardRef<View, Props>(
286285
accessibilityRole="button"
287286
accessibilityState={newAccessibilityState}
288287
testID={testID}
288+
style={{ borderRadius }}
289289
>
290290
<View
291291
style={[styles.content, label ? extendedStyle : fabStyle]}
@@ -330,9 +330,6 @@ const styles = StyleSheet.create({
330330
elevated: {
331331
elevation: 6,
332332
},
333-
container: {
334-
overflow: 'hidden',
335-
},
336333
content: {
337334
flexDirection: 'row',
338335
alignItems: 'center',

0 commit comments

Comments
 (0)