1+ import { observer } from 'mobx-react' ;
12import Link from 'next/link' ;
23import { FC , useContext } from 'react' ;
3- import { Button , Card , Col , Container , Row } from 'react-bootstrap' ;
4+ import { Button , Card , Col , Row } from 'react-bootstrap' ;
45
56import { I18nContext } from '../../models/Translation' ;
67import { ArticleMeta } from '../../pages/api/core' ;
@@ -10,39 +11,37 @@ interface UpcomingEventsProps {
1011 events : ArticleMeta [ ] ;
1112}
1213
13- export const UpcomingEvents : FC < UpcomingEventsProps > = ( { events } ) => {
14+ export const UpcomingEvents : FC < UpcomingEventsProps > = observer ( ( { events } ) => {
1415 const { t } = useContext ( I18nContext ) ;
1516
1617 return (
17- < div className = "py-5 bg-white w-100 m-0" >
18- < Container >
19- < SectionTitle > { t ( 'upcoming_events' ) } </ SectionTitle >
18+ < >
19+ < SectionTitle > { t ( 'upcoming_events' ) } </ SectionTitle >
2020
21- < Row className = "g-4" xs = { 1 } sm = { 2 } md = { 3 } >
22- { events . map ( ( { name, meta, path } ) => (
23- < Col key = { name } >
24- < Card body >
25- < Card . Title className = "text-dark" > { name } </ Card . Title >
26- < Card . Text className = "text-dark" >
27- { t ( 'activity_time' ) } : { meta ?. start || 'N/A' }
28- </ Card . Text >
29- < Card . Text className = "text-dark" >
30- { t ( 'activity_location' ) } : { meta ?. address || 'N/A' }
31- </ Card . Text >
21+ < Row className = "g-4" xs = { 1 } sm = { 2 } md = { 3 } >
22+ { events . map ( ( { name, meta, path } ) => (
23+ < Col key = { name } >
24+ < Card body >
25+ < Card . Title className = "text-dark" > { name } </ Card . Title >
26+ < Card . Text className = "text-dark" >
27+ { t ( 'activity_time' ) } : { meta ?. start || 'N/A' }
28+ </ Card . Text >
29+ < Card . Text className = "text-dark" >
30+ { t ( 'activity_location' ) } : { meta ?. address || 'N/A' }
31+ </ Card . Text >
3232
33- < Link href = { path || '#' } className = "btn btn-primary" >
34- { t ( 'view_details' ) }
35- </ Link >
36- </ Card >
37- </ Col >
38- ) ) }
39- </ Row >
40- < div className = "text-center mt-4" >
41- < Button variant = "outline-primary" size = "lg" href = "/activity" >
42- { t ( 'view_all_activities' ) } →
43- </ Button >
44- </ div >
45- </ Container >
46- </ div >
33+ < Link href = { path || '#' } className = "btn btn-primary" >
34+ { t ( 'view_details' ) }
35+ </ Link >
36+ </ Card >
37+ </ Col >
38+ ) ) }
39+ </ Row >
40+ < div className = "text-center mt-4" >
41+ < Button variant = "outline-primary" size = "lg" href = "/activity" >
42+ { t ( 'view_all_activities' ) } →
43+ </ Button >
44+ </ div >
45+ </ >
4746 ) ;
48- } ;
47+ } ) ;
0 commit comments