diff --git a/frontend/package-lock.json b/frontend/package-lock.json index cebf6c7..176abf9 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -20,6 +20,7 @@ "postcss": "8.4.29", "react": "18.2.0", "react-dom": "18.2.0", + "react-multi-carousel": "^2.8.5", "tailwindcss": "3.3.3", "typescript": "5.1" }, @@ -4141,6 +4142,14 @@ "url": "https://github.com/sponsors/gregberge" } }, + "node_modules/react-multi-carousel": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/react-multi-carousel/-/react-multi-carousel-2.8.5.tgz", + "integrity": "sha512-C5DAvJkfzR2JK9YixZ3oyF9x6R4LW6nzTpIXrl9Oujxi4uqP9SzVVCjl+JLM3tSdqdjAx/oWZK3dTVBSR73Q+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 7aea3ff..d04ed3b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -25,6 +25,7 @@ "postcss": "8.4.29", "react": "18.2.0", "react-dom": "18.2.0", + "react-multi-carousel": "^2.8.5", "tailwindcss": "3.3.3", "typescript": "5.1" }, diff --git a/frontend/src/components/About/AboutHomepage.tsx b/frontend/src/components/About/AboutHomepage.tsx index 31975b4..42c3659 100644 --- a/frontend/src/components/About/AboutHomepage.tsx +++ b/frontend/src/components/About/AboutHomepage.tsx @@ -14,7 +14,7 @@ export default function AboutHomePage() { CSESoc Icon

CSESoc

- + {/* RIGHT SIDE */}
diff --git a/frontend/src/components/Sponsors/SponsorCarousel.tsx b/frontend/src/components/Sponsors/SponsorCarousel.tsx new file mode 100644 index 0000000..ea13c4e --- /dev/null +++ b/frontend/src/components/Sponsors/SponsorCarousel.tsx @@ -0,0 +1,51 @@ +import { diamondLinks, goldLinks } from "@/../public/data/sponsorInfos"; +import Carousel from 'react-multi-carousel'; +import 'react-multi-carousel/lib/styles.css'; + +export default function SponsorCarousel() { + const responsive = { + superLargeDesktop: { + breakpoint: { max: 4000, min: 1024 }, + items: 3, + }, + desktop: { + breakpoint: { max: 1024, min: 768 }, + items: 3, + }, + tablet: { + breakpoint: { max: 768, min: 464 }, + items: 2, + }, + mobile: { + breakpoint: { max: 464, min: 0 }, + items: 1, + }, + }; + + // Show diamond and gold sponsors in carousel + const sponsors = diamondLinks.concat(goldLinks); + + return ( + + {sponsors.map((sponsor, index) => ( +
+ {sponsor.alt} +
+ ))} +
+ ); +} \ No newline at end of file diff --git a/frontend/src/components/Sponsors/index.tsx b/frontend/src/components/Sponsors/index.tsx index 4ccc6cf..f68583f 100644 --- a/frontend/src/components/Sponsors/index.tsx +++ b/frontend/src/components/Sponsors/index.tsx @@ -1,50 +1,27 @@ import React from 'react'; import Footer from '@/components/Footer'; +import SponsorCarousel from './SponsorCarousel'; const Sponsors = () => { - const firstRowBoxesStyling = - 'xl:p-16 p-10 flex justify-center items-center xl:col-span-3 sm:col-span-5 col-span-10 xl:row-start-1 xl:row-end-2 sm:row-start-3 sm:row-end-4 sm:h-auto h-36'; - const secondRowBoxesStyling = - 'xl:p-16 p-10 flex justify-center items-center xl:col-span-3 sm:col-span-5 col-span-10 xl:row-start-2 xl:row-end-3 sm:row-start-4 sm:row-end-5 sm:h-auto h-36'; - return (
-

SUPPORT CSESOC

+

OUR SPONSORS

-
+
-
-
-

Our sponsors

-

Check out our very cool sponsors.

- - - -
-
-
- Atlassian logo -
-
- Google logo -
-
- Freelancer logo -
-
diff --git a/frontend/src/pages/about/index.tsx b/frontend/src/pages/about/index.tsx index 48109ab..7bdcd0f 100644 --- a/frontend/src/pages/about/index.tsx +++ b/frontend/src/pages/about/index.tsx @@ -17,7 +17,7 @@ export default function AboutPage() {

CSESoc

unsw-computer-science-engineering-society

- +

diff --git a/frontend/src/pages/sponsors.tsx b/frontend/src/pages/sponsors.tsx index 9a1287e..b22271c 100644 --- a/frontend/src/pages/sponsors.tsx +++ b/frontend/src/pages/sponsors.tsx @@ -10,30 +10,27 @@ export default function SponsorsPage() { const [showModal, setShowModal] = useState(false); const [information, setInformation] = useState(null); + const handleSponsorClick = (info: sponsorInfo) => { + setInformation(info); + setShowModal(true); + }; + return (

-

Diamond Sponsors

+

DIAMOND SPONSORS

{showModal && ( { - setShowModal(false); - }} + setFalse={() => setShowModal(false)} /> )}
{diamondLinks.map((item, index) => { return ( -
{ - setInformation(item); - setShowModal(true); - }} - > +
handleSponsorClick(item)}> {item.alt}
); @@ -41,36 +38,24 @@ export default function SponsorsPage() {
-

Gold Sponsors

+

GOLD SPONSORS

{goldLinks.map((item, index) => { return ( -
{ - setInformation(item); - setShowModal(true); - }} - > +
handleSponsorClick(item)}> {item.alt}
); })}
-

Silver Sponsors

+

SILVER SPONSORS

{silverLinks.map((item, index) => { return ( -
{ - setInformation(item); - setShowModal(true); - }} - > +
handleSponsorClick(item)}> {item.alt}
); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..14ab158 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "csesoc-website-2023", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}