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