Skip to content

Commit

Permalink
info: updated sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar-gg committed Aug 26, 2024
1 parent 0ea0bf0 commit 356afc2
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ type Props = {
const HomeSingleSponsor = (props: Props) => {
const tryRequire = (img_path: string) => {
try {
return require(`../../../../images/sponsors/${img_path}`);
return require(`../../../../images/sponsors/${img_path}`);
} catch (err) {
return placeholder;
}
};
const { sponsor } = props;

return (
<a
test-id="a1"
Expand All @@ -29,11 +30,32 @@ const HomeSingleSponsor = (props: Props) => {
target="_blank"
rel="noreferrer noopener"
>
<img
{props.large ? (
<img
className="sponsor-image-lg"
src={tryRequire(sponsor.img_path)}
alt={sponsor.name}
/>
) : (
<img
className="sponsor-image-md"
src={tryRequire(sponsor.img_path)}
alt={sponsor.name}
/>
)}

{/* <img
className="sponsor-image"
src={tryRequire(sponsor.img_path)}
alt={sponsor.name}
/>
src=""
style={{
backgroundImage: `url(${tryRequire(sponsor.img_path)})`,
backgroundSize: "cover",
backgroundPosition: "center",
height: "500px", // or specify a fixed height if needed
width: "auto", // or specify a fixed width if needed
}}
aria-label={sponsor.name}
/> */}
<div className="img-filter" />
</a>
);
Expand Down
59 changes: 56 additions & 3 deletions src/components/Home/HomeSponsors/HomeSponsors.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@
margin-right: auto;
}

.single-sponsor .sponsor-image-lg {
max-height: 20vh;
max-width: 30vh;
height: auto;
width: auto;
display: block;
margin-left: auto;
margin-right: auto;
}

.single-sponsor .sponsor-image-md {
max-height: 15vh;
max-width: 15vh;
height: auto;
width: auto;
display: block;
margin-left: auto;
margin-right: auto;
}

.center-items {
display: flex;
align-items: center;
}

.single-sponsor .img-filter {
opacity: 0;
background: rgba(250, 250, 250, 0.4);
Expand All @@ -26,13 +51,41 @@
@media (max-width: 1024px){

.single-sponsor .sponsor-image {
max-height: 8vh;
max-height: 6vh;
}
.single-sponsor .sponsor-image-lg {
max-height: 30vh;
max-width: 30vh;
height: auto;
width: auto;
content: center;
}
.single-sponsor .sponsor-image-md {
max-height: 20vh;
max-width: 20vh;
height: auto;
width: auto;
content: center;
}
}

@media (max-width: 768px){

.single-sponsor .sponsor-image {
max-height: 15vh;
/* .single-sponsor .sponsor-image {
max-height: 10vh;
} */

.single-sponsor .sponsor-image-lg {
max-height: 40vh;
max-width: 40vh;
height: auto;
width: auto;
}

.single-sponsor .sponsor-image-md {
max-height: 25vh;
max-width: 25vh;
height: auto;
width: auto;
}
}
25 changes: 21 additions & 4 deletions src/components/Home/HomeSponsors/HomeSponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,38 @@ type Props = {

const HomeSponsors = (props: Props) => {
const { sponsors } = props;
const sponsorLarge = sponsors.filter((sponsor) => sponsor.size === "L")
const sponsorMedium = sponsors.filter((sponsor) => sponsor.size === "M")

return (
<div className="home-sponsors-container">
<Row className="justify-content-sm-center">
<Col sm="10">
<Row className="justify-content-sm-center">
{sponsors.map((sponsor: SponsorType, index: number) => (
<Row className="justify-content-sm-center center-items">
{sponsorLarge.map((sponsor: SponsorType, index: number) => (
<Col
sm="12"
md="6"
lg="4"
key={index}
test-id={index}
className="sponsor-col"
>
<HomeSingleSponsor sponsor={sponsor} large={true}/>
</Col>
))}
</Row>
<Row className="justify-content-sm-center align-content-center">
{sponsorMedium.map((sponsor: SponsorType, index: number) => (
<Col
sm="12"
md="6"
lg="3"
lg="4"
key={index}
test-id={index}
className="sponsor-col"
>
<HomeSingleSponsor sponsor={sponsor} />
<HomeSingleSponsor sponsor={sponsor} large={false}/>
</Col>
))}
</Row>
Expand Down
29 changes: 25 additions & 4 deletions src/data/sponsors.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,38 @@
{
"name": "Tecnológico de Monterrey",
"img_path": "itesm.png",
"link": "https://tec.mx/es"
"link": "https://tec.mx/es",
"size": "L"
},
{
"name": "Dipole Digital",
"img_path": "dipole.png",
"link": "https://dipole.digital/",
"size": "L"
},
{
"name": "Acuity Brands",
"img_path": "acuity.png",
"link": "https://www.acuitybrands.com/",
"size": "L"
},
{
"name": "Diram",
"img_path": "diram.png",
"link": "https://www.diram.com/",
"size": "M"
},
{
"name": "Mitutoyo",
"img_path": "mitutoyo.png",
"link": "https://www.mitutoyo.com.mx/"
"link": "https://www.mitutoyo.com.mx/",
"size": "M"
},
{
"name": "atb",
"img_path": "ATB.png",
"link": "https://www.linkedin.com/in/aurotb/"
"img_path": "ATB2.png",
"link": "https://www.linkedin.com/in/aurotb/",
"size": "M"
}
],
"packages": [
Expand Down
Binary file added src/images/sponsors/ATB2.png
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/images/sponsors/acuity.png
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/images/sponsors/dipole.png
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/images/sponsors/diram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 356afc2

Please sign in to comment.