File tree 1 file changed +22
-14
lines changed
web/src/pages/Courts/CourtDetails/StakePanel
1 file changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,18 @@ import { isUndefined } from "utils/index";
22
22
import { wrapWithToast } from "utils/wrapWithToast" ;
23
23
24
24
import { EnsureChain } from "components/EnsureChain" ;
25
+ import styled from "styled-components" ;
25
26
26
27
export enum ActionType {
27
28
allowance = "allowance" ,
28
29
stake = "stake" ,
29
30
withdraw = "withdraw" ,
30
31
}
31
32
33
+ const ErrorLabel = styled . label `
34
+ color: ${ ( { theme } ) => theme . error } ;
35
+ ` ;
36
+
32
37
interface IActionButton {
33
38
isSending : boolean ;
34
39
parsedAmount : bigint ;
@@ -142,20 +147,23 @@ const StakeWithdrawButton: React.FC<IActionButton> = ({
142
147
const { text, checkDisabled, onClick } = buttonProps [ isAllowance ? ActionType . allowance : action ] ;
143
148
return (
144
149
< EnsureChain >
145
- < Button
146
- text = { text }
147
- isLoading = { isSending }
148
- disabled = {
149
- isSending ||
150
- parsedAmount == 0n ||
151
- isUndefined ( targetStake ) ||
152
- isUndefined ( courtDetails ) ||
153
- checkDisabled ( ) ||
154
- ( targetStake !== 0n && targetStake < BigInt ( courtDetails . court ?. minStake ) ) ||
155
- ( isStaking && ! isAllowance && isUndefined ( setStakeConfig ) )
156
- }
157
- onClick = { onClick }
158
- />
150
+ < >
151
+ < Button
152
+ text = { text }
153
+ isLoading = { isSending }
154
+ disabled = {
155
+ isSending ||
156
+ parsedAmount == 0n ||
157
+ isUndefined ( targetStake ) ||
158
+ isUndefined ( courtDetails ) ||
159
+ checkDisabled ( ) ||
160
+ ( targetStake !== 0n && targetStake < BigInt ( courtDetails . court ?. minStake ) ) ||
161
+ ( isStaking && ! isAllowance && isUndefined ( setStakeConfig ) )
162
+ }
163
+ onClick = { onClick }
164
+ />
165
+ { setStakeError && < ErrorLabel > { setStakeError . message } </ ErrorLabel > }
166
+ </ >
159
167
</ EnsureChain >
160
168
) ;
161
169
} ;
You can’t perform that action at this time.
0 commit comments