Skip to content

Commit b8fb0b0

Browse files
authored
Merge pull request #106 from api3dao/wallet-event-misc
fix: miscellaneous wallet event and other details
2 parents 2167a58 + 67f9ef4 commit b8fb0b0

File tree

3 files changed

+16
-46
lines changed

3 files changed

+16
-46
lines changed

components/MemberClassification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const badges = [
4444
{
4545
name: "unstaking",
4646
className: "bg-color-panel-title text-color-body",
47-
title: "Member is unstaking his shares",
47+
title: "Member is unstaking their shares",
4848
},
4949
/* {
5050
name: "deposited",

components/WalletDelegation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const WalletDelegation = (props: IWalletDelegationProps) => {
8181
{to.length > 0 ? (
8282
<div className="text-color-panel-title">
8383
<h2 className="text-sm lg:text-xl font-bold text-center">
84-
This member is delegated{" "}
84+
This member is delegated to{" "}
8585
{" by "}
8686
{toNZ.length} members
8787
</h2>

components/WalletEvents.tsx

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,9 @@ const EventDetails = (props: IEventDetails) => {
264264
);
265265
}
266266
case "UpdatedDelegation": {
267-
// from, to, delta, shares, total
268267
const from: string = props.data[0];
269268
const to: string = props.data[1];
270-
const delta = props.data[2];
269+
const increasedDelegation: boolean = props.data[2];
271270
const shares = noDecimals(
272271
withDecimals(ethers.BigNumber.from(props.data[3]).toString(), 18)
273272
);
@@ -276,22 +275,19 @@ const EventDetails = (props: IEventDetails) => {
276275
);
277276
return (
278277
<div className="text-xs darken leading-4">
278+
<span className="text-color-panel-title">{toCurrency(shares)}</span>{" "}
279+
{increasedDelegation ? "more" : "fewer"}{" "}
279280
{from.replace("0x", "").toLowerCase() === thisWallet
280-
? " to "
281-
: " from "}{" "}
281+
? "to"
282+
: "from"}{" "}
282283
<InternalAddress
283284
className="text-xs"
284285
inline={true}
285286
address={
286287
from.replace("0x", "").toLowerCase() === thisWallet ? to : from
287288
}
288-
/>{" "}
289-
<span className="text-color-panel-title">{toCurrency(shares)}</span>.
289+
/>{". "}
290290
<span className={props.wide ? "ml-1" : "block"}>
291-
Delta:{" "}
292-
<span className="text-color-panel-title">
293-
{JSON.stringify(delta)}
294-
</span>{" "}
295291
Total:{" "}
296292
<span className="text-color-panel-title">{toCurrency(total)}</span>{" "}
297293
</span>
@@ -305,20 +301,15 @@ const EventDetails = (props: IEventDetails) => {
305301
const shares = noDecimals(
306302
withDecimals(ethers.BigNumber.from(props.data[2]).toString(), 18)
307303
);
308-
const total = noDecimals(
309-
withDecimals(ethers.BigNumber.from(props.data[3]).toString(), 18)
310-
);
311304
return (
312305
<div className="text-xs darken leading-4">
313-
{from === thisWallet ? " to " : " from "}{" "}
306+
<span className="text-color-panel-title">{toCurrency(shares)}</span>{" "}
307+
{from === thisWallet ? "to" : "from"}{" "}
314308
<InternalAddress
315309
className="text-xs"
316310
inline={true}
317311
address={from === thisWallet ? to : from}
318-
/>{" "}
319-
<span className="text-color-panel-title">{toCurrency(shares)}</span>
320-
. Total:{" "}
321-
<span className="text-color-panel-title">{toCurrency(total)}</span>{" "}
312+
/>
322313
</div>
323314
);
324315
}
@@ -380,27 +371,14 @@ const EventDetails = (props: IEventDetails) => {
380371
const userUnstaked = noDecimals(
381372
withDecimals(ethers.BigNumber.from(props.data[2]).toString(), 18)
382373
);
383-
const totalShares = noDecimals(
384-
withDecimals(ethers.BigNumber.from(props.data[3]).toString(), 18)
385-
);
386-
const totalStake = noDecimals(
387-
withDecimals(ethers.BigNumber.from(props.data[4]).toString(), 18)
388-
);
389374
return (
390375
<div className="text-xs darken leading-4">
391376
<span className="text-color-panel-title">{toCurrency(amount)}</span>{" "}
392-
tokens. Unstaked{" "}
377+
tokens. Total being unstaked{" "}
393378
<span className="text-color-panel-title">
394379
{toCurrency(userUnstaked)}
395380
</span>{" "}
396-
tokens. Total:{" "}
397-
<span className="text-color-panel-title">
398-
{toCurrency(totalStake)}
399-
</span>{" "}
400-
stake,{" "}
401-
<span className="text-color-panel-title">
402-
{toCurrency(totalShares)}
403-
</span>{". "}
381+
tokens.
404382
</div>
405383
);
406384
}
@@ -414,23 +392,15 @@ const EventDetails = (props: IEventDetails) => {
414392
);
415393
const tm = Number.parseInt(ethers.BigNumber.from(props.data[3]).toString());
416394
const dt = new Date(tm * 1000);
417-
const userShares = noDecimals(
418-
withDecimals(ethers.BigNumber.from(props.data[4]).toString(), 18)
419-
);
420395
return (
421396
<div className="text-xs darken leading-4">
422397
<span className="text-color-panel-title">{toCurrency(amount)}</span>{" "}
423398
tokens,{" "}
424-
<span className="text-color-panel-title">{toCurrency(shares)}</span>{". "}
399+
<span className="text-color-panel-title">{toCurrency(shares)}</span>{" "}
400+
voting power{". "}
425401
Scheduled for{" "}
426402
<span className="text-color-panel-title">
427403
{niceDateTime(dt.toISOString())}
428-
</span>{" "}
429-
<span className={props.wide ? "ml-1" : "block"}>
430-
User:{" "}
431-
<span className="text-color-panel-title">
432-
{toCurrency(userShares)}
433-
</span>{" "}
434404
</span>
435405
</div>
436406
);
@@ -530,7 +500,7 @@ const EventDetails = (props: IEventDetails) => {
530500
<span className="text-color-panel-title">
531501
{noDecimals(toCurrency(amount))}
532502
</span>{" "}
533-
tokens,
503+
tokens,{" "}
534504
<span className="text-color-panel-title">
535505
{noDecimals(toCurrency(userUnstaked))}
536506
</span>{" "}

0 commit comments

Comments
 (0)