File tree Expand file tree Collapse file tree 5 files changed +25
-42
lines changed Expand file tree Collapse file tree 5 files changed +25
-42
lines changed Original file line number Diff line number Diff line change @@ -15,21 +15,19 @@ const {
15
15
export const Modal = defineMultiStyleConfig ( {
16
16
baseStyle : definePartsStyle ( ( props ) =>
17
17
defineMergeStyles ( defaultBaseStyle ?.( props ) , {
18
- overlay : {
19
- bg : "gray.500" ,
20
- } ,
21
18
dialog : {
22
19
bg : "background.base" ,
23
20
gap : "4" ,
24
21
padding : "8" ,
25
- maxW : "464px" ,
26
- borderRadius : "md" ,
22
+ borderRadius : "base" ,
27
23
boxShadow : "none" ,
28
24
} ,
29
25
header : {
30
- padding : 0 ,
26
+ padding : "0" ,
31
27
fontWeight : "bold" ,
32
28
fontSize : "2xl" ,
29
+ minHeight : "6" ,
30
+ me : "8" ,
33
31
} ,
34
32
closeButton : {
35
33
boxSize : "8" ,
@@ -38,15 +36,15 @@ export const Modal = defineMultiStyleConfig({
38
36
insetInlineEnd : "8" ,
39
37
} ,
40
38
body : {
41
- padding : 0 ,
39
+ padding : "0" ,
42
40
fontWeight : "normal" ,
43
41
fontSize : "md" ,
44
42
} ,
45
43
footer : {
46
- gap : "8px " ,
47
- px : 0 ,
48
- pt : 8 ,
49
- pb : 0 ,
44
+ gap : "2 " ,
45
+ px : "0" ,
46
+ pt : "8" ,
47
+ pb : "0" ,
50
48
} ,
51
49
} )
52
50
) ,
Original file line number Diff line number Diff line change @@ -5,48 +5,32 @@ import {
5
5
ModalBody ,
6
6
ModalCloseButton ,
7
7
ModalContent ,
8
- type ModalContentProps ,
8
+ ModalContentProps ,
9
9
ModalFooter ,
10
10
ModalHeader ,
11
11
ModalOverlay ,
12
12
type ModalProps as ChakraModalProps ,
13
13
} from "@chakra-ui/react"
14
14
15
- export type ModalProps = ModalContentProps &
16
- Pick < ChakraModalProps , "size" > & {
17
- children ?: React . ReactNode
18
- title ?: string
19
- actionButtonLabel ?: string
20
- isOpen : boolean
21
- setIsOpen : ( isOpen : boolean ) => void
22
- }
15
+ export type ModalProps = ChakraModalProps & {
16
+ children ?: React . ReactNode
17
+ title ?: string
18
+ actionButtonLabel ?: string
19
+ contentProps ?: ModalContentProps
20
+ }
23
21
24
22
const Modal = ( {
25
23
children,
26
24
title,
27
25
actionButtonLabel,
28
- isOpen,
29
- setIsOpen,
26
+ contentProps,
30
27
...restProps
31
28
} : ModalProps ) => {
32
29
return (
33
- < ChakraModal
34
- isOpen = { isOpen }
35
- onClose = { ( ) => setIsOpen ( false ) }
36
- isCentered
37
- /* size={size ?? "xl"} */
38
- scrollBehavior = "inside"
39
- >
40
- < ModalOverlay bgColor = "blackAlpha.700" />
30
+ < ChakraModal isCentered scrollBehavior = "inside" { ...restProps } >
31
+ < ModalOverlay />
41
32
42
- < ModalContent
43
- p = { 8 }
44
- shadow = "md"
45
- border = "1px"
46
- borderColor = "border"
47
- borderRadius = "md"
48
- { ...restProps }
49
- >
33
+ < ModalContent { ...contentProps } >
50
34
< ModalHeader > { title } </ ModalHeader >
51
35
< ModalCloseButton />
52
36
< ModalBody > { children } </ ModalBody >
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ const CustomRadio = ({
124
124
} )
125
125
126
126
const buttonBg = useMemo < string > ( ( ) => {
127
- if ( ! state . isChecked ) return "body.inverted "
127
+ if ( ! state . isChecked ) return "background.highlight "
128
128
if ( ! isAnswerVisible ) return "primary.base"
129
129
if ( ! isSelectedCorrect ) return "error.base"
130
130
return "success.base"
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ const QuizWidget = ({
103
103
104
104
const getMainContainerBg = ( ) : StackProps [ "bg" ] => {
105
105
if ( ! answerStatus ) {
106
- return "neutral "
106
+ return "background.base "
107
107
}
108
108
109
109
if ( answerStatus === "correct" ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const QuizzesModal = ({
20
20
} : QuizzesModalProps ) => {
21
21
const getStatusColor = ( ) : ModalContentProps [ "bg" ] => {
22
22
if ( quizStatus === "neutral" ) {
23
- return "neutral "
23
+ return "background.base "
24
24
}
25
25
if ( quizStatus === "success" ) {
26
26
return "success.neutral"
@@ -31,8 +31,9 @@ const QuizzesModal = ({
31
31
return (
32
32
< Modal
33
33
isOpen = { isQuizModalOpen }
34
- setIsOpen = { onQuizModalClose }
34
+ onClose = { onQuizModalClose }
35
35
size = { { base : "full" , md : "xl" } }
36
+ contentProps = { { bg : getStatusColor ( ) } }
36
37
{ ...props }
37
38
>
38
39
< Center m = { 0 } bg = { getStatusColor ( ) } py = "16" >
You can’t perform that action at this time.
0 commit comments