1
- import { Dialog , Transition } from '@headlessui/react' ;
2
- import React , { Fragment } from 'react' ;
1
+ import { Dialog } from '@headlessui/react' ;
2
+ import React from 'react' ;
3
3
import { AlgoliaEditorFile } from '../../models/algoliaEditorFile' ;
4
+ import Modal from '../Modal' ;
4
5
import EditorFileModalInterface from './EditorFileModalInterface' ;
5
6
6
7
export interface EditorFileModalProps {
@@ -15,42 +16,10 @@ export const EditorFileModal: React.FC<EditorFileModalProps> = ({
15
16
onSelect,
16
17
} ) => {
17
18
return (
18
- < Transition . Root show = { isOpen } as = { Fragment } >
19
- < Dialog
20
- as = "div"
21
- static
22
- className = "fixed z-10 inset-0 overflow-y-auto"
23
- open = { isOpen }
24
- onClose = { ( ) => onClose ( ) }
25
- >
26
- < div className = "min-h-screen text-center sm:p-0" >
27
- < Transition . Child
28
- as = { Fragment }
29
- enter = "ease-out duration-300"
30
- enterFrom = "opacity-0"
31
- enterTo = "opacity-100"
32
- leave = "ease-in duration-200"
33
- leaveFrom = "opacity-100"
34
- leaveTo = "opacity-0"
35
- >
36
- < Dialog . Overlay className = "fixed inset-0 bg-gray-500 bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75 transition-opacity" />
37
- </ Transition . Child >
38
-
39
- < Transition . Child
40
- as = { Fragment }
41
- enter = "ease-out duration-300"
42
- enterFrom = "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
43
- enterTo = "opacity-100 translate-y-0 sm:scale-100"
44
- leave = "ease-in duration-200"
45
- leaveFrom = "opacity-100 translate-y-0 sm:scale-100"
46
- leaveTo = "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
47
- >
48
- < div className = "inline-block bg-white dark:bg-dark-surface rounded-lg text-left overflow-hidden shadow-xl transform transition-all my-8 sm:my-16 sm:align-middle sm:max-w-lg w-full" >
49
- < EditorFileModalInterface onSelect = { onSelect } />
50
- </ div >
51
- </ Transition . Child >
52
- </ div >
53
- </ Dialog >
54
- </ Transition . Root >
19
+ < Modal isOpen = { isOpen } onClose = { onClose } bg = "bg-black/60" >
20
+ < Dialog . Panel className = "inline-block bg-white dark:bg-dark-surface rounded-lg text-left overflow-hidden shadow-xl transform transition-all my-8 sm:my-16 sm:align-middle sm:max-w-lg w-full self-start" >
21
+ < EditorFileModalInterface onSelect = { onSelect } />
22
+ </ Dialog . Panel >
23
+ </ Modal >
55
24
) ;
56
25
} ;
0 commit comments