From 0d09de209841642ca21cf47d24d9bf31b9d86f9e Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 10 Jan 2025 13:53:41 +0100 Subject: [PATCH 1/2] Add fund button --- .../scripts/views/pages/ContestPage/ContestPage.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx b/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx index b934bb9ef57..89d1002ebf1 100644 --- a/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx @@ -13,6 +13,8 @@ import { PageNotFound } from 'views/pages/404'; import ContestCard from 'views/pages/CommunityManagement/Contests/ContestsList/ContestCard'; import useCommunityContests from 'views/pages/CommunityManagement/Contests/useCommunityContests'; +import FundContestDrawer from '../CommunityManagement/Contests/FundContestDrawer'; + import './ContestPage.scss'; export enum SortType { @@ -39,6 +41,7 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => { const { getContestByAddress, isContestDataLoading } = useCommunityContests(); const contest = getContestByAddress(contestAddress); + const [fundDrawerContest, setFundDrawerContest] = useState(); const [selectedSort, setSelectedSort] = useState( sortOptions[0].value, ); @@ -80,6 +83,7 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => { showLeaderboardButton={false} payoutStructure={contest?.payout_structure} isFarcaster={contest?.is_farcaster_contest} + onFund={() => setFundDrawerContest(contest)} /> )} @@ -137,6 +141,13 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => { )} + setFundDrawerContest(undefined)} + isOpen={!!fundDrawerContest} + contestAddress={fundDrawerContest?.contest_address || ''} + fundingTokenAddress={fundDrawerContest?.funding_token_address} + fundingTokenTicker={fundDrawerContest?.ticker || 'ETH'} + /> ); }; From 4401e9239a7d6e1b5b0200c54baee5c86b6da7fd Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 10 Jan 2025 15:41:43 +0100 Subject: [PATCH 2/2] CI --- .../client/scripts/views/pages/ContestPage/ContestPage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx b/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx index 89d1002ebf1..63891a3f7b8 100644 --- a/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/ContestPage/ContestPage.tsx @@ -41,7 +41,9 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => { const { getContestByAddress, isContestDataLoading } = useCommunityContests(); const contest = getContestByAddress(contestAddress); - const [fundDrawerContest, setFundDrawerContest] = useState(); + const [fundDrawerContest, setFundDrawerContest] = useState< + typeof contest | null + >(); const [selectedSort, setSelectedSort] = useState( sortOptions[0].value, ); @@ -145,7 +147,7 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => { onClose={() => setFundDrawerContest(undefined)} isOpen={!!fundDrawerContest} contestAddress={fundDrawerContest?.contest_address || ''} - fundingTokenAddress={fundDrawerContest?.funding_token_address} + fundingTokenAddress={fundDrawerContest?.funding_token_address || ''} fundingTokenTicker={fundDrawerContest?.ticker || 'ETH'} />