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.
 
 

49 lines
885 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. paddingRight: 'calc(50% - var(--width-base, 360px) * 0.5)',
  7. },
  8. })
  9. const RightSidebar = styled('div')({
  10. '--width-base': '360px',
  11. boxSizing: 'border-box',
  12. backgroundColor: 'var(--color-bg, white)',
  13. '@media (prefers-color-scheme: dark)': {
  14. backgroundColor: 'var(--color-bg, black)',
  15. },
  16. '@media (min-width: 1080px)': {
  17. position: 'fixed',
  18. top: 0,
  19. right: 0,
  20. width: 'calc(50% - var(--width-base, 360px) * 0.5)',
  21. height: '100%',
  22. },
  23. })
  24. const LeftSidebarLayout = ({
  25. query,
  26. sidebar,
  27. children,
  28. }) => {
  29. return (
  30. <>
  31. <WideTopBar
  32. query={query}
  33. />
  34. <Main>
  35. {children}
  36. </Main>
  37. <RightSidebar>
  38. {sidebar}
  39. </RightSidebar>
  40. </>
  41. )
  42. }
  43. export default LeftSidebarLayout