Layout scaffolding for Web apps.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

52 řádky
1.0 KiB

  1. import * as React from 'react';
  2. import {LayoutArgs, layouts, Span} from '@tesseract-design/viewfinder-base';
  3. export type RootProps = React.HTMLProps<HTMLDivElement> & {
  4. topBarWidget?: React.ReactNode;
  5. }
  6. export const Root = React.forwardRef<HTMLDivElement, RootProps>(({
  7. children,
  8. topBarWidget,
  9. ...etcProps
  10. }, ref) => (
  11. <>
  12. {topBarWidget}
  13. <main
  14. {...etcProps}
  15. className={layouts.Basic.ContentBase()}
  16. ref={ref}
  17. >
  18. {children}
  19. </main>
  20. </>
  21. ));
  22. Root.displayName = 'Root';
  23. export type ContentContainerProps = Omit<React.HTMLProps<HTMLDivElement>, 'span'> & {
  24. span?: Span,
  25. }
  26. export const ContentContainer = React.forwardRef<HTMLDivElement, ContentContainerProps>(({
  27. children,
  28. span = Span.NORMAL,
  29. }, ref) => {
  30. const args: LayoutArgs = {
  31. span,
  32. mainSidebarOpen: false,
  33. auxiliaryItemsShown: false,
  34. };
  35. return (
  36. <div
  37. className={layouts.Basic.ContentContainer(args)}
  38. ref={ref}
  39. >
  40. {children}
  41. </div>
  42. )
  43. });
  44. ContentContainer.displayName = 'ContentContainer'