@@ -4,16 +4,14 @@ import { useRouter } from "next/navigation";
4
4
import { useAccount , useEnsName } from "wagmi" ;
5
5
import { mainnet } from "wagmi/chains" ;
6
6
7
- import { Input } from "@/components/ui/input" ;
8
7
import { Label } from "@/components/ui/label" ;
9
8
9
+ import { Alert , AlertDescription } from "@/components/ui/alert" ;
10
10
import { Separator } from "@/components/ui/separator" ;
11
- import { useWeb3Modal } from "@web3modal/wagmi/react" ;
12
11
import { useEffect } from "react" ;
13
12
14
13
const UserInfo = ( ) => {
15
- const { open } = useWeb3Modal ( ) ;
16
- const { address, isConnected, isConnecting, isDisconnected } = useAccount ( ) ;
14
+ const { address, isConnected } = useAccount ( ) ;
17
15
const router = useRouter ( ) ;
18
16
const { data : ensName } = useEnsName ( {
19
17
chainId : mainnet . id ,
@@ -27,44 +25,33 @@ const UserInfo = () => {
27
25
}
28
26
} , [ isConnected , router ] ) ;
29
27
30
- // * Commented out the code to add the ability to connect wallet from this page
31
- // if (isConnecting) return <div>Connecting…</div>;
32
- // if (isDisconnected)
33
- // return (
34
- // <section className="h-40 w-full flex justify-center items-center">
35
- // <Button onClick={() => open()}>Connect Wallet</Button>
36
- // </section>
37
- // );
38
28
return (
39
29
< >
40
30
< section className = "flex flex-col gap-4 md:gap-0" >
41
- < h2 className = "text-xl md:text-2xl font-semibold md:py-6" > Profile </ h2 >
31
+ < h2 className = "text-xl md:text-2xl font-semibold md:py-6" > Account </ h2 >
42
32
< div className = "flex flex-col gap-2 md:col-start-1 md:col-span-2 md:mt-2" >
43
33
< Label htmlFor = "displayName" > Display Name</ Label >
44
- < Input
45
- className = "mb-0"
46
- type = "displayName"
47
- placeholder = { ensName ? ensName : "Voice Deck" }
48
- // disabled={ensName ? true : false}
49
- disabled = { true }
50
- />
51
- < small className = "text-xs" >
52
- We'll use your ENS name if you have one or you can set your own in
53
- the future.
34
+
35
+ < Alert className = "bg-vd-beige-300 max-w-md" >
36
+ < AlertDescription className = "truncate" >
37
+ { ensName ? ensName : "No ENS name found" }
38
+ </ AlertDescription >
39
+ </ Alert >
40
+ < small className = "text-sm" >
41
+ We'll use your ENS name if you have one.
54
42
</ small >
55
43
</ div >
56
- < h2 className = "text-xl md:text-2xl font-semibold md: py-6" > Account </ h2 >
44
+ < div className = "py-4" / >
57
45
< div className = "flex flex-col gap-2 md:col-start-1 md:col-span-2 md:mt-2" >
58
46
< Label htmlFor = "address" > Wallet Address</ Label >
59
- < Input
60
- className = "disabled:bg-vd-blue-300"
61
- type = "address"
62
- placeholder = "Address"
63
- value = { address }
64
- disabled
65
- />
66
- < small className = "text-xs" >
67
- Where you fund will be store on the blockchain.
47
+ < Alert className = "bg-vd-beige-300 max-w-md" >
48
+ < AlertDescription className = "truncate" >
49
+ { address ? address : "No address found" }
50
+ </ AlertDescription >
51
+ </ Alert >
52
+
53
+ < small className = "text-sm" >
54
+ Your funds are stored on the blockchain here.
68
55
</ small >
69
56
</ div >
70
57
</ section >
0 commit comments