MCPcopy Create free account
hub / github.com/dailydotdev/apps / getLevelProgress

Function getLevelProgress

packages/shared/src/components/quest/QuestButton.tsx:61–69  ·  view source on GitHub ↗
(level: QuestLevel)

Source from the content-addressed store, hash-verified

59export type { QuestDestination } from './QuestCard';
60
61const getLevelProgress = (level: QuestLevel) => {
62 const totalForLevel = level.xpInLevel + level.xpToNextLevel;
63
64 if (!totalForLevel) {
65 return 0;
66 }
67
68 return Math.min(100, (level.xpInLevel / totalForLevel) * 100);
69};
70
71const QUEST_LEVEL_PROGRESS_SIZE = 40;
72const QUEST_LEVEL_PROGRESS_STROKE = 4;

Callers 2

QuestButtonFunction · 0.85
handleClaimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected