File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { TheaProvider } from "@orderbook/core/providers " ;
3+ import dynamic from "next/dynamic " ;
44import { useSearchParams } from "next/navigation" ;
55import { ReactNode } from "react" ;
66
7+ const TheaLayout = dynamic (
8+ ( ) => import ( "@/components/thea/TheaLayout" ) . then ( ( mod ) => mod . TheaLayout ) ,
9+ { ssr : false }
10+ ) ;
11+
712export default function Layout ( { children } : { children : ReactNode } ) {
813 const params = useSearchParams ( ) ;
914 const assetTicker = params . get ( "asset" ) ;
1015 const sourceName = params . get ( "from" ) ;
1116 const destinationName = params . get ( "to" ) ;
1217
1318 return (
14- < TheaProvider
19+ < TheaLayout
1520 initialAssetTicker = { assetTicker }
1621 initialSourceName = { sourceName }
1722 initialDestinationName = { destinationName }
1823 >
1924 { children }
20- </ TheaProvider >
25+ </ TheaLayout >
2126 ) ;
2227}
Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import { TheaProvider } from "@orderbook/core/providers" ;
4+ import { ReactNode } from "react" ;
5+
6+ export function TheaLayout ( {
7+ children,
8+ initialAssetTicker,
9+ initialSourceName,
10+ initialDestinationName,
11+ } : {
12+ children : ReactNode ;
13+ initialAssetTicker : string | null ;
14+ initialSourceName : string | null ;
15+ initialDestinationName : string | null ;
16+ } ) {
17+ return (
18+ < TheaProvider
19+ initialAssetTicker = { initialAssetTicker }
20+ initialSourceName = { initialSourceName }
21+ initialDestinationName = { initialDestinationName }
22+ >
23+ { children }
24+ </ TheaProvider >
25+ ) ;
26+ }
You can’t perform that action at this time.
0 commit comments