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.
 
 

41 lines
941 B

  1. import {GetServerSideProps, NextPage} from 'next'
  2. import Template from '../../../components/templates/LeftSidebarLayout'
  3. import {POPUP, QUERY, SUBPAGE} from '../../../utilities/queryKeys'
  4. import {USER} from '../../../utilities/popups'
  5. import {SIDEBAR} from '../../../utilities/subpages'
  6. type Props = {
  7. query: string
  8. subpage: string
  9. }
  10. const Page: NextPage<Props> = ({query, subpage}) => {
  11. return (
  12. <Template
  13. subpage={subpage}
  14. query={query}
  15. userLinkLabel="User"
  16. searchQueryKey={QUERY}
  17. searchLabel="Search"
  18. searchHint="e.g. keywords, names&hellip;"
  19. popupQueryKey={POPUP}
  20. userPopupQueryValue={USER}
  21. menuLinkLabel="Menu"
  22. subpageQueryKey={SUBPAGE}
  23. sidebarSubpageQueryValue={SIDEBAR}
  24. />
  25. )
  26. }
  27. export default Page
  28. export const getServerSideProps: GetServerSideProps = async (ctx) => {
  29. const {[QUERY]: query = '', [SUBPAGE]: subpage = null} = ctx.query
  30. return {
  31. props: {
  32. query,
  33. subpage,
  34. },
  35. }
  36. }