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

Function getLevelProgress

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

Source from the content-addressed store, hash-verified

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

Callers 2

QuestButtonFunction · 0.85
handleClaimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected