Skip to content

Commit d5c9c27

Browse files
refactor(web): downgrade-viem-and-sonar-feedback
1 parent 4bf724d commit d5c9c27

File tree

5 files changed

+12
-247
lines changed

5 files changed

+12
-247
lines changed

web/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"react-toastify": "^9.1.3",
118118
"react-use": "^17.5.1",
119119
"styled-components": "^5.3.3",
120-
"viem": "^2.21.54",
121-
"wagmi": "^2.13.3"
120+
"viem": "^2.21.48",
121+
"wagmi": "^2.13.0"
122122
}
123123
}

web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ const StakeWithdrawButton: React.FC<IActionButton> = ({ amount, parsedAmount, ac
145145
isWithdraw ? StakeSteps.WithdrawInitiate : StakeSteps.StakeInitiate,
146146
amount,
147147
theme,
148-
approvalHash,
149-
undefined
148+
approvalHash
150149
),
151150
current: 1,
152151
});

web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawPopup/Header.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useMemo } from "react";
22
import styled from "styled-components";
33

44
import { useParams } from "react-router-dom";
@@ -64,14 +64,11 @@ const Header: React.FC<IHeader> = ({ action, amount, isSuccess }) => {
6464
const jurorCurrentSpecificStake = address && jurorStakeData ? Number(formatEther(jurorStakeData.staked)) : 0;
6565

6666
const isWithdraw = action === ActionType.withdraw;
67+
const actionText = useMemo(() => (isWithdraw ? "withdrew" : "staked"), [isWithdraw]);
6768
return (
6869
<StakingMsgContainer>
6970
{isSuccess ? <CheckIcon /> : null}
70-
<StakingMsg>
71-
{isSuccess
72-
? `You successfully ${isWithdraw ? "withdrew" : "staked"}`
73-
: `You are ${isWithdraw ? "withdrawing" : "staking"}`}
74-
</StakingMsg>
71+
<StakingMsg>{isSuccess ? `You successfully ${actionText}` : `You are ${actionText}`}</StakingMsg>
7572
<StakingAmount>{amount} PNK</StakingAmount>
7673
{courtDetails?.court?.name ? <CourtName>on {courtDetails.court.name}</CourtName> : null}
7774
{isSuccess ? null : (

web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawPopup/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const StakeWithdrawPopup: React.FC<IStakeWithdrawPopup> = ({ amount, closePopup,
8989
<InnerContainer>
9090
<Header {...{ amount, isSuccess, action }} />
9191
<Divider />
92-
{steps && steps.items && <CustomTimeline items={steps.items} />}
92+
{steps?.items && <CustomTimeline items={steps.items} />}
9393
</InnerContainer>
9494
</Container>
9595
</Overlay>

0 commit comments

Comments
 (0)