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 | 2be72885e2d49a5637c2741e1844dfe92d3e197e (patch) | |
tree | 6ad38bd8a9f2f35ef9614a3f305010523f2008e3 /Timeline/ClientApp/src/app/views/common/LoadingButton.tsx | |
parent | ac40d9c18e2ac7b4995dac38d5da04a3ea7f1559 (diff) | |
download | timeline-2be72885e2d49a5637c2741e1844dfe92d3e197e.tar.gz timeline-2be72885e2d49a5637c2741e1844dfe92d3e197e.tar.bz2 timeline-2be72885e2d49a5637c2741e1844dfe92d3e197e.zip |
Beatify login page.
Diffstat (limited to 'Timeline/ClientApp/src/app/views/common/LoadingButton.tsx')
-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; |