-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Sponsors Carousel To Show New Sponsors (#444)
- Loading branch information
1 parent
5123f90
commit a6d0be7
Showing
4 changed files
with
53 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 44 additions & 57 deletions
101
frontend/components/SponsorCarousel/SponsorCarousel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,66 @@ | ||
import React from 'react'; | ||
import Image from 'next/image'; | ||
import AmazonLogo from 'assets/companies/amazonLogo.png'; | ||
import AtlassianLogo from 'assets/companies/atlassianLogo.png'; | ||
import CanvaLogo from 'assets/companies/canvaLogo.png'; | ||
import GoogleLogo from 'assets/companies/googleLogo.png'; | ||
import JaneStreetLogo from 'assets/companies/janeStreetLogo.png'; | ||
import PearlerLogo from 'assets/companies/PearlerLogo.png'; | ||
import TikTokLogo from 'assets/companies/tiktokLogo.png'; | ||
import styles from './SponsorCarousel.module.css'; | ||
|
||
const sponsors = [ | ||
{ | ||
company: 'Google', | ||
logo: GoogleLogo | ||
}, | ||
{ | ||
company: 'Amazon', | ||
logo: AmazonLogo | ||
}, | ||
{ | ||
company: 'Pearler', | ||
logo: PearlerLogo | ||
}, | ||
{ | ||
company: 'Canva', | ||
logo: CanvaLogo | ||
}, | ||
{ | ||
company: 'Jane Street', | ||
logo: JaneStreetLogo | ||
}, | ||
{ | ||
company: 'Atlassian', | ||
logo: AtlassianLogo | ||
company: 'TikTok', | ||
logo: TikTokLogo | ||
} | ||
]; | ||
|
||
const SponsorCarousel = () => { | ||
const Images = () => { | ||
return ( | ||
<div> | ||
<div className="relative overflow-hidden grow-0 shrink-0 basis-[230px]"> | ||
<div className={styles.carouselBarLeft} /> | ||
<div className="relative w-[1450px] h-[100px] my-10 grow-0 shrink-0 basis-auto"> | ||
<div className={`${styles.sponsorContainer} ${styles.carouselAnimationFirst}`}> | ||
{sponsors.map(({ company, logo }) => ( | ||
<div className="grow-1 shrink-1 basis-[200px] min-w-0 m-5" key={company}> | ||
<Image | ||
className="select-none pointer-events-none object-contain w-full" | ||
width={100} | ||
height={100} | ||
src={logo} | ||
loading="lazy" | ||
alt={company} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
<div className={`${styles.sponsorContainer} ${styles.carouselAnimationSecond}`}> | ||
{sponsors.map(({ company, logo }) => ( | ||
<div className="grow-1 shrink-1 basis-[200px] min-w-0 m-5" key={company}> | ||
<Image | ||
className="select-none pointer-events-none object-contain w-full" | ||
src={logo} | ||
width={100} | ||
height={100} | ||
loading="lazy" | ||
alt={company} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
<> | ||
{sponsors.map(({ company, logo }) => ( | ||
<div className="grow-1 shrink-1 basis-[200px] min-w-0 m-5" key={company}> | ||
<Image | ||
className="select-none pointer-events-none object-contain w-full" | ||
width={100} | ||
height={100} | ||
src={logo} | ||
loading="lazy" | ||
alt={company} | ||
/> | ||
</div> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
const DynamicSponsors = () => { | ||
return ( | ||
<div className="relative overflow-hidden grow-0 shrink-0 basis-[230px]"> | ||
<div className={styles.carouselBarLeft} /> | ||
<div className="relative w-[1450px] h-[100px] my-10 grow-0 shrink-0 basis-auto"> | ||
<div className={`${styles.sponsorContainer} ${styles.carouselAnimationFirst}`}> | ||
<Images /> | ||
</div> | ||
<div className={`${styles.sponsorContainer} ${styles.carouselAnimationSecond}`}> | ||
<Images /> | ||
</div> | ||
<div className={styles.carouselBarRight} /> | ||
</div> | ||
<div className={styles.carouselBarRight} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const StaticSponsors = () => { | ||
return ( | ||
<div className={styles.staticSponsorContainer}> | ||
<Images /> | ||
</div> | ||
); | ||
}; | ||
|
||
const SponsorCarousel = () => { | ||
return <div>{sponsors.length > 3 ? <DynamicSponsors /> : <StaticSponsors />}</div>; | ||
}; | ||
|
||
export default SponsorCarousel; |