From 2be72885e2d49a5637c2741e1844dfe92d3e197e Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Thu, 3 Sep 2020 18:35:44 +0800
Subject: Beatify login page.

---
 .../src/app/views/common/LoadingButton.tsx         | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Timeline/ClientApp/src/app/views/common/LoadingButton.tsx

(limited to 'Timeline/ClientApp/src/app/views/common/LoadingButton.tsx')

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;
-- 
cgit v1.2.3

