diff --git a/packages/app/src/Element/AsyncButton.css b/packages/app/src/Element/AsyncButton.css index 0f8fef55..6e544a2d 100644 --- a/packages/app/src/Element/AsyncButton.css +++ b/packages/app/src/Element/AsyncButton.css @@ -2,7 +2,7 @@ button { position: relative; } -.spinner { +.spinner-wrapper { position: absolute; width: 100%; height: 100%; @@ -11,17 +11,4 @@ button { display: flex; justify-content: center; align-items: center; - animation-name: spin; - animation-duration: 800ms; - animation-iteration-count: infinite; - animation-timing-function: linear; -} - -@keyframes spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } } diff --git a/packages/app/src/Element/AsyncButton.tsx b/packages/app/src/Element/AsyncButton.tsx index 3e6f16a5..808b6557 100644 --- a/packages/app/src/Element/AsyncButton.tsx +++ b/packages/app/src/Element/AsyncButton.tsx @@ -1,5 +1,6 @@ import "./AsyncButton.css"; import { useState } from "react"; +import Spinner from "../Icons/Spinner"; interface AsyncButtonProps extends React.ButtonHTMLAttributes { disabled?: boolean; @@ -7,21 +8,6 @@ interface AsyncButtonProps extends React.ButtonHTMLAttributes children?: React.ReactNode; } -interface LoaderProps { - className: string; -} - -const Loader = ({ className }: LoaderProps) => ( -
- - - -
-); - export default function AsyncButton(props: AsyncButtonProps) { const [loading, setLoading] = useState(false); @@ -41,9 +27,13 @@ export default function AsyncButton(props: AsyncButtonProps) { } return ( - ); }