-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bridge ui cookie hydration issue
- Loading branch information
Showing
5 changed files
with
10 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
import { headers } from "next/headers"; | ||
import { cookieToInitialState } from "wagmi"; | ||
import { Web3Provider } from "@/contexts/web3.context"; | ||
import { ModalProvider } from "@/contexts/modal.context"; | ||
import { TokenStoreProvider } from "@/stores/tokenStoreProvider"; | ||
import { getTokenConfig } from "@/services/tokenService"; | ||
import { wagmiConfig } from "@/config"; | ||
|
||
type ProvidersProps = { | ||
children: JSX.Element; | ||
}; | ||
|
||
export async function Providers({ children }: ProvidersProps) { | ||
const initialState = cookieToInitialState(wagmiConfig, headers().get("cookie")); | ||
const tokensList = await getTokenConfig(); | ||
|
||
return ( | ||
<TokenStoreProvider initialState={{ tokensList }}> | ||
<Web3Provider initialState={initialState}> | ||
<Web3Provider> | ||
<TokenStoreProvider initialState={{ tokensList }}> | ||
<ModalProvider>{children}</ModalProvider> | ||
</Web3Provider> | ||
</TokenStoreProvider> | ||
</TokenStoreProvider> | ||
</Web3Provider> | ||
); | ||
} |
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