@@ -18,12 +18,13 @@ import useChainConfig from 'hooks/chain/useChainConfig'
1818import useCurrentChainId from 'hooks/localStorage/useCurrentChainId'
1919import useLocalStorage from 'hooks/localStorage/useLocalStorage'
2020import { useSkipBridgeStatus } from 'hooks/localStorage/useSkipBridgeStatus'
21- import { Suspense , useEffect } from 'react'
21+ import { Suspense , useEffect , useMemo } from 'react'
2222import { isMobile } from 'react-device-detect'
2323import { useLocation } from 'react-router-dom'
2424import useStore from 'store'
2525import { SWRConfig } from 'swr'
2626import { debugSWR } from 'utils/middleware'
27+ import { getPage } from 'utils/route'
2728
2829interface Props {
2930 focusComponent : FocusComponent | null
@@ -90,6 +91,16 @@ export default function Layout({ children }: { children: React.ReactNode }) {
9091 }
9192 } , [ chainConfig . id , currentChainId , setCurrentChainId ] )
9293
94+ const page = getPage ( location . pathname , chainConfig )
95+ const [ isHls , isV1 , isVaults ] = useMemo (
96+ ( ) => [ page . split ( '-' ) [ 0 ] === 'hls' , page === 'v1' , page . includes ( 'vaults' ) ] ,
97+ [ page ] ,
98+ )
99+
100+ useEffect ( ( ) => {
101+ useStore . setState ( { isHls, isV1, isVaults } )
102+ } , [ isHls , isV1 , isVaults ] )
103+
93104 return (
94105 < >
95106 < ErrorBoundary errorStore = { errorStore } >
0 commit comments