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

Function getLevelProgress

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

Source from the content-addressed store, hash-verified

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

Callers 2

QuestButtonFunction · 0.85
handleClaimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected