|
- import * as React from 'react'
- import * as T from '@tesseract-design/react-common'
- import {GetServerSideProps, NextPage} from 'next'
- import Template from '../../../../components/templates/LeftSidebarWithMenuLayout'
- import {POPUP, QUERY, SUBPAGE} from '../../../../utilities/queryKeys'
- import {USER} from '../../../../utilities/popups'
- import {MORE, SIDEBAR} from '../../../../utilities/subpages'
-
- type Props = {
- query: string
- subpage: string
- }
-
- const Page: NextPage<Props> = ({query, subpage}) => {
- return (
- <Template
- query={query}
- subpage={subpage}
- userLinkLabel="User"
- searchQueryKey={QUERY}
- searchLabel="Search"
- searchHint="e.g. keywords, names…"
- popupQueryKey={POPUP}
- userPopupQueryValue={USER}
- menuLinkLabel="Menu"
- moreLinkLabel="More"
- subpageQueryKey={SUBPAGE}
- sidebarSubpageQueryValue={SIDEBAR}
- moreSubpageQueryValue={MORE}
- sidebarMenuItems={[
- {
- id: '1',
- label: 'P1',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- },
- {
- id: '2',
- label: 'P2',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- },
- {
- id: '3',
- label: 'P3',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- },
- {
- id: '100',
- label: 'P4',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- },
- {
- id: '101',
- label: 'P5',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- },
- {
- id: '4',
- label: 'S1',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- secondary: true,
- },
- {
- id: '5',
- label: 'S2',
- url: {
- pathname: '/hello',
- },
- icon: <T.Icon name="square" label="" />,
- secondary: true,
- },
- ]}
- />
- )
- }
-
- export default Page
-
- export const getServerSideProps: GetServerSideProps = async (ctx) => {
- const {[QUERY]: query = '', [SUBPAGE]: subpage = null} = ctx.query
- return {
- props: {
- query,
- subpage,
- },
- }
- }
|