Layout scaffolding for Web apps.
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.
 
 
 

62 lines
1.6 KiB

  1. import type { NextPage } from 'next'
  2. import { Layouts, Widgets } from '@tesseract-design/viewfinder-react';
  3. import {Span} from '@tesseract-design/viewfinder-base';
  4. import {useRouter} from 'next/router';
  5. import {useMemo} from 'react';
  6. import Link from 'next/link';
  7. import {Brand} from '../../components/Brand';
  8. import {DummyLinks} from '../../components/DummyLinks';
  9. const LeftSidebarLayoutPage: NextPage = () => {
  10. const router = useRouter();
  11. const sidebarOpen = useMemo(() => router.query.open === 'sidebar', [router]);
  12. return (
  13. <Layouts.LeftSidebar.Root
  14. sidebarBaseWidget={
  15. <Widgets.LeftSidebarBase
  16. span={Span.WIDE}
  17. open={sidebarOpen}
  18. style={{
  19. backgroundColor: 'inherit',
  20. }}
  21. >
  22. <Layouts.LeftSidebar.SidebarContentContainer>
  23. Sidebar
  24. </Layouts.LeftSidebar.SidebarContentContainer>
  25. </Widgets.LeftSidebarBase>
  26. }
  27. topBarWidget={
  28. <Widgets.TopBar
  29. brand={
  30. <Brand />
  31. }
  32. style={{
  33. backgroundColor: 'inherit',
  34. }}
  35. menuLink={
  36. <Link
  37. href={{
  38. query: {
  39. open: 'sidebar',
  40. },
  41. }}
  42. >
  43. Open
  44. </Link>
  45. }
  46. span={Span.WIDE}
  47. >
  48. <DummyLinks />
  49. </Widgets.TopBar>
  50. }
  51. >
  52. <Layouts.LeftSidebar.MainContentContainer>
  53. Hello
  54. </Layouts.LeftSidebar.MainContentContainer>
  55. </Layouts.LeftSidebar.Root>
  56. )
  57. }
  58. export default LeftSidebarLayoutPage