Layout scaffolding for Web apps.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

49 lignes
888 B

  1. import * as React from 'react'
  2. import styled, { createGlobalStyle } from 'styled-components'
  3. import TopBar from '../../widgets/TopBar'
  4. import {configVar, loadConfig} from '../../utilities/helpers'
  5. const Config = createGlobalStyle({
  6. ...loadConfig(),
  7. })
  8. const ContentBase = styled('main')({
  9. boxSizing: 'border-box',
  10. })
  11. export const ContentContainer = styled('div')({
  12. padding: '0 1rem',
  13. boxSizing: 'border-box',
  14. margin: '0 auto',
  15. maxWidth: `calc(${configVar('base-width')} * 2)`,
  16. width: '100%',
  17. })
  18. type Props = {
  19. brand?: React.ReactNode,
  20. userLink?: React.ReactNode,
  21. topBarCenter?: React.ReactChild,
  22. }
  23. export const Layout: React.FC<Props> = ({
  24. brand,
  25. userLink,
  26. topBarCenter,
  27. children,
  28. }) => {
  29. return (
  30. <>
  31. <Config />
  32. <TopBar
  33. brand={brand}
  34. userLink={userLink}
  35. >
  36. {topBarCenter}
  37. </TopBar>
  38. <ContentBase>
  39. {children}
  40. </ContentBase>
  41. </>
  42. )
  43. }