Navbar.style.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import styled from '@emotion/styled'
  2. import { Searchbar, Icon } from '@/shared/components'
  3. import { colors, sizes } from '@/shared/theme'
  4. import { ReactComponent as UnstyledLogo } from '@/assets/logo.svg'
  5. export const Header = styled.header<{ isSearching: boolean }>`
  6. display: grid;
  7. grid-template-columns: ${(props) => (props.isSearching ? `134px 1fr 134px` : `repeat(3, 1fr)`)};
  8. grid-template-areas: ${(props) => (props.isSearching ? `". searchbar cancel"` : `"navigation searchbar ."`)};
  9. width: 100%;
  10. padding: ${(props) => (props.isSearching ? `${sizes.b2}px` : `${sizes.b3}px ${sizes.b8}px`)};
  11. border-bottom: 1px solid ${colors.gray[800]};
  12. background-color: ${(props) => (props.isSearching ? colors.gray[900] : colors.black)};
  13. `
  14. export const Logo = styled(UnstyledLogo)`
  15. width: ${sizes.b12}px;
  16. height: ${sizes.b12}px;
  17. `
  18. export const NavigationContainer = styled.div`
  19. display: flex;
  20. grid-area: navigation;
  21. align-items: center;
  22. > * + * {
  23. margin-left: ${sizes.b6}px;
  24. }
  25. `
  26. export const StyledSearchbar = styled(Searchbar)`
  27. width: 100%;
  28. grid-area: searchbar;
  29. `
  30. export const StyledIcon = styled(Icon)`
  31. color: ${colors.gray[300]};
  32. &:hover {
  33. color: ${colors.white};
  34. cursor: pointer;
  35. }
  36. `
  37. export const CancelButton = styled.div`
  38. width: ${sizes.b12}px;
  39. height: ${sizes.b12}px;
  40. color: ${colors.white};
  41. grid-area: cancel;
  42. display: flex;
  43. justify-content: center;
  44. align-items: center;
  45. justify-self: end;
  46. :hover {
  47. cursor: pointer;
  48. }
  49. `