Skip to content

Commit

Permalink
refactor: correct elevation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak committed Apr 15, 2022
1 parent 237f682 commit 2be5266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion example/src/Examples/MenuExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const MenuExample = ({ navigation }: Props) => {
<Appbar.Action
icon={MORE_ICON}
onPress={_toggleMenu('menu1')}
{...(isV3 && { color: 'white' })}
{...(!isV3 && { color: 'white' })}
/>
}
>
Expand Down
9 changes: 3 additions & 6 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ class Menu extends React.Component<Props, State> {
const shadowMenuContainerStyle = {
opacity: opacityAnimation,
transform: scaleTransforms,
borderRadius: theme.isV3 ? 4 : theme.roundness,
borderRadius: theme.roundness,
...(!theme.isV3 && { elevation: 8 }),
...(scrollableMenuHeight ? { height: scrollableMenuHeight } : {}),
};

Expand Down Expand Up @@ -572,7 +573,6 @@ class Menu extends React.Component<Props, State> {
[
styles.shadowMenuContainer,
shadowMenuContainerStyle,
theme.isV3 && styles.md3ShadowMenuContainer,
theme.isV3 && {
backgroundColor: color(theme.colors.surface)
.mix(color(theme.colors.primary), 0.08)
Expand All @@ -582,6 +582,7 @@ class Menu extends React.Component<Props, State> {
contentStyle,
] as StyleProp<ViewStyle>
}
{...(theme.isV3 && { elevation: 2 })}
>
{(scrollableMenuHeight && (
<ScrollView>{children}</ScrollView>
Expand All @@ -603,10 +604,6 @@ const styles = StyleSheet.create({
shadowMenuContainer: {
opacity: 0,
paddingVertical: 8,
elevation: 8,
},
md3ShadowMenuContainer: {
elevation: 3,
},
});

Expand Down

0 comments on commit 2be5266

Please sign in to comment.