diff options
author | crupest <crupest@outlook.com> | 2021-06-26 19:13:19 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-26 19:13:19 +0800 |
commit | a168336c0761b263ee5371218cbf6da236c0acce (patch) | |
tree | fbd965f152c1129cd4692e73112c2557e755cddb /FrontEnd/src/views/common/button/LoadingButton.tsx | |
parent | b468fd9a0119b97d1ecc1090a028975e917aa75f (diff) | |
download | timeline-a168336c0761b263ee5371218cbf6da236c0acce.tar.gz timeline-a168336c0761b263ee5371218cbf6da236c0acce.tar.bz2 timeline-a168336c0761b263ee5371218cbf6da236c0acce.zip |
...
Diffstat (limited to 'FrontEnd/src/views/common/button/LoadingButton.tsx')
-rw-r--r-- | FrontEnd/src/views/common/button/LoadingButton.tsx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/FrontEnd/src/views/common/button/LoadingButton.tsx b/FrontEnd/src/views/common/button/LoadingButton.tsx index fd1c19b3..aee83aa2 100644 --- a/FrontEnd/src/views/common/button/LoadingButton.tsx +++ b/FrontEnd/src/views/common/button/LoadingButton.tsx @@ -1,26 +1,19 @@ import React from "react"; -const LoadingButton: React.FC<{ loading?: boolean } & ButtonProps> = ({ +import { CommonButtonProps } from "./common"; +import Button from "./Button"; +import Spinner from "../Spinner"; + +const LoadingButton: React.FC<{ loading?: boolean } & CommonButtonProps> = ({ loading, - variant, disabled, + color, ...otherProps }) => { return ( - <Button - variant={variant != null ? `outline-${variant}` : "outline-primary"} - disabled={disabled || loading} - {...otherProps} - > + <Button color={color} disabled={disabled || loading} {...otherProps}> {otherProps.children} - {loading ? ( - <Spinner - className="ms-1" - variant={variant} - animation="grow" - size="sm" - /> - ) : null} + {loading ? <Spinner color={color} /> : null} </Button> ); }; |