File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- import { IconButton } from "@chakra-ui/react"
1
+ import { IconButton , useStyleConfig } from "@chakra-ui/react"
2
2
import { CgClose } from "react-icons/cg"
3
3
import { ConfirmCloseAlert } from "./Alerts/ConfirmCloseAlert"
4
4
import { useState } from "react"
5
+ import { themeOverrides } from "../theme"
5
6
6
7
type ModalCloseButtonProps = {
7
8
onClose : ( ) => void
8
9
}
9
10
10
11
export const ModalCloseButton = ( { onClose } : ModalCloseButtonProps ) => {
11
12
const [ showModal , setShowModal ] = useState ( false )
13
+ const styles = useStyleConfig ( "Modal" ) as ( typeof themeOverrides ) [ "components" ] [ "Modal" ] [ "baseStyle" ]
12
14
return (
13
15
< >
14
16
< ConfirmCloseAlert
@@ -20,14 +22,15 @@ export const ModalCloseButton = ({ onClose }: ModalCloseButtonProps) => {
20
22
} }
21
23
/>
22
24
< IconButton
25
+ right = "14px"
26
+ top = "20px"
23
27
variant = "unstyled"
28
+ sx = { styles . closeModalButton }
24
29
aria-label = "Close modal"
25
30
icon = { < CgClose /> }
26
31
color = "white"
27
32
position = "absolute"
28
33
transform = "translate(50%, -50%)"
29
- right = "14px"
30
- top = "20px"
31
34
onClick = { ( ) => setShowModal ( true ) }
32
35
zIndex = "toast"
33
36
dir = "ltr"
Original file line number Diff line number Diff line change @@ -312,6 +312,7 @@ export const themeOverrides = {
312
312
fontSize : "lg" ,
313
313
color : "textColor" ,
314
314
} ,
315
+ closeModalButton : { } ,
315
316
} ,
316
317
variants : {
317
318
rsi : {
You can’t perform that action at this time.
0 commit comments