File tree 4 files changed +15
-5
lines changed
ActiveStakingStep/StakeFormModal
ActiveUnstakingStep/UnstakeFormModal
4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ function StakeFormModal({
20
20
tokenBalance = { tokenBalance }
21
21
minTokenAmount = { minDepositAmount }
22
22
onSubmitForm = { onSubmitForm }
23
+ withMaxButton = { false }
23
24
>
24
25
< StakeDetails currency = "bitcoin" />
25
26
< FormSubmitButton mt = { 10 } > Stake</ FormSubmitButton >
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ function UnstakeFormModal({
20
20
tokenBalance = { balance }
21
21
minTokenAmount = { minTokenAmount }
22
22
onSubmitForm = { onSubmitForm }
23
+ withMaxButton
23
24
>
24
25
< UnstakeDetails balance = { balance } currency = "bitcoin" />
25
26
< FormSubmitButton mt = { 10 } > Withdraw</ FormSubmitButton >
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export type TokenAmountFormBaseProps = {
25
25
tokenBalance : bigint
26
26
tokenBalanceInputPlaceholder : string
27
27
currency : CurrencyType
28
+ withMaxButton : boolean
28
29
fiatCurrency ?: CurrencyType
29
30
children ?: React . ReactNode
30
31
}
@@ -35,6 +36,7 @@ export default function TokenAmountFormBase({
35
36
currency,
36
37
fiatCurrency,
37
38
tokenBalanceInputPlaceholder,
39
+ withMaxButton,
38
40
children,
39
41
...formikProps
40
42
} : TokenAmountFormBaseProps & FormikProps < TokenAmountFormValues > ) {
@@ -46,6 +48,7 @@ export default function TokenAmountFormBase({
46
48
placeholder = { tokenBalanceInputPlaceholder }
47
49
currency = { currency }
48
50
fiatCurrency = { fiatCurrency }
51
+ withMaxButton = { withMaxButton }
49
52
/>
50
53
{ children }
51
54
</ Form >
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ export type TokenBalanceInputProps = {
100
100
size ?: "lg" | "md"
101
101
fiatCurrency ?: CurrencyType
102
102
setAmount : ( value ?: bigint ) => void
103
+ withMaxButton ?: boolean
103
104
} & InputProps &
104
105
HelperErrorTextProps
105
106
@@ -114,6 +115,7 @@ export default function TokenBalanceInput({
114
115
helperText,
115
116
hasError = false ,
116
117
fiatCurrency,
118
+ withMaxButton = false ,
117
119
...inputProps
118
120
} : TokenBalanceInputProps ) {
119
121
const valueRef = useRef < bigint | undefined > ( amount )
@@ -159,11 +161,14 @@ export default function TokenBalanceInput({
159
161
setAmount ( valueRef ?. current )
160
162
} }
161
163
/>
162
- < InputRightElement >
163
- < Button h = "70%" onClick = { ( ) => setAmount ( tokenBalance ) } >
164
- Max
165
- </ Button >
166
- </ InputRightElement >
164
+
165
+ { withMaxButton && (
166
+ < InputRightElement >
167
+ < Button h = "70%" onClick = { ( ) => setAmount ( tokenBalance ) } >
168
+ Max
169
+ </ Button >
170
+ </ InputRightElement >
171
+ ) }
167
172
</ InputGroup >
168
173
< HelperErrorText
169
174
helperText = { helperText }
You can’t perform that action at this time.
0 commit comments