Template for starting apps, powered by Next.js
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

51 lines
966 B

  1. import styled from 'styled-components';
  2. import WideTopBar from '../../widgets/WideTopBar';
  3. const Main = styled('main')({
  4. boxSizing: 'border-box',
  5. '@media (min-width: 1080px)': {
  6. paddingLeft: 'calc(50% - var(--width-base, 360px) * 0.5)',
  7. },
  8. })
  9. const LeftSidebar = styled('div')({
  10. '--width-base': '360px',
  11. '--size-menu': '4rem',
  12. boxSizing: 'border-box',
  13. position: 'fixed',
  14. top: 0,
  15. left: 'calc(var(--width-base, 360px) * -1)',
  16. width: 'calc(50% - var(--width-base, 360px) * 0.5)',
  17. height: '100%',
  18. backgroundColor: 'var(--color-bg, white)',
  19. overflow: 'hidden',
  20. '@media (prefers-color-scheme: dark)': {
  21. backgroundColor: 'var(--color-bg, black)',
  22. },
  23. '@media (min-width: 1080px)': {
  24. left: 0,
  25. },
  26. })
  27. const LeftSidebarLayout = ({
  28. query,
  29. sidebar,
  30. children,
  31. }) => {
  32. return (
  33. <>
  34. <WideTopBar
  35. query={query}
  36. />
  37. <LeftSidebar>
  38. {sidebar}
  39. </LeftSidebar>
  40. <Main>
  41. {children}
  42. </Main>
  43. </>
  44. )
  45. }
  46. export default LeftSidebarLayout