diff --git a/ui/learn/src/score.ts b/ui/learn/src/score.ts index e103ad6fedbdc..5603bed0dba96 100644 --- a/ui/learn/src/score.ts +++ b/ui/learn/src/score.ts @@ -6,7 +6,7 @@ export const apple = 50; export const capture = 50; export const scenario = 50; -type Rank = 1 | 2 | 3; +export type Rank = 1 | 2 | 3; const levelBonus: { [r in Rank]: number } = { 1: 500, diff --git a/ui/learn/src/view.ts b/ui/learn/src/view.ts index dd2a1180eb819..46be691a715b1 100644 --- a/ui/learn/src/view.ts +++ b/ui/learn/src/view.ts @@ -14,8 +14,8 @@ export const view = (ctrl: LearnCtrl): VNode => (ctrl.inStage() ? runView(ctrl) type Status = 'future' | 'done' | 'ongoing'; -const mapView = (ctrl: LearnCtrl) => { - return h('div.learn.learn--map', [ +const mapView = (ctrl: LearnCtrl) => + h('div.learn.learn--map', [ h('div.learn__side', mapSideView(ctrl)), h('div.learn__main.learn-stages', [ ...stages.categs.map(categ => @@ -45,11 +45,11 @@ const mapView = (ctrl: LearnCtrl) => { whatNext(ctrl), ]), ]); -}; const titleVerbosityClass = (title: string) => (title.length > 13 ? (title.length > 18 ? 'vvv' : 'vv') : ''); -const makeStars = (nb: number): VNode[] => Array(nb).fill(h('i', { attrs: { 'data-icon': licon.Star } })); +const makeStars = (rank: scoring.Rank): VNode[] => + Array(4 - rank).fill(h('i', { attrs: { 'data-icon': licon.Star } })); const ongoingStr = (ctrl: LearnCtrl, s: Stage): string => { const progress = ctrl.stageProgress(s);