22import ClipButton from "@/components/shared/ClipButton" ;
33import ClipSection from "@/components/shared/ClipContainer" ;
44import { findByUniqueId } from "@/components/utils/findByUniqueId" ;
5- import Image from "next/image" ;
5+ import { useEffect , useState } from 'react' ;
6+ // import Image from "next/image";
67interface AvalancheEventsCardProps {
78 params : { lang : string } ;
89 mainData : { mainData : string } ;
910}
1011export default function AvalancheEventsCard ( { params, mainData } : AvalancheEventsCardProps ) {
12+ const [ isMobile , setIsMobile ] = useState ( false ) ;
1113
14+ useEffect ( ( ) => {
15+ const media = window . matchMedia ( "(max-width: 1023px)" ) ;
16+
17+ const update = ( ) => setIsMobile ( media . matches ) ;
18+
19+ update ( ) ;
20+
21+ media . addEventListener ( "change" , update ) ;
22+
23+ return ( ) => media . removeEventListener ( "change" , update ) ;
24+ } , [ ] ) ;
1225 return (
1326 < ClipSection
1427 corner = { params . lang == "fa" ? "bl" : "br" }
15- radius = { 32 }
16- cornerRadius = { 16 }
28+ radius = { isMobile ? 12 : 32 }
29+ cornerRadius = { 16 }
1730 cornerSize = { 120 } className = "w-full text-white dark:text-[#1A1A18] rounded-[28px] p-5 xl:p-7 overflow-hidden" >
1831 < div className = "grid grid-cols-1 lg:grid-cols-[400px_1fr] gap-6 items-stretch" >
1932 { /* Left Side */ }
@@ -29,40 +42,40 @@ export default function AvalancheEventsCard({ params, mainData }: AvalancheEvent
2942 </ div >
3043
3144 < ClipButton clip = { params . lang == "fa" ? "bl" : "br" }
32- className = "w-[230px] overflow-hidden h-[64px] group m-5 cursor-pointer duration-300 text-black dark:text-white hover:!text-[#9100D9] " >
33- < button
34- type = "button"
35- aria-label = "btn event"
36-
37- className = "bg-transparent flex items-center text-base !ring-0 !border-0 focus-visible:ring-0"
38- >
39- < span className = "text-white dark:text-black font-medium group-hover:text-white pe-3" > { findByUniqueId ( mainData , 1711 ) } </ span >
40- < svg className = "rtl:rotate-180 stroke-white"
41- width = "20"
42- height = "20"
43- viewBox = "0 0 24 24"
44- fill = "none"
45- aria-hidden = "true"
46- >
47- < path
48- className = "stroke-[#9100D9] group-hover:stroke-white"
49- d = "M5 12H19"
50- stroke = "white"
51- strokeWidth = "1.8"
52- strokeLinecap = "round"
53- />
54- < path
55- className = "stroke-[#9100D9] group-hover:stroke-white"
56- d = "M13 6L19 12L13 18"
57- stroke = "white"
58- strokeWidth = "1.8"
59- strokeLinecap = "round"
60- strokeLinejoin = "round"
61- />
62- </ svg >
63-
64- </ button >
65- </ ClipButton >
45+ className = "w-[230px] overflow-hidden h-[64px] group ms-0 m-5 cursor-pointer duration-300 text-black dark:text-white hover:!text-[#9100D9] " >
46+ < button
47+ type = "button"
48+ aria-label = "btn event"
49+
50+ className = "bg-transparent flex items-center text-base !ring-0 !border-0 focus-visible:ring-0"
51+ >
52+ < span className = "text-white dark:text-black font-medium group-hover:text-white pe-3" > { findByUniqueId ( mainData , 1711 ) } </ span >
53+ < svg className = "rtl:rotate-180 stroke-white"
54+ width = "20"
55+ height = "20"
56+ viewBox = "0 0 24 24"
57+ fill = "none"
58+ aria-hidden = "true"
59+ >
60+ < path
61+ className = "stroke-[#9100D9] group-hover:stroke-white"
62+ d = "M5 12H19"
63+ stroke = "white"
64+ strokeWidth = "1.8"
65+ strokeLinecap = "round"
66+ />
67+ < path
68+ className = "stroke-[#9100D9] group-hover:stroke-white"
69+ d = "M13 6L19 12L13 18"
70+ stroke = "white"
71+ strokeWidth = "1.8"
72+ strokeLinecap = "round"
73+ strokeLinejoin = "round"
74+ />
75+ </ svg >
76+
77+ </ button >
78+ </ ClipButton >
6679 </ div >
6780
6881 { /* Right Card */ }
@@ -104,42 +117,42 @@ export default function AvalancheEventsCard({ params, mainData }: AvalancheEvent
104117 Reimagined
105118 </ h3 >
106119 </ div >
107-
108- < ClipButton clip = { params . lang == "fa" ? "bl" : "br" }
109- className = "w-[180px] lg:w-[230px] h-[64px] group mt-5 cursor-pointer duration-300 text-black dark:text-white hover:!text-[#9100D9] " >
110- < button
111- type = "button"
112- aria-label = "btn event"
113-
114- className = "bg-transparent flex items-center text-base !ring-0 !border-0 focus-visible:ring-0"
115- >
116- < span className = "text-white dark:text-black font-medium group-hover:text-white pe-3" > { findByUniqueId ( mainData , 1711 ) } </ span >
117- < svg className = "rtl:rotate-180 stroke-white"
118- width = "20"
119- height = "20"
120- viewBox = "0 0 24 24"
121- fill = "none"
122- aria-hidden = "true"
123- >
124- < path
125- className = "stroke-[#9100D9] group-hover:stroke-white"
126- d = "M5 12H19"
127- stroke = "white"
128- strokeWidth = "1.8"
129- strokeLinecap = "round"
130- />
131- < path
132- className = "stroke-[#9100D9] group-hover:stroke-white"
133- d = "M13 6L19 12L13 18"
134- stroke = "white"
135- strokeWidth = "1.8"
136- strokeLinecap = "round"
137- strokeLinejoin = "round"
138- />
139- </ svg >
140-
141- </ button >
142- </ ClipButton >
120+
121+ < ClipButton clip = { params . lang == "fa" ? "bl" : "br" }
122+ className = "w-[180px] lg:w-[230px] h-[64px] group mt-5 cursor-pointer duration-300 text-black dark:text-white hover:!text-[#9100D9] " >
123+ < button
124+ type = "button"
125+ aria-label = "btn event"
126+
127+ className = "bg-transparent flex items-center text-base !ring-0 !border-0 focus-visible:ring-0"
128+ >
129+ < span className = "text-white dark:text-black font-medium group-hover:text-white pe-3" > { findByUniqueId ( mainData , 1711 ) } </ span >
130+ < svg className = "rtl:rotate-180 stroke-white"
131+ width = "20"
132+ height = "20"
133+ viewBox = "0 0 24 24"
134+ fill = "none"
135+ aria-hidden = "true"
136+ >
137+ < path
138+ className = "stroke-[#9100D9] group-hover:stroke-white"
139+ d = "M5 12H19"
140+ stroke = "white"
141+ strokeWidth = "1.8"
142+ strokeLinecap = "round"
143+ />
144+ < path
145+ className = "stroke-[#9100D9] group-hover:stroke-white"
146+ d = "M13 6L19 12L13 18"
147+ stroke = "white"
148+ strokeWidth = "1.8"
149+ strokeLinecap = "round"
150+ strokeLinejoin = "round"
151+ />
152+ </ svg >
153+
154+ </ button >
155+ </ ClipButton >
143156 </ div >
144157 </ ClipSection >
145158 </ div >
0 commit comments