Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Appbar/Appbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ const Appbar = ({
!theme.isV3 && { elevation },
]}
elevation={elevation as MD3Elevation}
container
{...rest}
>
{shouldAddLeftSpacing ? <View style={spacingStyle} /> : null}
Expand Down
1 change: 1 addition & 0 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const Banner = ({
{...rest}
style={[!theme.isV3 && styles.elevation, { opacity }, style]}
theme={theme}
container
{...(theme.isV3 && { elevation })}
>
<View style={[styles.wrapper, contentStyle]}>
Expand Down
1 change: 1 addition & 0 deletions src/components/BottomNavigation/BottomNavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ const BottomNavigationBar = <Route extends BaseRoute>({
: 'none'
}
onLayout={onLayout}
container
>
<Animated.View
style={[styles.barContent, { backgroundColor }]}
Expand Down
1 change: 1 addition & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ const Button = (
] as Animated.WithAnimatedValue<StyleProp<ViewStyle>>
}
{...(isV3 && { elevation: elevation })}
container
>
<TouchableRipple
borderless
Expand Down
1 change: 1 addition & 0 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ const Card = (
elevation: isMode('elevated') ? computedElevation : 0,
})}
testID={`${testID}-container`}
container
{...rest}
>
{isMode('outlined') && (
Expand Down
1 change: 1 addition & 0 deletions src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ const Chip = ({
{...rest}
testID={`${testID}-container`}
theme={theme}
container
>
<TouchableRipple
borderless
Expand Down
1 change: 1 addition & 0 deletions src/components/FAB/AnimatedFAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ const AnimatedFAB = ({
]}
{...(isV3 && { elevation: md3Elevation })}
theme={theme}
container
>
<Animated.View
style={[
Expand Down
1 change: 1 addition & 0 deletions src/components/FAB/FAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ const FAB = forwardRef<View, Props>(
pointerEvents={visible ? 'auto' : 'none'}
testID={`${testID}-container`}
{...(isV3 && { elevation: md3Elevation })}
container
>
<TouchableRipple
borderless
Expand Down
1 change: 1 addition & 0 deletions src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const IconButton = forwardRef<View, Props>(
!isV3 && disabled && styles.disabled,
style,
]}
container
{...(isV3 && { elevation: 0 })}
>
<TouchableRipple
Expand Down
1 change: 1 addition & 0 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ const Menu = ({
{...(theme.isV3 && { elevation })}
testID={`${testID}-surface`}
theme={theme}
container
>
{(scrollableMenuHeight && (
<ScrollView
Expand Down
1 change: 1 addition & 0 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function Modal({
testID={`${testID}-surface`}
theme={theme}
style={[{ opacity }, styles.content, contentContainerStyle]}
container
>
{children}
</Surface>
Expand Down
1 change: 1 addition & 0 deletions src/components/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ const Searchbar = forwardRef<TextInputHandles, Props>(
]}
testID={`${testID}-container`}
{...(theme.isV3 && { elevation })}
container
theme={theme}
>
<IconButton
Expand Down
1 change: 1 addition & 0 deletions src/components/Snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ const Snackbar = ({
style,
]}
testID={testID}
container
{...(isV3 && { elevation })}
{...rest}
>
Expand Down
12 changes: 10 additions & 2 deletions src/components/Surface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export type Props = Omit<React.ComponentPropsWithRef<typeof View>, 'style'> & {
*/
testID?: string;
ref?: React.RefObject<View>;
/**
* @internal
*/
container?: boolean;
};

const MD2Surface = forwardRef<View, Props>(
Expand Down Expand Up @@ -161,6 +165,7 @@ const SurfaceIOS = forwardRef<
testID,
children,
mode = 'elevated',
container,
...props
},
ref
Expand Down Expand Up @@ -202,12 +207,15 @@ const SurfaceIOS = forwardRef<
...(isElevated && getStyleForShadowLayer(elevation, 1)),
...filteredStyles,
...borderRadiusStyles,
flex: flattenedStyles.height || flattenedStyles.flex ? 1 : undefined,
flex:
flattenedStyles.height || (!container && flattenedStyles.flex)
? 1
: undefined,
backgroundColor: bgColor,
};

return [outerLayerViewStyles, innerLayerViewStyles];
}, [style, elevation, backgroundColor, mode]);
}, [style, elevation, backgroundColor, mode, container]);

return (
<Animated.View
Expand Down
Loading