diff --git a/frontend/src/components/ExperimentCollection/Header/Header.tsx b/frontend/src/components/ExperimentCollection/Header/Header.tsx index a01de83be..4b310ac12 100644 --- a/frontend/src/components/ExperimentCollection/Header/Header.tsx +++ b/frontend/src/components/ExperimentCollection/Header/Header.tsx @@ -47,7 +47,7 @@ export const Header: React.FC = ({
{ +const Score = ({ score, label, rank }: ScoreProps) => { const currentScore = useAnimatedScore(score); - const rank = { - class: scoreClass, - text: "", - } - return (
diff --git a/frontend/src/components/Rank/Rank.tsx b/frontend/src/components/Rank/Rank.tsx index 7fc114391..1b83960c5 100644 --- a/frontend/src/components/Rank/Rank.tsx +++ b/frontend/src/components/Rank/Rank.tsx @@ -1,7 +1,7 @@ import classNames from "classnames"; export interface RankPayload { - class: string; + class: string | "diamond" | "platinum" | "gold" | "silver" | "bronze" | "plastic"; text: string; } @@ -10,18 +10,16 @@ interface RankProps { } // Rank shows a decorated representation of a rank -const Rank = ({ rank }: RankProps) => { - return ( -
-
-

{rank.text}

-
- ); -}; +const Rank = ({ rank }: RankProps) => ( +
+
+

{rank.text}

+
+); export default Rank; diff --git a/frontend/src/stories/ScoreV2.stories.tsx b/frontend/src/stories/ScoreV2.stories.tsx index 3df7df657..fa39ddbe0 100644 --- a/frontend/src/stories/ScoreV2.stories.tsx +++ b/frontend/src/stories/ScoreV2.stories.tsx @@ -9,12 +9,12 @@ export default { layout: "fullscreen", }, argTypes: { - scoreClass: { + "rank.class": { control: { type: "select", }, options: ['diamond', 'platinum', 'gold', 'silver', 'bronze', 'plastic'], - } + }, } }; @@ -22,7 +22,10 @@ function getScoreData(overrides = {}) { return { score: 100, label: "points", - scoreClass: "scoreCirclePositive", + rank: { + class: "gold", + text: "Gold", + }, ...overrides, }; }