From 231d3e65c4a86a345d856dbc521c639ef49952fb Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 2 Sep 2022 16:19:10 -0500 Subject: [PATCH] Fix incorrect error message for no bets --- web/components/bets-list.tsx | 40 ++++++++++++++++++++--------------- web/components/pagination.tsx | 2 +- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index b4538767..2a9a76a1 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -209,26 +209,27 @@ export function BetsList(props: { user: User }) { {displayedContracts.length === 0 ? ( - + ) : ( - displayedContracts.map((contract) => ( - + {displayedContracts.map((contract) => ( + + ))} + - )) + )} - - ) } @@ -236,7 +237,7 @@ export function BetsList(props: { user: User }) { const NoBets = ({ user }: { user: User }) => { const me = useUser() return ( -
+
{user.id === me?.id ? ( <> You have not made any bets yet.{' '} @@ -250,6 +251,11 @@ const NoBets = ({ user }: { user: User }) => {
) } +const NoMatchingBets = () => ( +
+ No bets matching the current filter. +
+) function ContractBets(props: { contract: Contract diff --git a/web/components/pagination.tsx b/web/components/pagination.tsx index 8c008ab0..8dde743c 100644 --- a/web/components/pagination.tsx +++ b/web/components/pagination.tsx @@ -58,7 +58,7 @@ export function Pagination(props: { const maxPage = Math.ceil(totalItems / itemsPerPage) - 1 - if (maxPage === 0) return + if (maxPage <= 0) return return (