diff options
| author | crupest <crupest@outlook.com> | 2020-09-03 18:35:44 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2020-09-03 18:35:44 +0800 |
| commit | e6ef9ecd0a26326f42ade7b75a83639989d921a5 (patch) | |
| tree | 6fbef739525682b090d4ba21ed84f65231b74d40 /Timeline/ClientApp/src/app/views/common | |
| parent | 70be5235ba90a15b7798a7922382835fd680b1fc (diff) | |
| download | timeline-e6ef9ecd0a26326f42ade7b75a83639989d921a5.tar.gz timeline-e6ef9ecd0a26326f42ade7b75a83639989d921a5.tar.bz2 timeline-e6ef9ecd0a26326f42ade7b75a83639989d921a5.zip | |
Beatify login page.
Diffstat (limited to 'Timeline/ClientApp/src/app/views/common')
| -rw-r--r-- | Timeline/ClientApp/src/app/views/common/LoadingButton.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/views/common/LoadingButton.tsx b/Timeline/ClientApp/src/app/views/common/LoadingButton.tsx new file mode 100644 index 00000000..fa721afe --- /dev/null +++ b/Timeline/ClientApp/src/app/views/common/LoadingButton.tsx @@ -0,0 +1,28 @@ +import React from "react"; +import { Button, ButtonProps, Spinner } from "react-bootstrap"; + +const LoadingButton: React.FC<{ loading?: boolean } & ButtonProps> = ({ + loading, + variant, + ...otherProps +}) => { + return ( + <Button + variant={variant != null ? `outline-${variant}` : "outline-primary"} + disabled={loading} + {...otherProps} + > + {otherProps.children} + {loading ? ( + <Spinner + className="ml-1" + variant={variant} + animation="grow" + size="sm" + /> + ) : null} + </Button> + ); +}; + +export default LoadingButton; |
