File tree 1 file changed +28
-14
lines changed
web/src/pages/Courts/CourtDetails/StakePanel
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";
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 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
+
32
43
interface IActionButton {
33
44
isSending : boolean ;
34
45
parsedAmount : bigint ;
@@ -142,20 +153,23 @@ const StakeWithdrawButton: React.FC<IActionButton> = ({
142
153
const { text, checkDisabled, onClick } = buttonProps [ isAllowance ? ActionType . allowance : action ] ;
143
154
return (
144
155
< 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 >
159
173
</ EnsureChain >
160
174
) ;
161
175
} ;
You can’t perform that action at this time.
0 commit comments