AuthorizeRejectButtons: add a loading animation
This commit is contained in:
parent
3b8f43f02d
commit
d08a2e215b
1 changed files with 26 additions and 16 deletions
|
@ -68,6 +68,7 @@ const AuthorizeRejectButtons: React.FC<IAuthorizeRejectButtons> = ({ onAuthorize
|
|||
default:
|
||||
return (
|
||||
<HStack space={3} alignItems='center'>
|
||||
<div className='relative'>
|
||||
<IconButton
|
||||
src={state === 'rejecting' ? require('@tabler/icons/player-stop-filled.svg') : require('@tabler/icons/x.svg')}
|
||||
onClick={handleReject}
|
||||
|
@ -76,6 +77,11 @@ const AuthorizeRejectButtons: React.FC<IAuthorizeRejectButtons> = ({ onAuthorize
|
|||
iconClassName='h-6 w-6 text-danger-600'
|
||||
disabled={state === 'authorizing'}
|
||||
/>
|
||||
{(state === 'rejecting') && (
|
||||
<div className='pointer-events-none absolute inset-0 h-10 w-10 animate-spin rounded-full border-2 border-transparent border-t-danger-600' />
|
||||
)}
|
||||
</div>
|
||||
<div className='relative'>
|
||||
<IconButton
|
||||
src={state === 'authorizing' ? require('@tabler/icons/player-stop-filled.svg') : require('@tabler/icons/check.svg')}
|
||||
onClick={handleAuthorize}
|
||||
|
@ -84,6 +90,10 @@ const AuthorizeRejectButtons: React.FC<IAuthorizeRejectButtons> = ({ onAuthorize
|
|||
iconClassName='h-6 w-6 text-primary-500'
|
||||
disabled={state === 'rejecting'}
|
||||
/>
|
||||
{(state === 'authorizing') && (
|
||||
<div className='pointer-events-none absolute inset-0 h-10 w-10 animate-spin rounded-full border-2 border-transparent border-t-primary-500' />
|
||||
)}
|
||||
</div>
|
||||
</HStack>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue