File tree Expand file tree Collapse file tree 1 file changed +28
-14
lines changed
web/src/pages/Courts/CourtDetails/StakePanel Expand file tree Collapse file tree 1 file changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,24 @@ 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 Container = styled . div `
34+ display: flex;
35+ gap: 8px;
36+ flex-direction: column;
37+ ` ;
38+
39+ const ErrorLabel = styled . label `
40+ color: ${ ( { theme } ) => theme . error } ;
41+ ` ;
42+
3243interface IActionButton {
3344 isSending : boolean ;
3445 parsedAmount : bigint ;
@@ -142,20 +153,23 @@ const StakeWithdrawButton: React.FC<IActionButton> = ({
142153 const { text, checkDisabled, onClick } = buttonProps [ isAllowance ? ActionType . allowance : action ] ;
143154 return (
144155 < 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- />
156+ < Container >
157+ < Button
158+ text = { text }
159+ isLoading = { isSending }
160+ disabled = {
161+ isSending ||
162+ parsedAmount == 0n ||
163+ isUndefined ( targetStake ) ||
164+ isUndefined ( courtDetails ) ||
165+ checkDisabled ( ) ||
166+ ( targetStake !== 0n && targetStake < BigInt ( courtDetails . court ?. minStake ) ) ||
167+ ( isStaking && ! isAllowance && isUndefined ( setStakeConfig ) )
168+ }
169+ onClick = { onClick }
170+ />
171+ { setStakeError && < ErrorLabel > { setStakeError . message } </ ErrorLabel > }
172+ </ Container >
159173 </ EnsureChain >
160174 ) ;
161175} ;
You can’t perform that action at this time.
0 commit comments