Skip to content

Commit

Permalink
Merge pull request #10552 from hicommonwealth/marcin/10527/add-fund-t…
Browse files Browse the repository at this point in the history
…o-leaderboard

Add fund button to leaderboard
  • Loading branch information
masvelio authored Jan 13, 2025
2 parents e6f0030 + 4401e92 commit e604c60
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -39,6 +41,9 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => {
const { getContestByAddress, isContestDataLoading } = useCommunityContests();
const contest = getContestByAddress(contestAddress);

const [fundDrawerContest, setFundDrawerContest] = useState<
typeof contest | null
>();
const [selectedSort, setSelectedSort] = useState<SortType>(
sortOptions[0].value,
);
Expand Down Expand Up @@ -80,6 +85,7 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => {
showLeaderboardButton={false}
payoutStructure={contest?.payout_structure}
isFarcaster={contest?.is_farcaster_contest}
onFund={() => setFundDrawerContest(contest)}
/>
)}

Expand Down Expand Up @@ -137,6 +143,13 @@ const ContestPage = ({ contestAddress }: ContestPageProps) => {
)}
</div>
</div>
<FundContestDrawer
onClose={() => setFundDrawerContest(undefined)}
isOpen={!!fundDrawerContest}
contestAddress={fundDrawerContest?.contest_address || ''}
fundingTokenAddress={fundDrawerContest?.funding_token_address || ''}
fundingTokenTicker={fundDrawerContest?.ticker || 'ETH'}
/>
</CWPageLayout>
);
};
Expand Down

0 comments on commit e604c60

Please sign in to comment.