Skip to content

Commit 4bf724d

Browse files
feat(web): new-stake-flow-v1
1 parent b23c968 commit 4bf724d

File tree

15 files changed

+937
-129
lines changed

15 files changed

+937
-129
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.48",
121-
"wagmi": "^2.13.0"
120+
"viem": "^2.21.54",
121+
"wagmi": "^2.13.3"
122122
}
123123
}
+1-1
Loading

web/src/components/ExternalLink.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Link } from "react-router-dom";
21
import styled from "styled-components";
32

3+
import { Link } from "react-router-dom";
4+
45
export const ExternalLink = styled(Link)`
56
:hover {
67
text-decoration: underline;

web/src/hooks/queries/useCourtDetails.ts

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const courtDetailsQuery = graphql(`
2323
paidPNK
2424
timesPerPeriod
2525
feeForJuror
26+
name
2627
}
2728
}
2829
`);

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

+9-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
import React, { useState, useMemo, useEffect } from "react";
22
import styled, { css } from "styled-components";
3-
import { landscapeStyle } from "styles/landscapeStyle";
43

54
import { useParams } from "react-router-dom";
65
import { useDebounce } from "react-use";
76
import { useAccount } from "wagmi";
87

98
import { REFETCH_INTERVAL } from "consts/index";
10-
119
import { useReadSortitionModuleGetJurorBalance, useReadPnkBalanceOf } from "hooks/contracts/generated";
1210
import { useParsedAmount } from "hooks/useParsedAmount";
13-
1411
import { commify, uncommify } from "utils/commify";
1512
import { formatPNK, roundNumberDown } from "utils/format";
1613
import { isUndefined } from "utils/index";
1714

15+
import { landscapeStyle } from "styles/landscapeStyle";
16+
1817
import { NumberInputField } from "components/NumberInputField";
18+
1919
import StakeWithdrawButton, { ActionType } from "./StakeWithdrawButton";
2020

2121
const StyledField = styled(NumberInputField)`
2222
height: fit-content;
23+
input {
24+
border-radius: 3px 0px 0px 3px;
25+
}
2326
`;
2427

2528
const LabelArea = styled.div`
@@ -62,26 +65,17 @@ const EnsureChainContainer = styled.div`
6265
button {
6366
height: 45px;
6467
border: 1px solid ${({ theme }) => theme.stroke};
68+
border-radius: 0px 3px 3px 0px;
6569
}
6670
`;
6771

6872
interface IInputDisplay {
6973
action: ActionType;
70-
isSending: boolean;
71-
setIsSending: (arg0: boolean) => void;
72-
setIsPopupOpen: (arg0: boolean) => void;
7374
amount: string;
7475
setAmount: (arg0: string) => void;
7576
}
7677

77-
const InputDisplay: React.FC<IInputDisplay> = ({
78-
action,
79-
isSending,
80-
setIsSending,
81-
setIsPopupOpen,
82-
amount,
83-
setAmount,
84-
}) => {
78+
const InputDisplay: React.FC<IInputDisplay> = ({ action, amount, setAmount }) => {
8579
const [debouncedAmount, setDebouncedAmount] = useState("");
8680
const [errorMsg, setErrorMsg] = useState<string | undefined>();
8781
useDebounce(() => setDebouncedAmount(amount), 500, [amount]);
@@ -147,12 +141,10 @@ const InputDisplay: React.FC<IInputDisplay> = ({
147141
<EnsureChainContainer>
148142
<StakeWithdrawButton
149143
{...{
144+
amount,
150145
parsedAmount,
151146
action,
152147
setAmount,
153-
isSending,
154-
setIsSending,
155-
setIsPopupOpen,
156148
setErrorMsg,
157149
}}
158150
/>

web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/QuantityToSimulate.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import styled from "styled-components";
3+
34
import Skeleton from "react-loading-skeleton";
45

56
import { commify } from "utils/commify";
@@ -13,6 +14,7 @@ const Container = styled.div`
1314
align-items: center;
1415
flex-wrap: wrap;
1516
gap: 0 8px;
17+
justify-content: center;
1618
`;
1719

1820
const TextWithTooltipContainer = styled.div`
@@ -48,13 +50,15 @@ interface IQuantityToSimulate {
4850
jurorCurrentSpecificStake: number | undefined;
4951
isStaking: boolean;
5052
amountToStake: number;
53+
className?: string;
5154
}
5255

5356
const QuantityToSimulate: React.FC<IQuantityToSimulate> = ({
5457
isStaking,
5558
jurorCurrentEffectiveStake,
5659
jurorCurrentSpecificStake,
5760
amountToStake,
61+
className,
5862
}) => {
5963
const effectiveStakeDisplay = !isUndefined(jurorCurrentEffectiveStake) ? (
6064
`${commify(jurorCurrentEffectiveStake)} PNK`
@@ -85,7 +89,7 @@ const QuantityToSimulate: React.FC<IQuantityToSimulate> = ({
8589
);
8690

8791
return (
88-
<Container>
92+
<Container {...{ className }}>
8993
<Quantity>{effectiveStakeDisplay}</Quantity>
9094
<TextWithTooltipContainer>
9195
<WithHelpTooltip

0 commit comments

Comments
 (0)