File tree Expand file tree Collapse file tree 1 file changed +22
-14
lines changed
web/src/pages/Courts/CourtDetails/StakePanel Expand file tree Collapse file tree 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";
2222import { wrapWithToast } from "utils/wrapWithToast" ;
2323
2424import { EnsureChain } from "components/EnsureChain" ;
25+ import styled from "styled-components" ;
2526
2627export enum ActionType {
2728 allowance = "allowance" ,
2829 stake = "stake" ,
2930 withdraw = "withdraw" ,
3031}
3132
33+ const ErrorLabel = styled . label `
34+ color: ${ ( { theme } ) => theme . error } ;
35+ ` ;
36+
3237interface IActionButton {
3338 isSending : boolean ;
3439 parsedAmount : bigint ;
@@ -142,20 +147,23 @@ const StakeWithdrawButton: React.FC<IActionButton> = ({
142147 const { text, checkDisabled, onClick } = buttonProps [ isAllowance ? ActionType . allowance : action ] ;
143148 return (
144149 < 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+ </ >
159167 </ EnsureChain >
160168 ) ;
161169} ;
You can’t perform that action at this time.
0 commit comments