Skip to content

Commit

Permalink
feat: add sponsors for 2024 edition (#65)
Browse files Browse the repository at this point in the history
* Turing Cup  2k24

* faqs updated

* Update Faqs.js

Review rectified

* sponsors added
  • Loading branch information
Thoparam-sai-nithish authored Feb 18, 2024
1 parent c258bab commit 1c8a167
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 51 deletions.
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.3",
"@mui/material": "^5.10.4",
"add-to-calendar-button": "^2.1.2",
"add-to-calendar-button": "^2.5.10",
"gatsby": "^4.22.1",
"gatsby-plugin-image": "^2.22.0",
"gatsby-plugin-sharp": "^4.23.0",
Expand Down
Binary file added src/assets/images/sponsors24/canauzOverseas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/sponsors24/stTribe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/assets/sponsors24.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"sponsors": [
{
"name": " CanAuz Overseas Careers",
"image": "canauzOverseas.png",
"details": "Canauz Overseas is a visa assistance and immigration consultancy company in Hyderabad, India. They offer a range of services, including visa processing.",
"link": "https://canauzoverseas.com/"
},
{
"name": "Student Tribe",
"image": "stTribe.png",
"details": "Student Tribe is a vibrant community of undergraduate students from across India, fostering collaboration, innovation, and academic excellence.",
"link": "https://studenttribe.in/"
}
]
}

1 change: 1 addition & 0 deletions src/components/TuringCup/LandingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function LandingPage() {
borderRadius={2}
padding={1}
style={styles.backDrop}

>
EDITION 2K22
</Typography>
Expand Down
19 changes: 11 additions & 8 deletions src/components/TuringCup/Landingpage2.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Button, Grid, Stack } from "@mui/material";
import HowToRegRoundedIcon from "@mui/icons-material/HowToRegRounded";
// import InsertInvitationRoundedIcon from "@mui/icons-material/InsertInvitationRounded";
import InsertInvitationRoundedIcon from "@mui/icons-material/InsertInvitationRounded";
// npm install add-to-calendar-button to avail features of add to calendar.
import { atcb_action } from "add-to-calendar-button";

