diff --git a/app/javascript/src/assets/vectors/spinner.svg b/app/javascript/src/assets/vectors/spinner.svg new file mode 100644 index 0000000..3b54523 --- /dev/null +++ b/app/javascript/src/assets/vectors/spinner.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/javascript/src/components/Spinner/Spinner.tsx b/app/javascript/src/components/Spinner/Spinner.tsx index a2b589e..e7eca27 100644 --- a/app/javascript/src/components/Spinner/Spinner.tsx +++ b/app/javascript/src/components/Spinner/Spinner.tsx @@ -2,20 +2,18 @@ import type { FC } from "react"; import React from "react"; import cs from "classnames"; +import spinner from "../../assets/vectors/spinner.svg"; + type Props = { - sizeClasses?: string; + width?: string; }; -export const Spinner: FC = ({ sizeClasses }) => { +export const Spinner: FC = ({ width }) => { return ( -
-
-
+ loading spinner ); }; diff --git a/app/javascript/src/pages/Home/Container.tsx b/app/javascript/src/pages/Home/Container.tsx index dca682e..0289891 100644 --- a/app/javascript/src/pages/Home/Container.tsx +++ b/app/javascript/src/pages/Home/Container.tsx @@ -11,7 +11,9 @@ export const Container = ({ }: React.PropsWithChildren) => { return (
-
{children}
+
+ {children} +
); }; diff --git a/app/javascript/src/pages/Home/PoolListing.tsx b/app/javascript/src/pages/Home/PoolListing.tsx index 200b390..7aa4240 100644 --- a/app/javascript/src/pages/Home/PoolListing.tsx +++ b/app/javascript/src/pages/Home/PoolListing.tsx @@ -69,9 +69,16 @@ export const PoolListing = () => { })(); }, [provider]); + if (isLoadingPools) { + return ( +
+ +
+ ); + } + return (
- {isLoadingPools && } {validPools .sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0)) .map((pool) => (