Skip to content

Commit a12aca0

Browse files
committed
added modal popup
1 parent 5bc88d0 commit a12aca0

File tree

3 files changed

+73
-11
lines changed

3 files changed

+73
-11
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { setFlagsFromString } from 'v8';
2+
import { sponsorInfo } from '../../../public/data/data';
3+
//@ts-ignore
4+
export default function SponsorModal(props: { sponsorInfo: sponsorInfo | null; setFalse: any }) {
5+
if (props.sponsorInfo === null) {
6+
return (
7+
<div>
8+
<h1>Error no sponsor selected!</h1>
9+
</div>
10+
);
11+
}
12+
return (
13+
<div
14+
className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"
15+
onClick={() => {
16+
props.setFalse();
17+
}}
18+
>
19+
<div className="bg-[#3977f8] mx-[10vw] py-10 rounded-xl overflow-auto flex flex-col items-center justify-center w-[800px]">
20+
<a className='m-10' href={props.sponsorInfo.href}>
21+
<img src={`./${props.sponsorInfo.svg}`} alt={props.sponsorInfo.alt} />
22+
</a>
23+
<h3 className="mx-10 py-10">{props.sponsorInfo.description}</h3>
24+
<button onClick={props.setFalse} className='bg-white border text-[#3977F8] border-[#A7A6E5] text-lg rounded-xl w-[70%] xl:h-12 h-10'>close</button>
25+
</div>
26+
</div>
27+
);
28+
}

frontend/src/components/Sponsors/sponsorlinks.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
1-
import { diamondLinks, goldLinks, silverLinks } from '../../../public/data/data';
1+
import { useState } from 'react';
2+
import { diamondLinks, goldLinks, silverLinks, sponsorInfo } from '../../../public/data/data';
3+
import SponsorModal from './sponsorModal';
24
//import '/styles/sponsorLinks.module.css';
35
const logostyle = 'h-14';
46
const logodiv = 'block gap-y-8 h-14';
57
const background = 'rgba(57, 119, 248, 0.6)';
68
// const outer = 'rounded-[4rem] w-[90rem] flex flex-col pl-14 py-14 gap-16';
79

10+
11+
812
function SponsorLinks() {
13+
const [showModal, setShowModal] = useState(false);
14+
const [information, setInformation] = useState<sponsorInfo | null>(null);
15+
916
return (
1017
<div className="flex justify-center items-center my-20">
11-
<div className="w-100 flex flex-col gap-16">
18+
<div className="w-100 flex flex-col gap-16" >
19+
{/* @ts-ignore */}
20+
{showModal && <SponsorModal sponsorInfo={information} setFalse={() => {setShowModal(false)}}/>}
1221
<div
1322
style={{ backgroundColor: `${background}` }}
1423
className="flex flex-wrap rounded-[1rem] pl-14 py-14 gap-16 items-center"
1524
>
1625
<h2 className="text-4xl font-black">Diamond Sponsors</h2>
1726
{diamondLinks.map((item, index) => {
1827
return (
19-
<a key={index} className={`${logodiv}`} href={item.href}>
28+
<div key={index} className={`${logodiv}`}
29+
// href={item.href}
30+
onClick={() => {
31+
setInformation(item);
32+
setShowModal(true);
33+
}}
34+
>
2035
<img className={`${logostyle}`} src={item.svg} alt={item.alt} />
21-
</a>
36+
</div>
2237
);
2338
})}
2439
</div>
@@ -29,9 +44,15 @@ function SponsorLinks() {
2944
<h2 className="text-4xl font-black">Gold Sponsors</h2>
3045
{goldLinks.map((item, index) => {
3146
return (
32-
<a key={index} className="" href={item.href}>
47+
<div key={index} className=""
48+
onClick={() => {
49+
setInformation(item);
50+
setShowModal(true);
51+
}}
52+
// href={item.href}
53+
>
3354
<img className="h-6" src={item.svg} alt={item.alt} />
34-
</a>
55+
</div>
3556
);
3657
})}
3758
</div>

frontend/tsconfig.json

Lines changed: 18 additions & 5 deletions
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)