added spinner on button during load

This commit is contained in:
Abhinav-grd 2021-04-03 10:30:37 +05:30
parent 803ed2df9a
commit 6c97981e35
2 changed files with 12 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import { setKey, SESSION_KEYS, getKey } from 'utils/storage/sessionStorage';
import CryptoWorker, { generateIntermediateKeyAttributes } from 'utils/crypto';
import { logoutUser } from 'services/userService';
import { isFirstLogin } from 'utils/storage';
import { Spinner } from 'react-bootstrap';
const Image = styled.img`
width: 200px;
@ -147,7 +148,11 @@ export default function Credentials() {
</Form.Control.Feedback>
</Form.Group>
<Button block type="submit" disabled={loading}>
{constants.VERIFY_PASSPHRASE}
{loading ? (
<Spinner animation="border" />
) : (
constants.VERIFY_PASSPHRASE
)}
</Button>
<br />
<div>

View file

@ -14,6 +14,7 @@ import { getKey, SESSION_KEYS, setKey } from 'utils/storage/sessionStorage';
import { B64EncryptionResult } from 'services/uploadService';
import CryptoWorker from 'utils/crypto';
import { generateIntermediateKeyAttributes } from 'utils/crypto';
import { Spinner } from 'react-bootstrap';
const Image = styled.img`
width: 200px;
@ -205,7 +206,11 @@ export default function Generate() {
disabled={loading}
style={{ marginTop: '28px' }}
>
{constants.SET_PASSPHRASE}
{loading ? (
<Spinner animation="border" />
) : (
constants.SET_PASSPHRASE
)}
</Button>
</Form>
)}