Skip to content

Commit

Permalink
fixed...i think
Browse files Browse the repository at this point in the history
  • Loading branch information
euanwm committed Dec 18, 2024
1 parent 6672c85 commit 0105a8f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
1 change: 0 additions & 1 deletion frontend/components/molecules/dataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
16 changes: 16 additions & 0 deletions frontend/components/molecules/noresults.tsx
Original file line number Diff line number Diff line change
@@ -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 = () => (
<div className="flex flex-col items-center justify-center space-y-4 mt-4 mx-4">
<h1 className="text-2xl">No results found</h1>
<Button
className="ml-4"
color="primary"
onClick={() => window.history.back()}
>
Go back
</Button>
</div>
)
38 changes: 22 additions & 16 deletions frontend/components/organisms/homePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -67,23 +68,28 @@ function HomePage() {
year={year}
handleFilterChange={handleFilterChange}
/>
{data && (
<DataTable
lifters={data}
openLifterGraphHandler={lifterName =>
setShowLifterGraph(lifterName)
}
/>
{data && data.size > 0 && (
<>
<DataTable
lifters={data}
openLifterGraphHandler={lifterName =>
setShowLifterGraph(lifterName)
}
/>
<Button
className={'flex justify-center'}
aria-label={'Load more results'}
color={'primary'}
onClick={updateLifterList}
isDisabled={false}
>
Showing {stop} / {data.size} lifters...
</Button>
</>
)}
{data?.size === 0 && (
<NoResults />
)}
<Button
className={'flex justify-center'}
aria-label={'Load more results'}
color={'primary'}
onClick={updateLifterList}
isDisabled={false}
>
Showing {stop} / {data?.size} lifters...
</Button>
</div>
{showLifterGraph && (
<LifterGraphModal
Expand Down

0 comments on commit 0105a8f

Please sign in to comment.