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.
 
 

105 lines
2.1 KiB

  1. import * as React from 'react'
  2. import * as T from '@tesseract-design/react-common'
  3. import {GetServerSideProps, NextPage} from 'next'
  4. import Template from '../../../../components/templates/LeftSidebarWithMenuLayout'
  5. import {POPUP, QUERY, SUBPAGE} from '../../../../utilities/queryKeys'
  6. import {USER} from '../../../../utilities/popups'
  7. import {MORE, SIDEBAR} from '../../../../utilities/subpages'
  8. type Props = {
  9. query: string
  10. subpage: string
  11. }
  12. const Page: NextPage<Props> = ({query, subpage}) => {
  13. return (
  14. <Template
  15. query={query}
  16. subpage={subpage}
  17. userLinkLabel="User"
  18. searchQueryKey={QUERY}
  19. searchLabel="Search"
  20. searchHint="e.g. keywords, names&hellip;"
  21. popupQueryKey={POPUP}
  22. userPopupQueryValue={USER}
  23. menuLinkLabel="Menu"
  24. moreLinkLabel="More"
  25. subpageQueryKey={SUBPAGE}
  26. sidebarSubpageQueryValue={SIDEBAR}
  27. moreSubpageQueryValue={MORE}
  28. sidebarMenuItems={[
  29. {
  30. id: '1',
  31. label: 'P1',
  32. url: {
  33. pathname: '/hello',
  34. },
  35. icon: <T.Icon name="square" label="" />,
  36. },
  37. {
  38. id: '2',
  39. label: 'P2',
  40. url: {
  41. pathname: '/hello',
  42. },
  43. icon: <T.Icon name="square" label="" />,
  44. },
  45. {
  46. id: '3',
  47. label: 'P3',
  48. url: {
  49. pathname: '/hello',
  50. },
  51. icon: <T.Icon name="square" label="" />,
  52. },
  53. {
  54. id: '100',
  55. label: 'P4',
  56. url: {
  57. pathname: '/hello',
  58. },
  59. icon: <T.Icon name="square" label="" />,
  60. },
  61. {
  62. id: '101',
  63. label: 'P5',
  64. url: {
  65. pathname: '/hello',
  66. },
  67. icon: <T.Icon name="square" label="" />,
  68. },
  69. {
  70. id: '4',
  71. label: 'S1',
  72. url: {
  73. pathname: '/hello',
  74. },
  75. icon: <T.Icon name="square" label="" />,
  76. secondary: true,
  77. },
  78. {
  79. id: '5',
  80. label: 'S2',
  81. url: {
  82. pathname: '/hello',
  83. },
  84. icon: <T.Icon name="square" label="" />,
  85. secondary: true,
  86. },
  87. ]}
  88. />
  89. )
  90. }
  91. export default Page
  92. export const getServerSideProps: GetServerSideProps = async (ctx) => {
  93. const {[QUERY]: query = '', [SUBPAGE]: subpage = null} = ctx.query
  94. return {
  95. props: {
  96. query,
  97. subpage,
  98. },
  99. }
  100. }