File tree Expand file tree Collapse file tree
app/components/UI/Rewards/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import type { CampaignDto } from '../../../../core/Engine/controllers/rewards-controller/types' ;
1+ import type {
2+ CampaignDto ,
3+ CampaignLeaderboardPositionDto ,
4+ } from '../../../../core/Engine/controllers/rewards-controller/types' ;
25import { getCampaignStatus } from '../components/Campaigns/CampaignTile.utils' ;
36
47/**
@@ -37,3 +40,15 @@ export function isCampaignIneligible(
3740 Math . floor ( ( endDate - startOfTodayUTC ) / ( 1000 * 60 * 60 * 24 ) ) + 1 ;
3841 return daysAvailable < ONDO_GM_REQUIRED_QUALIFIED_DAYS ;
3942}
43+
44+ /**
45+ * Whether the user is an Ondo campaign end winner (top ranks with qualification met).
46+ */
47+ export function isOndoCampaignWinner (
48+ position : CampaignLeaderboardPositionDto | null ,
49+ ) : boolean {
50+ if ( ! position ) {
51+ return false ;
52+ }
53+ return position . rank <= 5 && position . qualified === true ;
54+ }
You can’t perform that action at this time.
0 commit comments