Skip to content

Commit

Permalink
chore: update routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chef-Yogi committed Sep 30, 2024
1 parent 2886c5c commit 233d956
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
26 changes: 26 additions & 0 deletions apps/web/src/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { dehydrate, QueryClient } from '@tanstack/react-query'
import { GetStaticProps } from 'next'
import { getTotalTvl } from 'utils/getTotalTVL'
import Home from '../views/Home'

const IndexPage = () => {
return <Home />
}

export const getStaticProps: GetStaticProps = async () => {
const queryClient = new QueryClient()
const results = await getTotalTvl()
queryClient.setQueryData(['totalTx30Days'], results.totalTx30Days)
queryClient.setQueryData(['tvl'], results.tvl)
queryClient.setQueryData(['addressCount30Days'], results.addressCount30Days)
return {
props: {
dehydratedState: dehydrate(queryClient),
},
}
}

IndexPage.chains = []
IndexPage.isShowV4IconButton = true

export default IndexPage
34 changes: 11 additions & 23 deletions apps/web/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import { dehydrate, QueryClient } from '@tanstack/react-query'
import { GetStaticProps } from 'next'
import { getTotalTvl } from 'utils/getTotalTVL'
import Home from '../views/Home'
import { CHAIN_IDS } from 'utils/wagmi'
import SwapLayout from 'views/Swap/SwapLayout'
import Swap from 'views/SwapSimplify'

const IndexPage = () => {
return <Home />
}
const SwapPage = () => (
<SwapLayout>
<Swap />
</SwapLayout>
)

export const getStaticProps: GetStaticProps = async () => {
const queryClient = new QueryClient()
const results = await getTotalTvl()
queryClient.setQueryData(['totalTx30Days'], results.totalTx30Days)
queryClient.setQueryData(['tvl'], results.tvl)
queryClient.setQueryData(['addressCount30Days'], results.addressCount30Days)
return {
props: {
dehydratedState: dehydrate(queryClient),
},
}
}
SwapPage.chains = CHAIN_IDS
SwapPage.screen = true

IndexPage.chains = []
IndexPage.isShowV4IconButton = true

export default IndexPage
export default SwapPage

0 comments on commit 233d956

Please sign in to comment.