import React from "react";
import "./LandingPage2.css";
import TuringCupSponsors from "./TuringCupSponsors";
function Landingpage2() {
const config = {
name: "[Reminder] Turing Cup 2K23 Round - 1",
Expand All @@ -17,9 +18,9 @@ function Landingpage2() {
timeZone: "Asia/Calcutta"
};

// const handleClick = () => {
// atcb_action(config, document.getElementById("add-to-calendar-btn"));
// };
const handleClick = () => {
atcb_action(config, document.getElementById("add-to-calendar-btn"));
};

return (
<Grid
Expand Down Expand Up @@ -75,7 +76,7 @@ function Landingpage2() {
Register Now
</Button>

{/* <Button
<Button
sx={{
fontFamily: ['"Gruppo"', "cursive"].join(","),
backgroundColor: "#101820FF",
Expand All @@ -84,18 +85,20 @@ function Landingpage2() {
"&:hover": {
backgroundColor: "#F2AA4CFF",
color: "#fff"
}
}
}}
id="add-to-calendar-btn"
onClick={handleClick}
variant="contained"
endIcon={<InsertInvitationRoundedIcon />}
>
Add to Calendar
</Button> */}
</Button>
</Stack>


</Grid>
);
}

export default Landingpage2;
export default Landingpage2;
20 changes: 10 additions & 10 deletions src/components/TuringCup/OurSponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { GatsbyImage } from "gatsby-plugin-image";
import "./SponsorsCard.css";

function OurSponsors({ name, img, desc, link }) {
// const [isFlipped, setIsFlipped] = useState(true);
// const [open, setOpen] = React.useState(false);
// const handleOpen = () => setOpen(true);
// const handleClose = () => setOpen(false);
const [isFlipped, setIsFlipped] = useState(true);
const [open, setOpen] = React.useState(false);
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
return (
<div>
{/* <Button
Expand All @@ -23,8 +23,8 @@ function OurSponsors({ name, img, desc, link }) {
}}
// ENABLE THIS FOR MODAL
// onClick={handleOpen}
href={link}
target="_blank"
// href={link}
// target="_blank"
>
<GatsbyImage
alt={name}
Expand All @@ -37,14 +37,14 @@ function OurSponsors({ name, img, desc, link }) {
padding : "5px"
}}
/>
</Button>
</Button> */}
<Modal
open={open}
onClose={handleClose}
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
>
<Box sx={style}>
<Box>
<h1>{name}</h1>
<Button id = "x" onClick={handleClose}>
X
Expand All @@ -66,7 +66,7 @@ function OurSponsors({ name, img, desc, link }) {
Know more!
</Button>
</Box>
</Modal> */}
</Modal>
<div className="SponsorBox">
<div className="SponsorFlipBox">
<div className="SponsorFront">
Expand All @@ -81,7 +81,7 @@ function OurSponsors({ name, img, desc, link }) {
image={img}
style={{
maxWidth: "100%",
maxHeight: "100%",
height: "100%",
borderRadius: "30px"
// border: "2px solid #F2AA4CFF",
// padding: "5px"
Expand Down
2 changes: 1 addition & 1 deletion src/components/TuringCup/PastContests.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function PastContests() {
return (
<>
<h2
style={{ textAlign: "center", color: "#F2AA4CFF", marginTop: "50px" }}
style={{textAlign: "center", color: "#F2AA4CFF", marginTop: "50px" }}
>
PREVIOUS EDITIONS
</h2>
Expand Down
24 changes: 12 additions & 12 deletions src/components/TuringCup/TuringCupSponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import { styled } from "@mui/material/styles";
// import { GatsbyImage, getImage } from "gatsby-plugin-image";
import { graphql, useStaticQuery } from "gatsby";
// /turingcupSponsors
import sponsordata from "../../assets/sponsors23.json";
import sponsordata from "../../assets/sponsors24.json";
import SponsorCard from "../../components/TuringCup/OurSponsors";

// import Logo from "../components/TuringCupPrizePool"

const Item = styled(Paper)(({ theme }) => ({
Expand All @@ -18,14 +17,14 @@ const Item = styled(Paper)(({ theme }) => ({

export default function TuringCupSponsors() {
const data = useStaticQuery(graphql`
query SponsorQuery {
allFile(filter: { relativeDirectory: { eq: "sponsors23" } }) {
query SponsorQuery {
allFile(filter: { relativeDirectory: { eq: "sponsors24" } }) {
edges {
node {
childImageSharp {
gatsbyImageData(
width: 300
height: 300
width: 1000
height: 1000
blurredOptions: { width: 100 }
placeholder: BLURRED
transformOptions: { fit: COVER }
Expand All @@ -37,34 +36,35 @@ export default function TuringCupSponsors() {
}
`);
const nodes = data.allFile.edges;
console.log("nodes :",nodes);
return (
<Box
sx={{
margin: "0 auto"
margin: "50px auto"
}}
>
<h2 style={{ textAlign: "center", color: "#F2AA4CFF" }}>OUR SPONSORS</h2>
<h2 style={{ textAlign: "center", color: "#F2AA4CFF" }}>OUR SPONSORS </h2>
<Stack
direction={{ xs: "column", sm: "row" }}
spacing={{ xs: 1, sm: 2, md: 4 }}
justifyContent="space-around"
alignItems="center"
>
{sponsordata["sponsors"].map((sponsor, i) => {
console.log(nodes);
const result = nodes.filter(item => {
const src =
item.node?.childImageSharp?.gatsbyImageData.images.fallback.src;
item?.node?.childImageSharp?.gatsbyImageData.images.fallback.src;
var filepath = /[^/]*$/.exec(src)[0];
// console.log(src, filepath, sponsor.image);
return filepath === sponsor.image;
});
// console.log(result);
// console.log('result :',result);
let image;
if (result.length === 1) {
image = result[0].node.childImageSharp.gatsbyImageData;
// console.log(image)
} else {
console.log("Something is wrong");
console.log("Something is wrong in TurinCupSponsors.js");
}
return (
<Item key={i}>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/turingcup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "../components/TuringCup/turingcup.css";
import PastContests from "../components/TuringCup/PastContests";
// import Timers from "../components/TuringCup/Timers";
// import TuringCupPrizePool from "../components/TuringCup/TuringCupPrizePool";
// import TuringCupSponsors from '../components/TuringCup/TuringCupSponsors';
import TuringCupSponsors from '../components/TuringCup/TuringCupSponsors';
import { Box } from "@mui/material";
import { createTheme } from "@mui/material/styles";
import Landingpage2 from "../components/TuringCup/Landingpage2";
Expand Down Expand Up @@ -44,7 +44,7 @@ function turingcup() {
{/* <Timers /> */}
{/* <Timelinee /> */}
{/* <TuringCupPrizePool /> */}
{/* <TuringCupSponsors /> */}
<TuringCupSponsors/>
<PastContests />
<Faqs />
</Box>
Expand Down

0 comments on commit 1c8a167

Please sign in to comment.