Fix animation when coming from bottom

This commit is contained in:
fragosti
2018-06-27 16:28:54 -07:00
parent 26a9fe9127
commit cce5585795

View File

@@ -25,12 +25,18 @@ const appearFromBottomFrames = keyframes`
}
`;
const stylesForAnimation: { [K in AnimationType]: string } = {
// Needed for safari
easeUpFromBottom: `position: fixed`,
};
const animations: { [K in AnimationType]: string } = {
easeUpFromBottom: `${appearFromBottomFrames} 1s ease 0s 1 forwards`,
};
export const Animation = styled(PlainAnimation)`
animation: ${props => animations[props.type]};
${props => stylesForAnimation[props.type]};
`;
Animation.displayName = 'Animation';