Skip to content

Commit 18766cd

Browse files
kemurujaybuidl
authored andcommitted
chore(web): minor adjustments
1 parent d31c249 commit 18766cd

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

web/src/components/NumberInputField.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ interface INumberInputField {
2020
formatter?: (value: string) => string;
2121
}
2222

23-
export const NumberInputField: React.FunctionComponent<INumberInputField> = ({
24-
placeholder,
25-
message,
26-
value,
27-
onChange,
28-
formatter,
29-
}) => {
23+
export const NumberInputField: React.FC<INumberInputField> = ({ placeholder, message, value, onChange, formatter }) => {
3024
const [isEditing, setIsEditing] = useState(false);
3125

3226
const toggleEditing = () => {
@@ -40,7 +34,7 @@ export const NumberInputField: React.FunctionComponent<INumberInputField> = ({
4034
type="number"
4135
value={value}
4236
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
43-
onChange && onChange(event.target.value);
37+
onChange?.(event.target.value);
4438
}}
4539
placeholder={placeholder}
4640
message={message}

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState } from "react";
22
import styled from "styled-components";
33
import { useParams } from "react-router-dom";
4-
import { formatEther } from "viem";
54
import { useDebounce } from "react-use";
65
import { useAccount } from "wagmi";
76
import { NumberInputField } from "components/NumberInputField";
@@ -96,10 +95,11 @@ const InputDisplay: React.FC<IInputDisplay> = ({
9695
placeholder={isStaking ? "Amount to stake" : "Amount to withdraw"}
9796
message={
9897
isStaking
99-
? `You need to stake at least ${formatEther(courtDetails?.court.minStake ?? 0n)} PNK. ` +
98+
? `You need to stake at least ${formatPNK(courtDetails?.court.minStake ?? 0n, 3)} PNK. ` +
10099
"You may need two transactions, one to increase allowance, the other to stake."
101-
: `You need to either withdraw all or keep at least ${formatEther(
102-
courtDetails?.court.minStake ?? 0n
100+
: `You need to either withdraw all or keep at least ${formatPNK(
101+
courtDetails?.court.minStake ?? 0n,
102+
3
103103
)} PNK.`
104104
}
105105
formatter={(number: string) => commify(roundNumberDown(Number(number)))}

0 commit comments

Comments
 (0)