From eb4273d20c32cad144f75025c0d9cdd0a35c171c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Geonizeli?= Date: Tue, 31 Aug 2021 10:27:06 -0300 Subject: [PATCH] fix poolList spinner position --- app/javascript/src/assets/vectors/spinner.svg | 18 +++++++++++++++++ .../src/components/Spinner/Spinner.tsx | 20 +++++++++---------- app/javascript/src/pages/Home/Container.tsx | 4 +++- app/javascript/src/pages/Home/PoolListing.tsx | 9 ++++++++- 4 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 app/javascript/src/assets/vectors/spinner.svg 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) => (