@@ -5,17 +5,16 @@ import { EventTypes } from '../components/home/EventTypes'
5
5
import { Gallery } from '../components/home/Gallery'
6
6
import Organizers from '../components/home/Organizers'
7
7
import { Sponsor } from '../components/home/Sponsor'
8
- // import SponsorsList from '../components/home/SponsorsList'
9
- // import { Organizer, Sponsor as SponsorType } from '../types/types'
10
- import { Organizer } from '../types/types'
8
+ import SponsorsList from '../components/home/SponsorsList'
9
+ import { Organizer , Sponsor as SponsorType } from '../types/types'
11
10
import axios from '../utils/axios'
12
11
13
12
interface HomeProps {
14
13
organizers : Organizer [ ]
15
- // sponsors: SponsorType[]
14
+ sponsors : SponsorType [ ]
16
15
}
17
16
18
- const Home : NextPage < HomeProps > = ( { organizers } ) => {
17
+ const Home : NextPage < HomeProps > = ( { organizers, sponsors } ) => {
19
18
return (
20
19
< div
21
20
className = "bg-[length:0%] md:bg-[length:47%] bg-[top_340px_left_110%] md:bg-[top_100px_left_110%] bg-no-repeat"
@@ -55,7 +54,7 @@ const Home: NextPage<HomeProps> = ({ organizers }) => {
55
54
</ section >
56
55
< EventTypes />
57
56
< Sponsor />
58
- { /* <SponsorsList sponsors={sponsors} year={23 } showSponsors /> */ }
57
+ < SponsorsList sponsors = { sponsors } year = { 24 } showSponsors />
59
58
< Gallery />
60
59
< Organizers organizers = { organizers } />
61
60
</ div >
@@ -69,14 +68,13 @@ export async function getServerSideProps() {
69
68
return response . data . data
70
69
} )
71
70
72
- // const sponsors = await axios
73
- // .get(`/events/${process.env.NEXT_PUBLIC_EVENT_SLUG}/sponsors`)
74
- // .then((response) => {
75
- // return response.data.data
76
- // })
71
+ const sponsors = await axios
72
+ . get ( `/events/${ process . env . NEXT_PUBLIC_EVENT_SLUG } /sponsors` )
73
+ . then ( ( response ) => {
74
+ return response . data . data
75
+ } )
77
76
78
- // Pass data to the page via props
79
- return { props : { organizers } }
77
+ return { props : { organizers, sponsors } }
80
78
}
81
79
82
80
export default Home
0 commit comments