Asjust spinner buttons (#427)

This commit is contained in:
Jaco Greeff 2020-09-04 02:43:10 +02:00 committed by GitHub
parent 56e85d7c88
commit f215eb7d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -131,6 +131,7 @@ export default function Request ({ account: { isExternal }, buttonText, isFirst,
: (
<Button
isBusy={isBusy}
isDisabled={isLocked === null}
onClick={_onSignQuick}
>
Sign the transaction
@ -165,7 +166,7 @@ export default function Request ({ account: { isExternal }, buttonText, isFirst,
)
}
<SignArea>
{(isLocked !== null) && isFirst && !isExternal && signButton}
{isFirst && !isExternal && signButton}
<CancelButton>
<Link
isDanger

View File

@ -38,7 +38,7 @@ function Button ({ children, className = '', isBusy, isDisabled, onClick, to }:
disabled={isDisabled || isBusy}
onClick={_onClick}
>
{children}
<div className='children'>{children}</div>
<div className='disabledOverlay' />
<Spinner className='busyOverlay' />
</button>
@ -85,8 +85,16 @@ export default styled(Button)(({ isDanger, theme }: Props) => `
top: 0;
}
&.isBusy .busyOverlay {
visibility: visible;
&.isBusy {
background: rgba(96,96,96,0.15);
.children {
opacity: 0.25;
}
.busyOverlay {
visibility: visible;
}
}
&.isDisabled .disabledOverlay {

View File

@ -26,6 +26,8 @@ function Spinner ({ className = '', size = 'normal' }: Props): React.ReactElemen
export default React.memo(styled(Spinner)`
bottom: 0rem;
height: 3rem;
left: 50%;
margin-left: -1.5rem;
position: absolute;
right: 0.75rem;
width: 3rem;