File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ export default function Events({ eventData }) {
99 const highlightData = eventData . data . find ( ( e ) => e . status [ 0 ] == "1" ) ;
1010 const previousData = eventData . data . filter ( ( e ) => e . status [ 0 ] !== "1" ) ;
1111 // console.log(previousData);
12- console . log ( eventData ) ;
12+ // console.log(highlightData );
1313 const router = useRouter ( ) ;
14+ const getFullUrl = ( url ) => {
15+ if ( url . startsWith ( 'http://' ) || url . startsWith ( 'https://' ) ) return url ;
16+ return `http://${ url } ` ;
17+ } ;
18+
1419 return (
1520 < Box >
1621 < Box sx = { styles . banner } id = "events" >
@@ -40,15 +45,14 @@ export default function Events({ eventData }) {
4045 < Text variant = "subTitle" > { highlightData . desc [ 0 ] } </ Text >
4146 </ Box >
4247
43- < Button
44- sx = { styles . banner . button }
45- variant = "primary"
46- onClick = { ( ) =>
47- router . push ( highlightData ?. formLink [ 0 ] || "" )
48- }
49- >
50- Join In
51- </ Button >
48+ < a href = { getFullUrl ( highlightData ?. formLink [ 0 ] ) } >
49+ < Button
50+ sx = { styles . banner . button }
51+ variant = "primary"
52+ >
53+ Join In
54+ </ Button >
55+ </ a >
5256 </ Box >
5357 </ Box >
5458 ) }
You can’t perform that action at this time.
0 commit comments