Skip to content

Commit ca6c1c9

Browse files
authored
Merge pull request #16 from csesoc/CW2-28_Create_modal_on_sponsor_click
CW2 28 create modal on sponsor click
2 parents b0e4bfb + 789d282 commit ca6c1c9

File tree

6 files changed

+193
-85
lines changed

6 files changed

+193
-85
lines changed

frontend/public/data/data.ts

+42-23
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export type sponsorInfo = {
22
href: string;
33
svg: string;
44
alt: string;
5+
description: string;
56
};
67

78
export type socialInfo = {
@@ -14,103 +15,121 @@ export const diamondLinks: sponsorInfo[] = [
1415
{
1516
href: 'https://www.janestreet.com/',
1617
svg: 'assets/janestreet_logo.svg',
17-
alt: 'Janestreet logo'
18+
alt: 'Janestreet logo',
19+
description: "Jane Street is a research-driven trading firm where curious people work together on deep problems",
1820
},
1921
{
2022
href: 'https://www.tiktok.com/en/',
2123
svg: 'assets/tiktok_logo.svg',
22-
alt: 'Tiktok logo'
24+
alt: 'Tiktok logo',
25+
description: "TikTok is a social media platform for creating, sharing and discovering short videos",
26+
2327
}
2428
];
2529

2630
export const goldLinks: sponsorInfo[] = [
2731
{
2832
href: 'https://www.atlassian.com/',
2933
svg: 'assets/atlassian_logo.svg',
30-
alt: 'Atlassian logo'
34+
alt: 'Atlassian logo',
35+
description: "Atlassian Corporation is an Australian-American software company that develops products for software developers, and project managers among other groups",
36+
3137
},
3238
{
3339
href: 'https://www.citadel.com/',
3440
svg: 'assets/citadel_logo.svg',
35-
alt: 'Citadel logo'
41+
alt: 'Citadel logo',
42+
description: "We are an alternative investment manager working on behalf of the world's preeminent institutions. Discover our work, teams, careers and more",
3643
},
3744
{
3845
href: 'https://www.imc.com/ap/',
3946
svg: 'assets/imc_logo.svg',
40-
alt: 'IMC logo'
47+
alt: 'IMC logo',
48+
description: "For three decades IMC has provided liquidity to the financial markets globally. Specialised in algorithmic trading and advanced technology, we set the pace for the evolution of market making.",
49+
4150
},
4251
{
4352
href: 'https://neara.com/',
4453
svg: 'assets/neara_logo.svg',
45-
alt: 'Neara logo'
54+
alt: 'Neara logo',
55+
description: "Neara electric utility software is a physics-enabled platform that builds 3D interactive models of critical infrastructure networks and assets.",
56+
4657
},
4758
{
4859
href: 'https://safetyculture.com/',
4960
svg: 'assets/safetyculture_logo.svg',
50-
alt: 'SafetyCulture logo'
51-
},
52-
{
53-
href: 'https://www.thetradedesk.com/',
54-
svg: 'assets/The_Trade_Desk.svg',
55-
alt: 'TradeDesk logo'
61+
alt: 'SafetyCulture logo',
62+
description: "Get to the root cause of workplace trends with total visibility across your organization. Use data from completed inspections, reported incidents, sensors, and asset history to keep workers safe, and prevent things from happening in the first place"
5663
}
5764
];
5865

5966
export const silverLinks: sponsorInfo[] = [
6067
{
6168
href: 'https://appian.com/',
6269
svg: 'assets/appian_logo.svg',
63-
alt: 'Appian logo'
70+
alt: 'Appian logo',
71+
description: "Appian Corporation is an American cloud computing and enterprise software company headquartered in McLean, Virginia, part of the Dulles Technology Corridor. The company sells a platform as a service for building enterprise software applications",
6472
},
6573
{
6674
href: 'https://www.flowtraders.com/',
6775
svg: 'assets/flowtraders_logo.svg',
68-
alt: 'FlowTraders logo'
76+
alt: 'FlowTraders logo',
77+
description: "Flow Traders is a proprietary trading firm. A market maker, it provides liquidity in the securities market by using high frequency and quantitative trading strategies",
6978
},
7079
{
7180
href: 'https://www.macquarie.com.au/',
7281
svg: 'assets/macquarie_logo.svg',
73-
alt: 'Macquarie logo'
82+
alt: 'Macquarie logo',
83+
description: "Macquarie Bank offers transaction accounts, home loans, credit cards, online banking, business banking and more"
84+
7485
},
7586
{
7687
href: 'https://optiver.com/',
7788
svg: 'assets/optiver_logo.svg',
78-
alt: 'Optiver logo'
89+
alt: 'Optiver logo',
90+
description: "Optiver is a global market maker. As one of the oldest market making firms in the world, Optiver has been improving financial markets since 1986"
7991
},
8092
{
8193
href: 'https://quantium.com/',
8294
svg: 'assets/quantium_logo.svg',
83-
alt: 'Quantium logo'
95+
alt: 'Quantium logo',
96+
description: "Quantium has developed a world-class data science and AI solution that has transformed the accuracy of Walmart's prediction of customers' needs at scale"
8497
},
8598
{
8699
href: 'https://quickli.com.au/',
87100
svg: 'assets/quickli_logo.svg',
88-
alt: 'Quickli logo'
101+
alt: 'Quickli logo',
102+
description: "Bringing 30+ lender calcs into one, easy-to-use interface delivering accurate results and relevant policy insights for even the most complex scenarios."
89103
},
90104
{
91105
href: 'https://www.revolutionise.com.au/',
92106
svg: 'assets/revsport_logo.svg',
93-
alt: 'RevolutioniseSport logo'
107+
alt: 'RevolutioniseSport logo',
108+
description: "revolutioniseSPORT is an online management platform for sports of all shapes and sizes"
94109
},
95110
{
96111
href: 'https://www.recordpoint.com/',
97112
svg: 'assets/recordpoint_logo.svg',
98-
alt: 'RecordPoint logo'
113+
alt: 'RecordPoint logo',
114+
description: "Manage all your data and records in one central place – without moving them",
99115
},
100116
{
101117
href: 'https://sig.com/',
102118
svg: 'assets/susquehanna_logo.svg',
103-
alt: 'Susquehanna logo'
119+
alt: 'Susquehanna logo',
120+
description: "Discover Susquehanna, a global quantitative trading firm built on a rigorous, analytical foundation in financial markets."
104121
},
105122
{
106123
href: 'https://zip.co/au',
107124
svg: 'assets/zip_logo.svg',
108-
alt: 'Zip logo'
125+
alt: 'Zip logo',
126+
description: "Zip Co Limited is a global 'buy now pay later' financial technology company with operations in Australia, New Zealand and the USA",
109127
},
110128
{
111129
href: 'https://www.canva.com/en_au/',
112130
svg: 'assets/canva_logo.svg',
113-
alt: 'Canva logo'
131+
alt: 'Canva logo',
132+
description: "Canva is a free-to-use online graphic design tool. Use it to create social media posts, presentations, posters, videos, logos and more."
114133
}
115134
];
116135

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import { useState } from 'react';
2+
import { diamondLinks, goldLinks, silverLinks, sponsorInfo } from '../../../public/data/data';
3+
import SponsorModal from './SponsorModal';
4+
5+
//import '/styles/sponsorLinks.module.css';
6+
const logostyle = 'grow-on-hover cursor-pointer transform transition-transform duration-300 hover:scale-105';
7+
const logodiv = 'block gap-y-8 h-14';
8+
const background = 'rgba(57, 119, 248, 0.6)';
9+
// const outer = 'rounded-[4rem] w-[90rem] flex flex-col pl-14 py-14 gap-16';
10+
11+
function SponsorLinks() {
12+
const [showModal, setShowModal] = useState(false);
13+
const [information, setInformation] = useState<sponsorInfo | null>(null);
14+
15+
return (
16+
<div className="flex justify-center items-center my-20">
17+
<div className="w-100 flex flex-col gap-16">
18+
{showModal && (
19+
<SponsorModal
20+
sponsorInfo={information}
21+
setFalse={() => {
22+
setShowModal(false);
23+
}}
24+
/>
25+
)}
26+
<div
27+
style={{ backgroundColor: `${background}` }}
28+
className="flex flex-wrap rounded-[1rem] pl-14 py-14 gap-16 items-center"
29+
>
30+
<h2 className="text-4xl font-black">Diamond Sponsors</h2>
31+
{diamondLinks.map((item, index) => {
32+
return (
33+
<div
34+
key={index}
35+
className={`${logodiv}`}
36+
onClick={() => {
37+
setInformation(item);
38+
setShowModal(true);
39+
}}
40+
>
41+
<img className={`h-14 ${logostyle}`} src={item.svg} alt={item.alt} />
42+
</div>
43+
);
44+
})}
45+
</div>
46+
<div
47+
style={{ backgroundColor: `${background}` }}
48+
className="flex flex-wrap rounded-[1rem] px-14 py-14 gap-16 items-center"
49+
>
50+
<h2 className="text-4xl font-black">Gold Sponsors</h2>
51+
{goldLinks.map((item, index) => {
52+
return (
53+
<div
54+
key={index}
55+
className=""
56+
onClick={() => {
57+
setInformation(item);
58+
setShowModal(true);
59+
}}
60+
>
61+
<img className={`h-6 ${logostyle}`} src={item.svg} alt={item.alt} />
62+
</div>
63+
);
64+
})}
65+
</div>
66+
<div
67+
style={{ backgroundColor: `${background}` }}
68+
className="flex flex-wrap rounded-[1rem] px-14 py-14 gap-16 items-center"
69+
>
70+
<h2 className="text-4xl font-black">Silver Sponsors</h2>
71+
{silverLinks.map((item, index) => {
72+
return (
73+
<div
74+
key={index}
75+
className="h-14"
76+
onClick={() => {
77+
setInformation(item);
78+
setShowModal(true);
79+
}}
80+
>
81+
<img className={`h-8 ${logostyle}`} src={item.svg} alt={item.alt} />
82+
</div>
83+
);
84+
})}
85+
</div>
86+
</div>
87+
</div>
88+
);
89+
}
90+
91+
export default SponsorLinks;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { sponsorInfo } from '../../../public/data/data';
2+
import {motion} from 'framer-motion'
3+
export default function SponsorModal(props: { sponsorInfo: sponsorInfo | null; setFalse: () => void }) {
4+
if (props.sponsorInfo === null) {
5+
return (
6+
<div>
7+
<h1>Error no sponsor selected!</h1>
8+
</div>
9+
);
10+
}
11+
return (
12+
<div
13+
className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50"
14+
onClick={() => {
15+
props.setFalse();
16+
}}
17+
>
18+
19+
<div className="bg-[#3977f8] relative w-[800px] h-[550px] mb-10 mx-10 rounded-xl flex flex-col items-center justify-center">
20+
<motion.a
21+
whileHover={{
22+
scale: 1.2,
23+
transition: { duration: 0.2 },
24+
}}
25+
className="w-4/5 m-10 flex flex-col items-center justify-center"
26+
href={props.sponsorInfo.href}
27+
target="_blank"
28+
>
29+
<img className='w-4/5 max-w-[300px] max-h-[200px]' src={`./${props.sponsorInfo.svg}`} alt={props.sponsorInfo.alt} />
30+
</motion.a >
31+
<h3 className="mx-10 py-10">{props.sponsorInfo.description}</h3>
32+
<button
33+
onClick={props.setFalse}
34+
className="bg-white border absolute bottom-10 text-[#3977F8] border-[#A7A6E5] text-lg rounded-xl w-[70%] xl:h-12 h-10"
35+
>
36+
Close
37+
</button>
38+
</div>
39+
</div>
40+
);
41+
}

frontend/src/components/Sponsors/sponsorlinks.tsx

-56
This file was deleted.

frontend/src/pages/sponsors.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import SponsorLinks from '@/components/Sponsors/sponsorlinks';
21
import Navbar from '@/components/Navbar';
32
import Footer from '@/components/Footer';
3+
import SponsorLinks from '@/components/Sponsors/SponsorLinks';
44

55
export default function SponsorsPage() {
66
return (

frontend/tsconfig.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"strict": true,
@@ -14,9 +18,18 @@
1418
"jsx": "preserve",
1519
"incremental": true,
1620
"paths": {
17-
"@/*": ["./src/*"]
18-
}
21+
"@/*": [
22+
"./src/*"
23+
]
24+
},
25+
"forceConsistentCasingInFileNames": true
1926
},
20-
"include": ["./next-env.d.ts", "**/*.ts", "**/*.tsx"],
21-
"exclude": ["node_modules"]
27+
"include": [
28+
"./next-env.d.ts",
29+
"**/*.ts",
30+
"**/*.tsx"
31+
],
32+
"exclude": [
33+
"node_modules"
34+
]
2235
}

0 commit comments

Comments
 (0)