From 6066e8e5e589f272986974d9a180728f1d9176e6 Mon Sep 17 00:00:00 2001 From: Abbas Nosrati <96720246+abbasnosrati@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:21:06 +0330 Subject: [PATCH] Dev (#62) * fixed enroll modal bug * sort raffles in home page --- .../components/Modals/enroll-modal.tsx | 21 +++++++++---------- app/prizetap/page.tsx | 4 ++-- .../containers/landing/prizeTap/index.tsx | 11 +++++----- context/prizeTapProvider.tsx | 6 +++++- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/prizetap/components/Modals/enroll-modal.tsx b/app/prizetap/components/Modals/enroll-modal.tsx index e93b80a9..b4b37016 100644 --- a/app/prizetap/components/Modals/enroll-modal.tsx +++ b/app/prizetap/components/Modals/enroll-modal.tsx @@ -13,7 +13,7 @@ import WrongNetworkBody from "./enroll-body/WrongNetworkBody"; import WinnersModal from "./winnersModal"; const EnrollModalBody = ({ chain }: { chain: Chain }) => { - const { userProfile } = useUserProfileContext(); + // const { userProfile } = useUserProfileContext(); const { selectedNetwork } = useNetworkSwitcher(); @@ -28,13 +28,13 @@ const EnrollModalBody = ({ chain }: { chain: Chain }) => { if (!selectedRaffleForEnroll) return null; - if (!userProfile) - return ( - - ); + // if (!userProfile) + // return ( + // + // ); if (claimOrEnrollWalletResponse?.state === "Done") return ; @@ -68,9 +68,8 @@ const EnrollModal = () => { return ( { - + {/* */} ); }; diff --git a/components/containers/landing/prizeTap/index.tsx b/components/containers/landing/prizeTap/index.tsx index 08424f95..85dc98f8 100644 --- a/components/containers/landing/prizeTap/index.tsx +++ b/components/containers/landing/prizeTap/index.tsx @@ -23,9 +23,10 @@ const PrizeTapLanding: FC = async () => { raffle.status !== "PENDING" && raffle.status !== "REJECTED", ); - const validRaffles = rafflesList.sort( - (a, b) => new Date(a.deadline).getTime() - new Date(b.deadline).getTime(), - ); + // const validRaffles = rafflesList.sort( + // (a, b) => new Date(a.deadline).getTime() - new Date(b.deadline).getTime(), + // ); + const availableRaffles = rafflesList.filter( (raffle) => @@ -57,8 +58,8 @@ const PrizeTapLanding: FC = async () => { } >
- {validRaffles.length > 0 && - validRaffles.slice(0, 2).map((raffle, key) => ( + {rafflesList.length > 0 && + rafflesList.slice(0, 2).map((raffle, key) => (
= ({ setIsWalletPromptOpen(true); return; } + if (!address && method !== "Winners") { + setIsWalletPromptOpen(true); + return; + } setClaimOrEnrollWalletResponse(null); setMethod(method); setSelectedRaffleForEnroll(raffle); }, - [isConnected, setIsWalletPromptOpen], + [isConnected, setIsWalletPromptOpen, address], ); const closeEnrollModal = useCallback(() => {