forked from Iguana-DEX/frontend-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
38 lines (35 loc) · 1.04 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { useTranslation } from '@pancakeswap/localization'
import { SubMenuItems } from '@pancakeswap/uikit'
import { useRouter } from 'next/router'
import { useChainNameByQuery, useMultiChainPath } from 'state/info/hooks'
import InfoNav from './components/InfoNav'
export const InfoPageLayout = ({ children }) => {
const router = useRouter()
const chainName = useChainNameByQuery()
const chainPath = useMultiChainPath()
const { t } = useTranslation()
const isStableSwap = router.query.type === 'stableSwap'
return (
<>
<SubMenuItems
items={[
{
label: t('V3'),
href: `/info/v3${chainPath}`,
},
{
label: t('V2'),
href: `/info${chainPath}`,
},
chainName === 'BSC' && {
label: t('StableSwap'),
href: '/info?type=stableSwap',
},
]}
activeItem={isStableSwap ? '/info?type=stableSwap' : `/info${chainPath}`}
/>
<InfoNav isStableSwap={isStableSwap} />
{children}
</>
)
}