-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from TaigaChang/task]-list-sponsors-of-codewit…
- Loading branch information
Showing
7 changed files
with
91 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import Image from "next/image"; | ||
import { getSponsors } from "@/data/webData"; | ||
|
||
const Sponsers = () => { | ||
const [sponsors, setSponsors] = useState([]); | ||
|
||
useEffect(() => { | ||
setSponsors(getSponsors()); | ||
}, []); | ||
|
||
const handleSponsorImageClick = (url) => { | ||
window.open(url, "_blank"); | ||
}; | ||
|
||
return ( | ||
<div className="pt-20"> | ||
<h2 className="text-4xl xl:text-7xl pt-10 drop-shadow-xl text-center py-20"> | ||
Sponsors | ||
</h2> | ||
|
||
<div className="flex items-center justify-center pb-40"> | ||
{sponsors.map((sponsor) => ( | ||
<Image | ||
onClick={() => handleSponsorImageClick(sponsor.url)} | ||
key={sponsor.id} | ||
alt={sponsor.alt} | ||
src={sponsor.src} | ||
width={sponsor.width} | ||
height={sponsor.height} | ||
className={sponsor.className} | ||
style={{ cursor: "pointer" }} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Sponsers; |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.