41 | {/* userInfoSection */}
42 |
43 | {/* User Avatar from ENS */}
44 |
45 | {identity.avatar ? (
46 |
54 |
61 |
62 | ) : (
63 |
71 |
78 |
79 | )}
80 | {address && address !== selectAddress && (
81 |
89 | )}
90 |
91 | {/* User Name from ENS or therir address*/}
92 |
93 | {identity.ens ? (
94 |
101 | {identity.ens}
102 |
103 | ) : (
104 |
105 | )}
106 |
111 | {identity?.address}
112 |
113 |
114 |
115 | {/* Following & Followers Section */}
116 |
117 |
118 | [
127 | setListType(false), //sets list modal to show followers
128 | setShowList(true),
129 | ]}
130 | >
131 | {identity.followerCount}
132 |
133 | Followers
134 |
135 |
136 | [
145 | setListType(true), //sets list modal to show following
146 | setShowList(true),
147 | ]}
148 | >
149 | {identity.followingCount}
150 |
151 | Following
152 |
153 |
154 |
155 | {/* POAPs and NFTs */}
156 |
157 |
158 | {/*Follower/followings list*/}
159 |
165 |
166 | {/* Social Section */}
167 |
168 |
169 | External Links
170 |
171 |
253 |
254 | {/* Explore me button */}
255 |
256 |
setGraphAddress(selectAddress)}
260 | sx={{
261 | ":hover": {
262 | bgcolor: "#555",
263 | },
264 | fontFamily: "Outfit",
265 | }}
266 | >
267 | EXPLORE THIS ADDRESS!
268 |
269 |
270 | >
271 | );
272 | };
273 |
274 | UserPanel.displayName = "UserPanel";
275 |
--------------------------------------------------------------------------------
/src/components/WalletConnectButton/index.module.css:
--------------------------------------------------------------------------------
1 | /* src\components\WalletConnectButton\index.module.css */
2 | .walletInfo {
3 | font-weight: bold;
4 | padding: 1rem;
5 | color: white;
6 | text-align: center;
7 | display: flex;
8 | align-items: center;
9 | }
10 |
11 | .connectWalletButton {
12 | background-color: #fff;
13 | border-radius: 20px;
14 | box-sizing: border-box;
15 | color: #000;
16 | font-size: 16px;
17 | font-weight: 600;
18 | padding: 16px 36px;
19 | text-align: center;
20 | transition: all 300ms cubic-bezier(0.23, 1, 0.32, 1);
21 | width: 250px;
22 | box-sizing: border-box;
23 | border: 2px solid white;
24 | font-family: "Outfit";
25 | }
26 |
27 | .connectWalletButton:hover {
28 | transform: translateY(-2px);
29 | color: #ffffff;
30 | background-color: rgb(0, 0, 0);
31 | }
32 |
--------------------------------------------------------------------------------
/src/components/WalletConnectButton/index.tsx:
--------------------------------------------------------------------------------
1 | //src\components\WalletConnectButton\index.tsx
2 |
3 | import { useWeb3 } from "@/context/web3Context";
4 | import { formatAddress } from "@/utils/helper";
5 | import LoadingButton from "@mui/lab/LoadingButton";
6 | import { useCallback, useState } from "react";
7 | import styles from "./index.module.css";
8 |
9 | export const WalletConnectButton: React.FC = () => {
10 | //get user logged in wallet address/ens, get connect wallet function
11 | const { connectWallet, address, ens } = useWeb3();
12 |
13 | const [loading, setLoading] = useState