Skip to content

Commit ea05186

Browse files
refactor(QuizzesModal): remove Chakra imports
1 parent 74a73b2 commit ea05186

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/components/Quiz/QuizzesModal.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { Center, ModalContentProps } from "@chakra-ui/react"
2-
31
import { QuizStatus } from "@/lib/types"
42

53
import Modal from "../Modal"
4+
import { Center } from "../ui/flex"
65

76
type QuizzesModalProps = {
87
isQuizModalOpen: boolean
@@ -18,27 +17,28 @@ const QuizzesModal = ({
1817
onQuizModalClose,
1918
...props
2019
}: QuizzesModalProps) => {
21-
const getStatusColor = (): ModalContentProps["bg"] => {
20+
// TODO: remove bang in utility class names when Modal is migrated
21+
const getStatusColorClass = () => {
2222
if (quizStatus === "neutral") {
23-
return "background.base"
23+
return "!bg-background"
2424
}
25+
2526
if (quizStatus === "success") {
26-
return "success.neutral"
27+
return "!bg-success-neutral"
2728
}
28-
return "error.neutral"
29+
30+
return "!bg-error"
2931
}
3032

3133
return (
3234
<Modal
3335
isOpen={isQuizModalOpen}
3436
onClose={onQuizModalClose}
3537
size={{ base: "full", md: "xl" }}
36-
contentProps={{ bg: getStatusColor() }}
38+
contentProps={{ className: getStatusColorClass() }}
3739
{...props}
3840
>
39-
<Center m={0} bg={getStatusColor()}>
40-
{children}
41-
</Center>
41+
<Center className={getStatusColorClass()}>{children}</Center>
4242
</Modal>
4343
)
4444
}

0 commit comments

Comments
 (0)