Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added sponsor section #80

Merged
merged 5 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions config/content/sponsors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
export default {
title: 'Sponsors',

titleSponsor: [
{
id: 1,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_9_rxhiki.png',
alt: 'MLH',
link: 'inno.nitrkl.in',
color: '#FFB8FF',
},
],

sponsors: [
{
id: 1,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_10_cutge9.png',
alt: 'Polygon',
type: 'Associate Sponsor',
link: 'inno.nitrkl.in',
color: '#5CFFA7',
},
{
id: 2,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_20_qn6b1d.png',
alt: 'Quine',
type: 'Media Sponsor',
link: 'inno.nitrkl.in',
color: '#E85CFF',
},
{
id: 3,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_20_qn6b1d.png',
alt: 'Quine',
type: 'Refreshments Sponsor',
link: 'inno.nitrkl.in',
color: '#5C9DFF',
},
{
id: 4,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_10_cutge9.png',
alt: 'Polygon',
type: 'Associate Sponsor',
link: 'inno.nitrkl.in',
color: '#5CFFA7',
},
{
id: 5,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_20_qn6b1d.png',
alt: 'Quine',
type: 'Media Sponsor',
link: 'inno.nitrkl.in',
color: '#E85CFF',
},
{
id: 6,
logo: 'https://res.cloudinary.com/dme9vltjf/image/upload/v1696249159/image_20_qn6b1d.png',
alt: 'Quine',
type: 'Refreshments Sponsor',
link: 'inno.nitrkl.in',
color: '#5C9DFF',
},
],
};
39 changes: 39 additions & 0 deletions src/components/SponsorSection/SponsorSection.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import {
SponsorContainer,
SponsorLogo,
SponsorSectionContainer,
SponsorText,
SponsorWrapper,
TitleSponsorContainer,
TitleSponsorLogo,
TitleSponsorWrapper,
} from './styles';
import Sponsors from '../../../config/content/sponsors';

const { titleSponsor, sponsors } = Sponsors;
const SponsorSection = () => (
<SponsorSectionContainer>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap it inside section layout see FAQ section.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shurtu-gal I've made the changes. Please review the PR

<TitleSponsorWrapper>
{titleSponsor.map(({ id, logo, alt, link, color }) => (
<TitleSponsorContainer key={id}>
<a href={link} target='_blank noopener noreferer'>
<TitleSponsorLogo src={logo} alt={alt} />
<SponsorText color={color}>Title Sponsor</SponsorText>
</a>
</TitleSponsorContainer>
))}
</TitleSponsorWrapper>
<SponsorWrapper>
{sponsors.map(({ id, logo, alt, link, type, color }) => (
<SponsorContainer key={id}>
<a href={link} target='_blank noopener noreferer'>
<SponsorLogo src={logo} alt={alt} />
<SponsorText color={color}>{type}</SponsorText>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a gap b/w them.

</a>
</SponsorContainer>
))}
</SponsorWrapper>
</SponsorSectionContainer>
);
export default SponsorSection;
106 changes: 106 additions & 0 deletions src/components/SponsorSection/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import styled from 'styled-components';
import tw from 'twin.macro';

export const SponsorSectionContainer = styled.div`
${tw`
flex
flex-col
w-[90%]
mx-auto
`}
`;

export const TitleSponsorWrapper = styled.div`
${tw`
flex
justify-around
`}
`;

export const TitleSponsorContainer = styled.div`
${tw`
flex
flex-col
gap-[32px]
text-center
w-[320px]
`}
@media (max-width: 1100px) {
width: 240px;
}
`;

export const TitleSponsorLogo = styled.img`
${tw`
w-full
my-auto
`}
`;
export const SponsorText = styled.p`
color: ${(props) => props.color || '#D0D0D0'};

font-family:
Noto Sans,
sans-serif;
font-size: 24px;
font-style: normal;
font-weight: 600;
line-height: 42px;
width: 100%;
@media (max-width: 1100px) {
line-height: 26px;
text-align: center;
font-size: 16px;
}
`;

export const SponsorWrapper = styled.div`
${tw`
grid
grid-cols-3
gap-[79px]

`}
row-gap: 42px;
@media (max-width: 1100px) {
grid-template-columns: repeat(2, 1fr);
gap: 42px;
justify-content: space-between;
row-gap: 32px;
}
@media (max-width: 280px) {
grid-template-columns: repeat(1, 1fr);
gap: 32px;
justify-content: space-between;
}
`;

export const SponsorContainer = styled.div`
${tw`
flex
flex-col
gap-[32px]
text-center
w-[320px]
col-span-1
mx-auto
items-center
mt-[42px]
`}
@media (max-width: 780px) {
width: 240px;
margin-top: 32px;
}

@media (max-width: 580px) {
width: 120px;
margin-top: 32px;
}
`;

export const SponsorLogo = styled.img`
${tw`
w-full
my-auto
`}
`;
5 changes: 2 additions & 3 deletions src/pages/playground.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable jsx-a11y/click-events-have-key-events */
import React from 'react';
import { Helmet } from 'react-helmet';
import { About } from '../components/shared';
import AboutUs from '../../config/content/AboutUs';
import SponsorSection from '../components/SponsorSection/SponsorSection';

const Playground = () => (
<>
Expand All @@ -11,7 +10,7 @@ const Playground = () => (
<title>Playground</title>
<meta name='description' content='This is playground' />
</Helmet>
<About title={AboutUs.title} desc={AboutUs.desc} link={AboutUs.link} />
<SponsorSection />
</>
);

Expand Down
Loading