Skip to content

Commit

Permalink
refactor: iOS Surface major refactoring (callstack#3738)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarNestorov committed Mar 20, 2023
1 parent 844a2b1 commit 352dfc9
Show file tree
Hide file tree
Showing 37 changed files with 17,775 additions and 17,995 deletions.
52 changes: 50 additions & 2 deletions example/src/Examples/SurfaceExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { StyleSheet, View } from 'react-native';

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

import { useExampleTheme } from '..';
import { isWeb } from '../../utils';
Expand Down Expand Up @@ -31,6 +31,23 @@ const SurfaceExample = () => {
</Text>
</Surface>
))}

<View style={styles.horizontalSurfacesContainer}>
<Surface style={styles.horizontalSurface}>
<Text style={styles.centerText}>Left</Text>
</Surface>
<Surface style={styles.horizontalSurface}>
<Text style={styles.centerText}>Right</Text>
</Surface>
</View>
<View style={styles.verticalSurfacesContainer}>
<Surface style={styles.verticalSurface}>
<Text style={styles.centerText}>Top</Text>
</Surface>
<Surface style={styles.verticalSurface}>
<Text style={styles.centerText}>Bottom</Text>
</Surface>
</View>
</ScreenWrapper>
);
};
Expand Down Expand Up @@ -61,6 +78,37 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},

horizontalSurfacesContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
width: '100%',
marginBottom: 20,
borderColor: MD3Colors.tertiary50,
padding: 10,
borderWidth: 1,
},
horizontalSurface: {
width: '48%',
},

verticalSurfacesContainer: {
height: 400,
justifyContent: 'space-between',
width: '100%',
marginBottom: 100,
borderColor: MD3Colors.tertiary50,
padding: 10,
borderWidth: 1,
},
verticalSurface: {
height: '48%',
justifyContent: 'center',
},

centerText: {
textAlign: 'center',
},
});

export default SurfaceExample;
5 changes: 1 addition & 4 deletions src/components/FAB/FAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ const FAB = forwardRef<View, Props>(
},
],
},
styles.container,
!isV3 && styles.elevated,
!isV3 && disabled && styles.disabled,
style,
Expand All @@ -286,6 +285,7 @@ const FAB = forwardRef<View, Props>(
accessibilityRole="button"
accessibilityState={newAccessibilityState}
testID={testID}
style={{ borderRadius }}
>
<View
style={[styles.content, label ? extendedStyle : fabStyle]}
Expand Down Expand Up @@ -330,9 +330,6 @@ const styles = StyleSheet.create({
elevated: {
elevation: 6,
},
container: {
overflow: 'hidden',
},
content: {
flexDirection: 'row',
alignItems: 'center',
Expand Down
Loading

0 comments on commit 352dfc9

Please sign in to comment.