Skip to content

Commit ad34f57

Browse files
committed
f
1 parent ce594e2 commit ad34f57

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

app/components/UI/Rewards/utils/ondoCampaignConstants.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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';
25
import { 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+
}

0 commit comments

Comments
 (0)