Skip to content

Commit 0bf9736

Browse files
committed
fix: color classes
avoid deprecated tokens
1 parent 1b3e554 commit 0bf9736

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

src/components/Quiz/QuizWidget/index.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,11 @@ const QuizWidget = ({
9696
}, [nextQuiz])
9797

9898
const getMainContainerBg = () => {
99-
if (!answerStatus) {
100-
return isStandaloneQuiz ? "bg-background-highlight" : "bg-background"
101-
}
102-
103-
if (answerStatus === "correct") {
104-
return "bg-success-neutral"
105-
}
106-
107-
return "bg-error-neutral"
99+
if (!isStandaloneQuiz) return "bg-transparent"
100+
if (!answerStatus) return "bg-background-highlight"
101+
if (answerStatus === "correct")
102+
return "!bg-success-light dark:!bg-success-dark"
103+
return "!bg-error-light dark:!bg-error-dark"
108104
}
109105

110106
return (

src/components/Quiz/QuizzesModal.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@ const QuizzesModal = ({
1919
}: QuizzesModalProps) => {
2020
// TODO: remove bang in utility class names when Modal is migrated
2121
const getStatusColorClass = () => {
22-
if (quizStatus === "neutral") {
23-
return "!bg-background"
24-
}
25-
26-
if (quizStatus === "success") {
27-
return "!bg-success-neutral"
28-
}
29-
30-
return "!bg-error"
22+
if (quizStatus === "neutral") return "!bg-background"
23+
if (quizStatus === "success")
24+
return "!bg-success-light dark:!bg-success-dark"
25+
return "!bg-error-light dark:!bg-error-dark"
3126
}
3227

3328
return (
@@ -38,7 +33,7 @@ const QuizzesModal = ({
3833
contentProps={{ className: getStatusColorClass() }}
3934
{...props}
4035
>
41-
<Center className={getStatusColorClass()}>{children}</Center>
36+
<Center>{children}</Center>
4237
</Modal>
4338
)
4439
}

0 commit comments

Comments
 (0)