styled.ts 829 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import styled, { css, keyframes } from 'styled-components';
  2. const closeToolbar = keyframes`
  3. from {
  4. pointer-events: auto;
  5. opacity: 1;
  6. }
  7. to {
  8. opacity: 0;
  9. }
  10. `;
  11. export const Container = styled('div')<{
  12. displayMode: string;
  13. hidden: boolean;
  14. }>`
  15. position: fixed;
  16. top: 86px;
  17. left: ${props => (props.displayMode === 'normal' ? '267px' : 0)};
  18. right: 0;
  19. margin: auto;
  20. max-width: 572px;
  21. width: 100%;
  22. height: 54px;
  23. border-radius: 4px;
  24. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.38);
  25. background-color: white;
  26. display: flex;
  27. align-items: center;
  28. justify-content: space-between;
  29. padding: 0 8px;
  30. z-index: 2;
  31. transition: all 225ms ease-in-out;
  32. ${props =>
  33. props.hidden
  34. ? css`
  35. animation: ${closeToolbar} 3s forwards;
  36. `
  37. : ''}
  38. `;
  39. export default Container;