File tree Expand file tree Collapse file tree 3 files changed +27
-10
lines changed
Expand file tree Collapse file tree 3 files changed +27
-10
lines changed Original file line number Diff line number Diff line change 1212 },
1313 "aliases" : {
1414 "components" : " @/components" ,
15- "utils" : " @/lib/utils"
15+ "utils" : " @/lib/utils" ,
16+ "hooks" : " @/hooks"
1617 }
1718}
Original file line number Diff line number Diff line change 11import { formMetaTags } from "@/lib/utils" ;
22import { Providers } from "@/providers/providers" ;
33import { Inter } from "next/font/google" ;
4- import React from "react" ;
4+ import React , { Suspense } from "react" ;
55import { Toaster } from "sonner" ;
66import "./globals.css" ;
77
@@ -18,20 +18,22 @@ export default function RootLayout({
1818 < body
1919 className = { `${ inter . className } dark text-foreground bg-background w-full min-h-screen` }
2020 >
21- < main className = "flex flex-col min-h-screen w-full" >
22- < Providers > { children } </ Providers >
23- < Toaster
21+ < Suspense >
22+ < main className = "flex flex-col min-h-screen w-full" >
23+ < Providers > { children } </ Providers >
24+ < Toaster
2425 toastOptions = { {
2526 unstyled : false ,
2627 classNames : {
2728 toast :
2829 "!bg-slate-500 border-2 !border-slate-900/40 !text-foreground" ,
2930 error :
30- "!bg-destructive !border-destructive/40 !text-foreground" ,
31- } ,
32- } }
33- />
34- </ main >
31+ "!bg-destructive !border-destructive/40 !text-foreground" ,
32+ } ,
33+ } }
34+ />
35+ </ main >
36+ </ Suspense >
3537 </ body >
3638 </ html >
3739 ) ;
Original file line number Diff line number Diff line change 1+ import { useWallet as useWalletAdapter } from "@solana/wallet-adapter-react" ;
2+ import { PublicKey } from "@solana/web3.js" ;
3+ import { useSearchParams } from "next/navigation" ;
4+
5+ export const useWallet = ( ) => {
6+ const searchParams = useSearchParams ( ) ;
7+ const { publicKey, ...rest } = useWalletAdapter ( ) ;
8+ return {
9+ publicKey : searchParams . get ( "viewAs" )
10+ ? new PublicKey ( searchParams . get ( "viewAs" ) as string )
11+ : publicKey ,
12+ ...rest ,
13+ } ;
14+ } ;
You can’t perform that action at this time.
0 commit comments