Feat/LOY-354 L7 Progress Card * feat(LOY-354): Add Trophy icon * fix(LOY-354): include new tierPoints value * feat(LOY-354): L7 Progress Level Card support * refactor(LOY-354): Refactoring of component structure * fix(LOY-354): Remove intl prop drilling * fix(LOY-354): cleanup progress section code Approved-by: Erik Tiekstra
31 lines
732 B
TypeScript
31 lines
732 B
TypeScript
import { calculateProgress } from "../utils"
|
|
import ProgressSection from "./ProgressSection"
|
|
import StatsSection from "./StatsSection"
|
|
|
|
import styles from "../levelProgressCard.module.css"
|
|
|
|
interface ProgressCardHighestLevelProps {
|
|
earned: number
|
|
required: number
|
|
toKeepCurrent?: number
|
|
}
|
|
|
|
export default function ProgressCardHighestLevel({
|
|
earned,
|
|
required,
|
|
toKeepCurrent,
|
|
}: ProgressCardHighestLevelProps) {
|
|
const progress = calculateProgress(earned, required, toKeepCurrent)
|
|
|
|
return (
|
|
<div className={styles.innerCard}>
|
|
<StatsSection earned={earned} showTrophy />
|
|
<ProgressSection
|
|
earned={earned}
|
|
progress={progress}
|
|
toKeepCurrent={toKeepCurrent}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|