File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
- import { Center , ModalContentProps } from "@chakra-ui/react"
2
-
3
1
import { QuizStatus } from "@/lib/types"
4
2
5
3
import Modal from "../Modal"
4
+ import { Center } from "../ui/flex"
6
5
7
6
type QuizzesModalProps = {
8
7
isQuizModalOpen : boolean
@@ -18,27 +17,28 @@ const QuizzesModal = ({
18
17
onQuizModalClose,
19
18
...props
20
19
} : QuizzesModalProps ) => {
21
- const getStatusColor = ( ) : ModalContentProps [ "bg" ] => {
20
+ // TODO: remove bang in utility class names when Modal is migrated
21
+ const getStatusColorClass = ( ) => {
22
22
if ( quizStatus === "neutral" ) {
23
- return "background.base "
23
+ return "!bg- background"
24
24
}
25
+
25
26
if ( quizStatus === "success" ) {
26
- return "success. neutral"
27
+ return "!bg- success- neutral"
27
28
}
28
- return "error.neutral"
29
+
30
+ return "!bg-error"
29
31
}
30
32
31
33
return (
32
34
< Modal
33
35
isOpen = { isQuizModalOpen }
34
36
onClose = { onQuizModalClose }
35
37
size = { { base : "full" , md : "xl" } }
36
- contentProps = { { bg : getStatusColor ( ) } }
38
+ contentProps = { { className : getStatusColorClass ( ) } }
37
39
{ ...props }
38
40
>
39
- < Center m = { 0 } bg = { getStatusColor ( ) } >
40
- { children }
41
- </ Center >
41
+ < Center className = { getStatusColorClass ( ) } > { children } </ Center >
42
42
</ Modal >
43
43
)
44
44
}
You can’t perform that action at this time.
0 commit comments