From 0105a8f466b508c34a89930b134a9bf755363c4f Mon Sep 17 00:00:00 2001 From: euan Date: Wed, 18 Dec 2024 21:17:36 +0000 Subject: [PATCH] fixed...i think --- frontend/components/molecules/dataTable.tsx | 1 - frontend/components/molecules/noresults.tsx | 16 +++++++++ frontend/components/organisms/homePage.tsx | 38 ++++++++++++--------- 3 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 frontend/components/molecules/noresults.tsx diff --git a/frontend/components/molecules/dataTable.tsx b/frontend/components/molecules/dataTable.tsx index a3126da7..26f79895 100644 --- a/frontend/components/molecules/dataTable.tsx +++ b/frontend/components/molecules/dataTable.tsx @@ -7,7 +7,6 @@ import { TableBody, Link, } from '@nextui-org/react' -import { FaInstagram } from 'react-icons/fa' import { VscGraphLine } from 'react-icons/vsc' import { CgProfile } from 'react-icons/cg' diff --git a/frontend/components/molecules/noresults.tsx b/frontend/components/molecules/noresults.tsx new file mode 100644 index 00000000..f4f8246b --- /dev/null +++ b/frontend/components/molecules/noresults.tsx @@ -0,0 +1,16 @@ +import { Button } from '@nextui-org/react' + +// I have no fucking clue why I had to implement this, but it worked +// If you don't like it, raise a PR ya loser +export const NoResults = () => ( +
+

No results found

+ +
+) \ No newline at end of file diff --git a/frontend/components/organisms/homePage.tsx b/frontend/components/organisms/homePage.tsx index 66e0fe87..7a98b0bb 100644 --- a/frontend/components/organisms/homePage.tsx +++ b/frontend/components/organisms/homePage.tsx @@ -8,6 +8,7 @@ import { Filters } from '../molecules/filters' import { DataTable } from '../molecules/dataTable' import LifterGraphModal from '../molecules/lifterGraphModal' import { useRouter } from 'next/router' +import {NoResults} from "@/components/molecules/noresults"; const lifterLoadMoreQty = 50 @@ -67,23 +68,28 @@ function HomePage() { year={year} handleFilterChange={handleFilterChange} /> - {data && ( - - setShowLifterGraph(lifterName) - } - /> + {data && data.size > 0 && ( + <> + + setShowLifterGraph(lifterName) + } + /> + + + )} + {data?.size === 0 && ( + )} - {showLifterGraph && (