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"
22import { CgClose } from "react-icons/cg"
33import { ConfirmCloseAlert } from "./Alerts/ConfirmCloseAlert"
44import { useState } from "react"
5+ import { themeOverrides } from "../theme"
56
67type ModalCloseButtonProps = {
78 onClose : ( ) => void
89}
910
1011export const ModalCloseButton = ( { onClose } : ModalCloseButtonProps ) => {
1112 const [ showModal , setShowModal ] = useState ( false )
13+ const styles = useStyleConfig ( "Modal" ) as ( typeof themeOverrides ) [ "components" ] [ "Modal" ] [ "baseStyle" ]
1214 return (
1315 < >
1416 < ConfirmCloseAlert
@@ -20,14 +22,15 @@ export const ModalCloseButton = ({ onClose }: ModalCloseButtonProps) => {
2022 } }
2123 />
2224 < IconButton
25+ right = "14px"
26+ top = "20px"
2327 variant = "unstyled"
28+ sx = { styles . closeModalButton }
2429 aria-label = "Close modal"
2530 icon = { < CgClose /> }
2631 color = "white"
2732 position = "absolute"
2833 transform = "translate(50%, -50%)"
29- right = "14px"
30- top = "20px"
3134 onClick = { ( ) => setShowModal ( true ) }
3235 zIndex = "toast"
3336 dir = "ltr"
Original file line number Diff line number Diff line change @@ -312,6 +312,7 @@ export const themeOverrides = {
312312 fontSize : "lg" ,
313313 color : "textColor" ,
314314 } ,
315+ closeModalButton : { } ,
315316 } ,
316317 variants : {
317318 rsi : {
You can’t perform that action at this time.
0 commit comments