From 2c8b7527027178eca751018d17e9fde28bf3c4a8 Mon Sep 17 00:00:00 2001
From: aeolian <94939382+aeolianeth@users.noreply.github.com>
Date: Sun, 8 Dec 2024 19:13:56 +1000
Subject: [PATCH] Async the V4ProjectPage
---
.../V4ProjectDashboard/V4ProjectDashboard.tsx | 2 +-
.../V4ProjectDashboard/V4ProjectProviders.tsx | 49 +++++++++++++++
.../v4/[chainName]/p/[projectId]/index.tsx | 61 ++++---------------
3 files changed, 62 insertions(+), 50 deletions(-)
create mode 100644 src/packages/v4/views/V4ProjectDashboard/V4ProjectProviders.tsx
diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectDashboard.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectDashboard.tsx
index 52880d268e..3bdfa54f86 100644
--- a/src/packages/v4/views/V4ProjectDashboard/V4ProjectDashboard.tsx
+++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectDashboard.tsx
@@ -11,7 +11,7 @@ import { useProjectPageQueries } from './hooks/useProjectPageQueries'
import { V4ProjectHeader } from './V4ProjectHeader'
import { V4ProjectTabs } from './V4ProjectTabs/V4ProjectTabs'
-export function V4ProjectDashboard() {
+export default function V4ProjectDashboard() {
const { projectPayReceipt } = useProjectPageQueries()
if (projectPayReceipt !== undefined) {
diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectProviders.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectProviders.tsx
new file mode 100644
index 0000000000..bd305f0437
--- /dev/null
+++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectProviders.tsx
@@ -0,0 +1,49 @@
+import { AppWrapper } from 'components/common/CoreAppWrapper/CoreAppWrapper'
+import { OPEN_IPFS_GATEWAY_HOSTNAME } from 'constants/ipfs'
+import { JBChainId, JBProjectProvider } from 'juice-sdk-react'
+import { ReduxProjectCartProvider } from 'packages/v4/components/ProjectDashboard/ReduxProjectCartProvider'
+import store from 'packages/v4/components/ProjectDashboard/redux/store'
+import { V4NftRewardsProvider } from 'packages/v4/contexts/V4NftRewards/V4NftRewardsProvider'
+import V4ProjectMetadataProvider from 'packages/v4/contexts/V4ProjectMetadataProvider'
+import { V4UserNftCreditsProvider } from 'packages/v4/contexts/V4UserNftCreditsProvider'
+import { V4UserTotalTokensBalanceProvider } from 'packages/v4/contexts/V4UserTotalTokensBalanceProvider'
+import { chainNameMap } from 'packages/v4/utils/networks'
+import { wagmiConfig } from 'packages/v4/wagmiConfig'
+import React, { PropsWithChildren } from 'react'
+import { Provider } from 'react-redux'
+import { WagmiProvider } from 'wagmi'
+
+const V4ProjectProviders: React.FC<
+ PropsWithChildren & { chainName: string; projectId: bigint }
+> = ({ chainName, projectId, children }) => {
+ const chainId = chainNameMap[chainName] as JBChainId
+
+ return (
+