-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from lidofinance/feature/si-632-add-custom-ser…
…ver-with-proper-cache-control-on-staking Add custom server
- Loading branch information
Showing
15 changed files
with
286 additions
and
217 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { FC } from 'react'; | ||
import { GetStaticPaths, GetStaticProps } from 'next'; | ||
import Head from 'next/head'; | ||
import { useWeb3 } from 'reef-knot/web3-react'; | ||
|
||
import { Layout } from 'shared/components'; | ||
import NoSSRWrapper from 'shared/components/no-ssr-wrapper'; | ||
|
||
import { WithdrawalsTabs } from 'features/withdrawals'; | ||
import { WithdrawalsProvider } from 'features/withdrawals/contexts/withdrawals-context'; | ||
|
||
const Withdrawals: FC<WithdrawalsModePageParams> = ({ mode }) => { | ||
const { account, chainId } = useWeb3(); | ||
|
||
return ( | ||
<Layout | ||
title="Withdrawals" | ||
subtitle="Request stETH/wstETH withdrawal and claim ETH" | ||
> | ||
<Head> | ||
<title>Withdrawals | Lido</title> | ||
</Head> | ||
<WithdrawalsProvider mode={mode}> | ||
<NoSSRWrapper> | ||
{/* In order to simplify side effects of switching wallets we remount the whole widget, resetting all internal state */} | ||
<WithdrawalsTabs key={`${account ?? '_'}${chainId ?? '1'}`} /> | ||
</NoSSRWrapper> | ||
</WithdrawalsProvider> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Withdrawals; | ||
|
||
type WithdrawalsModePageParams = { | ||
mode: 'request' | 'claim'; | ||
}; | ||
|
||
export const getStaticPaths: GetStaticPaths< | ||
WithdrawalsModePageParams | ||
> = async () => { | ||
return { | ||
paths: [{ params: { mode: 'request' } }, { params: { mode: 'claim' } }], | ||
fallback: false, // return 404 on non match | ||
}; | ||
}; | ||
|
||
export const getStaticProps: GetStaticProps< | ||
WithdrawalsModePageParams, | ||
WithdrawalsModePageParams | ||
> = async ({ params }) => { | ||
if (!params?.mode) return { notFound: true }; | ||
return { props: { mode: params.mode } }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.