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.
 
 

93 lines
1.7 KiB

  1. import * as React from 'react'
  2. import * as T from '@tesseract-design/react-common'
  3. import { LeftSidebar } from '@tesseract-design/viewfinder'
  4. import DummyContent from '../../molecules/DummyContent'
  5. import Link from '../../molecules/Link'
  6. import Brand from '../../molecules/Brand'
  7. type Props = {
  8. query: string,
  9. sidebarMainOpen: boolean,
  10. menuLinkLabel: string,
  11. userLinkLabel: string,
  12. searchQueryKey: string,
  13. searchLabel: string,
  14. searchHint: string,
  15. popupQueryKey: string,
  16. userPopupQueryValue: string,
  17. sidebarQueryKey: string,
  18. }
  19. const LeftSidebarLayoutTemplate: React.FC<Props> = ({
  20. query,
  21. sidebarMainOpen,
  22. menuLinkLabel,
  23. userLinkLabel,
  24. searchQueryKey,
  25. searchLabel,
  26. searchHint,
  27. popupQueryKey,
  28. userPopupQueryValue,
  29. sidebarQueryKey,
  30. }) => {
  31. return (
  32. <LeftSidebar.Layout
  33. brand={
  34. <Brand />
  35. }
  36. sidebarMainOpen={sidebarMainOpen}
  37. topBarCenter={
  38. <form>
  39. <T.TextInput
  40. name={searchQueryKey}
  41. label={searchLabel}
  42. hint={searchHint}
  43. defaultValue={query}
  44. border
  45. alternate
  46. />
  47. </form>
  48. }
  49. menuLink={
  50. <Link
  51. href={{
  52. query: {
  53. [sidebarQueryKey]: '',
  54. },
  55. }}
  56. >
  57. <T.Icon
  58. name="menu"
  59. label={menuLinkLabel}
  60. />
  61. </Link>
  62. }
  63. userLink={
  64. <Link
  65. href={{
  66. query: {
  67. [popupQueryKey]: userPopupQueryValue,
  68. },
  69. }}
  70. >
  71. <T.Icon
  72. name="user"
  73. label={userLinkLabel}
  74. />
  75. </Link>
  76. }
  77. sidebarMain={
  78. <LeftSidebar.SidebarContainer>
  79. <DummyContent />
  80. </LeftSidebar.SidebarContainer>
  81. }
  82. >
  83. <LeftSidebar.ContentContainer>
  84. <DummyContent />
  85. </LeftSidebar.ContentContainer>
  86. </LeftSidebar.Layout>
  87. )
  88. }
  89. export default LeftSidebarLayoutTemplate