File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ import { cn } from "@/lib/utils/cn"
8
8
import { Button } from "./buttons/Button"
9
9
import { Center , Flex } from "./flex"
10
10
11
- import { useDisclosure } from "@/hooks/useDisclosure"
12
-
13
11
const dialogVariant = tv ( {
14
12
slots : {
15
13
content :
@@ -163,7 +161,6 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName
163
161
export type ModalProps = DialogProps & {
164
162
children ?: React . ReactNode
165
163
title ?: React . ReactNode
166
- onClose ?: ( ) => void
167
164
actionButton ?: {
168
165
label : string
169
166
onClick : ( ) => void
@@ -176,23 +173,10 @@ const Modal = ({
176
173
title,
177
174
actionButton,
178
175
contentProps,
179
- defaultOpen,
180
- onClose,
181
176
...restProps
182
177
} : ModalProps ) => {
183
- const {
184
- onClose : onDisclosureClose ,
185
- isOpen,
186
- setValue,
187
- } = useDisclosure ( defaultOpen )
188
-
189
- const handleClose = ( ) => {
190
- onClose ?.( )
191
- onDisclosureClose ( )
192
- }
193
-
194
178
return (
195
- < Dialog open = { isOpen } onOpenChange = { setValue } { ...restProps } >
179
+ < Dialog { ...restProps } >
196
180
< DialogContent { ...contentProps } >
197
181
< DialogHeader >
198
182
< DialogTitle > { title } </ DialogTitle >
@@ -202,7 +186,7 @@ const Modal = ({
202
186
< DialogFooter >
203
187
< Flex className = "justify-end gap-2" >
204
188
< DialogClose asChild >
205
- < Button onClick = { handleClose } variant = "outline" isSecondary >
189
+ < Button variant = "outline" isSecondary >
206
190
Cancel
207
191
</ Button >
208
192
</ DialogClose >
You can’t perform that action at this time.
0 commit comments