Skip to content

Commit

Permalink
fix broken blur effect in SheetHandle (#1509)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedemarais authored Dec 29, 2020
1 parent 5ee0ff5 commit 76f64fb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/components/sheet/SheetHandle.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { VibrancyView } from '@react-native-community/blur';
import React from 'react';
import { View } from 'react-native';
import styled from 'styled-components/primitives';
import { neverRerender } from '../../utils';
import { colors } from '@rainbow-me/styles';

export const HandleHeight = 5;

const defaultColor = colors.alpha(colors.blueGreyDark, 0.3);

const SheetHandle = styled.View.attrs(({ showBlur }) => ({
as: showBlur && ios ? VibrancyView : View,
const Handle = styled.View.attrs({
blurAmount: 20,
blurType: 'light',
}))`
})`
background-color: ${({ color = defaultColor }) => color};
border-radius: 3;
height: ${HandleHeight};
Expand All @@ -21,4 +20,12 @@ const SheetHandle = styled.View.attrs(({ showBlur }) => ({
z-index: 9;
`;

export default neverRerender(SheetHandle);
export default function SheetHandle({ showBlur, ...props }) {
return (
<Handle
{...props}
as={showBlur && ios ? VibrancyView : View}
showBlur={showBlur}
/>
);
}

0 comments on commit 76f64fb

Please sign in to comment.