Skip to content

Commit

Permalink
added sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelgeek committed Oct 29, 2024
1 parent fd9da5e commit 9c48b16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 11 additions & 13 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ import { EventTypes } from '../components/home/EventTypes'
import { Gallery } from '../components/home/Gallery'
import Organizers from '../components/home/Organizers'
import { Sponsor } from '../components/home/Sponsor'
// import SponsorsList from '../components/home/SponsorsList'
// import { Organizer, Sponsor as SponsorType } from '../types/types'
import { Organizer } from '../types/types'
import SponsorsList from '../components/home/SponsorsList'
import { Organizer, Sponsor as SponsorType } from '../types/types'
import axios from '../utils/axios'

interface HomeProps {
organizers: Organizer[]
// sponsors: SponsorType[]
sponsors: SponsorType[]
}

const Home: NextPage<HomeProps> = ({ organizers }) => {
const Home: NextPage<HomeProps> = ({ organizers, sponsors }) => {
return (
<div
className="bg-[length:0%] md:bg-[length:47%] bg-[top_340px_left_110%] md:bg-[top_100px_left_110%] bg-no-repeat"
Expand Down Expand Up @@ -55,7 +54,7 @@ const Home: NextPage<HomeProps> = ({ organizers }) => {
</section>
<EventTypes />
<Sponsor />
{/* <SponsorsList sponsors={sponsors} year={23} showSponsors /> */}
<SponsorsList sponsors={sponsors} year={24} showSponsors />
<Gallery />
<Organizers organizers={organizers} />
</div>
Expand All @@ -69,14 +68,13 @@ export async function getServerSideProps() {
return response.data.data
})

// const sponsors = await axios
// .get(`/events/${process.env.NEXT_PUBLIC_EVENT_SLUG}/sponsors`)
// .then((response) => {
// return response.data.data
// })
const sponsors = await axios
.get(`/events/${process.env.NEXT_PUBLIC_EVENT_SLUG}/sponsors`)
.then((response) => {
return response.data.data
})

// Pass data to the page via props
return { props: { organizers } }
return { props: { organizers, sponsors } }
}

export default Home
2 changes: 1 addition & 1 deletion pages/sponsors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function SponsorsPage({ sponsors }: { sponsors: Sponsor[] }) {
</div>
</div>
</section>
<SponsorsList sponsors={sponsors} showSponsors={false} year={24} />
<SponsorsList sponsors={sponsors} showSponsors year={24} />
</div>
)
}
Expand Down

0 comments on commit 9c48b16

Please sign in to comment.