@@ -9,63 +9,63 @@ import toast from "react-hot-toast";
99Modal . setAppElement ( "#root" ) ;
1010
1111const ModalSolutions = ( { isOpen, setOpenModal, error } ) => {
12- const colorBorderBox = useColorBorderBox ( error ) ;
12+ const { errorTypeColor } = useColorBorderBox ( error . type ) ;
1313
14- return (
15- < Modal
16- isOpen = { isOpen }
17- shouldCloseOnOverlayClick = { true }
18- onRequestClose = {
19- ( ) => setOpenModal ( ( prev ) => ! prev )
20- }
21- contentLabel = "Modal solution"
22- className = { colorBorderBox + " modal" }
23- id = "main-div"
24- style = { {
25- overlay : {
26- backgroundColor : "rgba(0, 0 ,0, .6)" ,
27- } ,
28- content : {
29- position : "fixed" ,
30- top : "50%" ,
31- left : "50%" ,
32- transform : "translate(-50%,-50%)" ,
33- padding : "30px" ,
34- } ,
35- } }
36- >
37- < h3 className = "title" > { error . title } </ h3 >
14+ return (
15+ < Modal
16+ isOpen = { isOpen }
17+ shouldCloseOnOverlayClick = { true }
18+ onRequestClose = {
19+ ( ) => setOpenModal ( ( prev ) => ! prev )
20+ }
21+ contentLabel = "Modal solution"
22+ className = { `py-4 mb-4 col-span-12 md:col-span-6 xl:col-span-4 px-2 md:px-6 border-l-4 rounded-lg items-start bg-dark/5 dark:bg-white/5 backdrop-blur-[10px] flex flex-col hover:scale-105 duration-300 border-[ ${ errorTypeColor } ] modal` }
23+ id = "main-div"
24+ style = { {
25+ overlay : {
26+ backgroundColor : "rgba(0, 0 ,0, .6)" ,
27+ } ,
28+ content : {
29+ position : "fixed" ,
30+ top : "50%" ,
31+ left : "50%" ,
32+ transform : "translate(-50%,-50%)" ,
33+ padding : "30px" ,
34+ } ,
35+ } }
36+ >
37+ < h3 className = "title" > { error . title } </ h3 >
3838
39- < ErrorType type = { error . type } />
39+ < ErrorType type = { error . type } />
4040
41- < div className = "bg-primary w-full h-[2px] my-4" />
41+ < div className = "bg-primary w-full h-[2px] my-4" />
4242
43- < ErrorSolutions solutions = { error . solutions } />
43+ < ErrorSolutions solutions = { error . solutions } />
4444
45- < div className = "bg-primary w-full h-[2px] my-4" />
46- < div className = "flex flex-row" >
47- < button
48- className = "flex mt-8 items-center gap-2 px-3 py-2 border border-gray rounded-lg hover:border-primary hover:text-primary"
49- onClick = { ( ) => setOpenModal ( ( prev ) => ! prev ) }
50- >
51- < MdKeyboardArrowLeft className = "text-lg" />
52- < span className = "text-xs" > Back</ span >
53- </ button >
54- < button
55- className = "flex mt-8 items-center gap-2 mx-4 px-3 py-2 border border-gray rounded-lg hover:border-primary hover:text-primary"
56- onClick = { ( ) => {
57- toast . success ( "Commands copied to clipboard" ) ;
58- navigator . clipboard . writeText (
59- error . solutions . split ( "<" ) . join ( " " )
60- ) ;
61- } }
62- >
63- < MdContentCopy className = "text-lg" />
64- < span className = "text-xs" > Copy</ span >
65- </ button >
66- </ div >
67- </ Modal >
68- ) ;
45+ < div className = "bg-primary w-full h-[2px] my-4" />
46+ < div className = "flex flex-row" >
47+ < button
48+ className = "flex mt-8 items-center gap-2 px-3 py-2 border border-gray rounded-lg hover:border-primary hover:text-primary"
49+ onClick = { ( ) => setOpenModal ( ( prev ) => ! prev ) }
50+ >
51+ < MdKeyboardArrowLeft className = "text-lg" />
52+ < span className = "text-xs" > Back</ span >
53+ </ button >
54+ < button
55+ className = "flex mt-8 items-center gap-2 mx-4 px-3 py-2 border border-gray rounded-lg hover:border-primary hover:text-primary"
56+ onClick = { ( ) => {
57+ toast . success ( "Commands copied to clipboard" ) ;
58+ navigator . clipboard . writeText (
59+ error . solutions . split ( "<" ) . join ( " " )
60+ ) ;
61+ } }
62+ >
63+ < MdContentCopy className = "text-lg" />
64+ < span className = "text-xs" > Copy</ span >
65+ </ button >
66+ </ div >
67+ </ Modal >
68+ ) ;
6969} ;
7070
7171export default ModalSolutions ;
0 commit comments