@@ -10,21 +10,23 @@ import { useRouter } from "next/router";
1010import { getAddressforChain } from "../../store/actions/wallet" ;
1111
1212function WalletInfo ( props ) {
13- const [ balance , setBalance ] = useState ( 0 ) ;
13+ const [ totalBalance , setTotalBalance ] = useState ( 0 ) ;
14+ const [ tokenBalances , setTokenBalances ] = useState ( { } ) ;
1415 const router = useRouter ( ) ;
1516 useEffect ( ( ) => {
1617 async function getWalletbalance ( ) {
17- let balance = await getBalanceInDollars ( props . selectedAddress ) ;
18- if ( balance ) {
19- setBalance ( balance ) ;
18+ let a = await getBalanceInDollars ( props . selectedAddress ) ;
19+ if ( a ) {
20+ setTotalBalance ( a . totalPrice ) ;
21+ setTokenBalances ( a . TokenBalances ) ;
2022 }
2123 }
2224 getWalletbalance ( ) ;
23- } ) ;
25+ } , [ ] ) ;
2426
2527 return (
2628 < div className = "w-96 p-4 flex flex-col bg-[#28313C] rounded-2xl" >
27- < div className = "px-2 flex" >
29+ < div className = "flex" >
2830 < div className = "text-type-primary text-xs font-bold uppercase" >
2931 Account
3032 </ div >
@@ -80,8 +82,8 @@ function WalletInfo(props) {
8082 </ div >
8183 </ div >
8284 </ div >
83- < div className = "mt-2 box-content px-2 " >
84- < div className = "mt-1 box-content h-24 w-full border border-[#404450] rounded-xl flex items-center" >
85+ < div className = "mt-2 box-content" >
86+ < div className = "mt-1 box-content h-20 w-full border border-grey-50 rounded-xl flex items-center" >
8587 < svg
8688 width = "36"
8789 height = "37"
@@ -112,29 +114,76 @@ function WalletInfo(props) {
112114 />
113115 </ svg >
114116 < div className = "text-sm text-type-primary ml-4" > Total Balance</ div >
115- < div className = "text-type-primary text-2xl font-bold ml-6 " >
116- ≈ $ { balance }
117+ < div className = "text-type-primary text-2xl font-bold mx-6 text-right flex-1 " >
118+ $ { totalBalance }
117119 </ div >
118120 </ div >
119121 < div className = "text-type-primary text-xs font-bold uppercase mt-6 mb-4" >
120122 Tokens
121123 </ div >
124+ < div className = "flex p-3 box-content bg-grey-50 rounded-xl mb-3 items-center justify-center text-sm group" >
125+ < div className = "flex-none" >
126+ < img width = { 24 } src = { "/tokens/gitopia.svg" } />
127+ </ div >
128+ < div className = "mx-3 flex-1" > { "Gitopia" } </ div >
129+
130+ < div className = "" >
131+ { props . loreBalance +
132+ " " +
133+ process . env . NEXT_PUBLIC_ADVANCE_CURRENCY_TOKEN }
134+ </ div >
135+
136+ < div className = "flex transition-all items-center cursor-pointer text-type-secondary opacity-0 w-0 group-hover:opacity-100 group-hover:w-8 group-hover:ml-3" >
137+ < div
138+ className = "btn btn-circle btn-sm btn-outline tooltip tooltip-bottom tooltip-secondary"
139+ data-tip = "Send"
140+ onClick = { ( ) => {
141+ props . setMenuState ( 3 ) ;
142+ } }
143+ >
144+ < svg
145+ width = "32"
146+ height = "32"
147+ viewBox = "0 0 34 34"
148+ fill = "none"
149+ xmlns = "http://www.w3.org/2000/svg"
150+ >
151+ < g >
152+ < path
153+ d = "M10.5757 20.5757L10.1515 21L11 21.8485L11.4243 21.4243L10.5757 20.5757ZM21.4243 11.4243C21.6586 11.1899 21.6586 10.8101 21.4243 10.5757C21.1899 10.3414 20.8101 10.3414 20.5757 10.5757L21.4243 11.4243ZM11.4243 21.4243L21.4243 11.4243L20.5757 10.5757L10.5757 20.5757L11.4243 21.4243Z"
154+ fill = "currentColor"
155+ />
156+ < path
157+ d = "M12.875 11H21V19.125"
158+ stroke = "currentColor"
159+ strokeWidth = "1.2"
160+ strokeLinecap = "square"
161+ strokeLinejoin = "round"
162+ />
163+ </ g >
164+ </ svg >
165+ </ div >
166+ </ div >
167+ </ div >
122168 { assets . map ( ( asset , index ) => {
123169 return (
124170 < div
125- className = "flex p-3 box-content h-7 bg-white bg-opacity-10 rounded-xl flex mb-3"
171+ className = "flex p-3 box-content bg-grey-50 rounded-xl mb-3 items-center justify-center text-sm group "
126172 key = { index }
127173 >
128174 < div className = "" >
129- < img src = { asset . icon } />
175+ < img width = { 24 } src = { asset . icon } />
130176 </ div >
131- < div className = "ml-3" > { asset . chain_name } </ div >
132- < div className = "ml-auto flex mr-3" >
133- < div className = "text-type-primary text-xs mr-2 mt-1.5" >
134- Deposit
135- </ div >
177+ < div className = "mx-3 flex-1" > { asset . chain_name } </ div >
178+ < div className = "" >
179+ { ( tokenBalances [ asset . coin_minimal_denom ] || 0 ) +
180+ " " +
181+ asset . coin_minimal_denom }
182+ </ div >
183+ < div className = "flex transition-all items-center cursor-pointer text-type-secondary opacity-0 w-0 group-hover:opacity-100 group-hover:w-20 group-hover:ml-3" >
136184 < div
137- className = "mr-1 hover:cursor-pointer"
185+ className = "btn btn-circle btn-sm btn-outline mr-3 tooltip tooltip-bottom tooltip-secondary"
186+ data-tip = "Deposit"
138187 onClick = { ( ) => {
139188 props
140189 . getAddressforChain (
@@ -150,62 +199,39 @@ function WalletInfo(props) {
150199 < svg
151200 width = "32"
152201 height = "32"
153- viewBox = "0 0 32 32 "
202+ viewBox = "0 0 34 34 "
154203 fill = "none"
155204 xmlns = "http://www.w3.org/2000/svg"
156205 >
157- < g clipPath = "url(#clip0_22_357)" >
206+ < g >
158207 < path
159208 d = "M16 8.5V20.375"
160- stroke = "white "
209+ stroke = "currentColor "
161210 strokeWidth = "1.2"
162211 strokeLinecap = "round"
163212 strokeLinejoin = "round"
164213 />
165214 < path
166215 d = "M10.375 14.75L16 20.375L21.625 14.75"
167- stroke = "white "
216+ stroke = "currentColor "
168217 strokeWidth = "1.2"
169218 strokeLinecap = "square"
170219 strokeLinejoin = "round"
171220 />
172221 < path
173222 d = "M9.125 22.875H22.875"
174- stroke = "white "
223+ stroke = "currentColor "
175224 strokeWidth = "1.2"
176225 strokeLinecap = "square"
177226 strokeLinejoin = "round"
178227 />
179228 </ g >
180- < rect
181- x = "0.5"
182- y = "0.5"
183- width = "31"
184- height = "31"
185- rx = "15.5"
186- stroke = "white"
187- strokeOpacity = "0.2"
188- />
189- < defs >
190- < clipPath id = "clip0_22_357" >
191- < rect
192- width = "20"
193- height = "20"
194- fill = "white"
195- transform = "translate(6 6)"
196- />
197- </ clipPath >
198- </ defs >
199229 </ svg >
200230 </ div >
201- </ div >
202- < div className = "border-l-2 border-[#5A6068] h-8" > </ div >
203- < div className = "ml-3 flex" >
204- < div className = "text-type-primary text-xs mr-2 mt-1.5" >
205- Withdraw
206- </ div >
231+
207232 < div
208- className = "hover:cursor-pointer"
233+ className = "btn btn-circle btn-sm btn-outline tooltip tooltip-bottom tooltip-secondary"
234+ data-tip = "Withdraw"
209235 onClick = { ( ) => {
210236 props
211237 . getAddressforChain (
@@ -221,57 +247,37 @@ function WalletInfo(props) {
221247 < svg
222248 width = "32"
223249 height = "32"
224- viewBox = "0 0 32 32 "
250+ viewBox = "0 0 34 34 "
225251 fill = "none"
226252 xmlns = "http://www.w3.org/2000/svg"
227253 >
228- < g clipPath = "url(#clip0_22_365)" >
254+ < g >
229255 < path
230256 d = "M10.5757 20.5757L10.1515 21L11 21.8485L11.4243 21.4243L10.5757 20.5757ZM21.4243 11.4243C21.6586 11.1899 21.6586 10.8101 21.4243 10.5757C21.1899 10.3414 20.8101 10.3414 20.5757 10.5757L21.4243 11.4243ZM11.4243 21.4243L21.4243 11.4243L20.5757 10.5757L10.5757 20.5757L11.4243 21.4243Z"
231- fill = "white "
257+ fill = "currentColor "
232258 />
233259 < path
234260 d = "M12.875 11H21V19.125"
235- stroke = "white "
261+ stroke = "currentColor "
236262 strokeWidth = "1.2"
237263 strokeLinecap = "square"
238264 strokeLinejoin = "round"
239265 />
240266 </ g >
241- < rect
242- x = "0.5"
243- y = "0.5"
244- width = "31"
245- height = "31"
246- rx = "15.5"
247- stroke = "white"
248- strokeOpacity = "0.2"
249- />
250- < defs >
251- < clipPath id = "clip0_22_365" >
252- < rect
253- width = "20"
254- height = "20"
255- fill = "white"
256- transform = "translate(6 6)"
257- />
258- </ clipPath >
259- </ defs >
260267 </ svg >
261268 </ div >
262269 </ div >
263270 </ div >
264271 ) ;
265272 } ) }
266- < div className = "mt-10 border-b border-[#3E4051] w-[21rem]" > </ div >
267- < div className = "text-type-primary text-xs font-bold uppercase mt-2 mb-2" >
273+ < div className = "text-type-primary text-xs font-bold uppercase mt-6 mb-4" >
268274 LORE REWARDS
269275 </ div >
270- < div className = "mt-1 p-4 bg-grey box-content h-14 rounded-lg flex" >
271- < div className = "mt-1 border border-[#747D96] h-8 w-8 rounded-full" >
276+ < div className = "mt-1 p-4 box-content h-14 rounded-lg flex bg-rewards-grad " >
277+ < div className = "mt-1 border border-grey-300 h-8 w-8 rounded-full flex items-center justify-center " >
272278 < svg
273279 width = "11"
274- height = "21 "
280+ height = "18 "
275281 viewBox = "0 0 11 21"
276282 fill = "none"
277283 xmlns = "http://www.w3.org/2000/svg"
@@ -296,15 +302,15 @@ function WalletInfo(props) {
296302 />
297303 </ svg >
298304 </ div >
299- < div className = "ml-2" >
305+ < div className = "ml-2 flex-1 " >
300306 < div className = "font-semibold text-3xl" > 0</ div >
301- < div className = "font-bold text-xs" > ≈$0.0</ div >
307+ < div className = "font-bold text-xs text-type-tertiary " > ≈ $0.0</ div >
302308 </ div >
303309 < div
304310 disabled = { true }
305- className = "btn mt-4 ml-auto h-8 px-3.5 py-2 w-36 rounded text-white text-xs font-bold bg-green active:bg-green hover:bg-green-400 hover:shadow-lg outline-none focus:outline-none ease-linear transition-all duration-150 uppercase "
311+ className = "btn btn-primary btn-sm mt-3 "
306312 >
307- claim rewards
313+ Claim Rewards
308314 </ div >
309315 </ div >
310316 </ div >
0 commit comments