Skip to content

Commit

Permalink
changed <img /> to <StaticImage /> to improve performance
Browse files Browse the repository at this point in the history
Signed-off-by: Yaten Dhingra <[email protected]>
  • Loading branch information
yaten2302 committed Oct 16, 2024
1 parent 49d628f commit 1f961d0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/components/Case-study-banner/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useState } from "react";
import styled from "styled-components";
import MesheryLogo from "../../assets/images/meshery/icon-only/meshery-logo-light.svg";
import SpireLogo from "../../collections/integrations/spire/icons/color/spire-color.svg";
import MesheryAndSpire from "../../collections/resources/case-study/hpes-adoption-of-meshery-and-kanvas/meshery-and-hpe.svg";
import { StaticImage } from "gatsby-plugin-image";


const BannerWrapper = styled.div`
Expand Down Expand Up @@ -43,6 +41,14 @@ const BannerWrapper = styled.div`
}
.left-img > .gatsby-image-wrapper {
border-radius: 50%;
width: 50%;
overflow: hidden;
height: auto;
object-fit: contain;
}
.desc {
display: flex;
background:${props => props.theme.bannerDescriptionGradient};
Expand Down Expand Up @@ -215,12 +221,12 @@ const CaseStudyBanner = () => {
<h2>Discover how HPE uses Meshery to manage SPIRE</h2>
</div>
<div className="meshery-and-spire">
<img src={MesheryAndSpire} alt="meshery-and-spire" />
<StaticImage src="../../collections/resources/case-study/hpes-adoption-of-meshery-and-kanvas/meshery-and-hpe.svg" />
</div>
</div>
<div className="large-screen">
<div className={`left-img ${hover ? "scale-on-hover" : ""}`} onMouseEnter={handleHover} onMouseLeave={handleLeave}>
<img src={MesheryLogo} alt="meshery-logo" />
<StaticImage src="../../assets/images/meshery/icon-only/meshery-logo-light.svg" /* style={{ borderRadius: "50%" }} */ />
</div>
<div className={`desc ${hover ? "desc-hover" : ""}`} onMouseEnter={handleHover} onMouseLeave={handleLeave}>
<h2>Discover how HPE uses Meshery to manage SPIRE</h2>
Expand All @@ -229,7 +235,7 @@ const CaseStudyBanner = () => {
</div>
</div>
<div className={`right-img ${hover ? "scale-on-hover" : ""}`} onMouseEnter={handleHover} onMouseLeave={handleLeave}>
<img src={SpireLogo} alt="spire-logo" />
<StaticImage src="../../collections/integrations/spire/icons/color/spire-color.svg" />
</div>
</div>
</BannerWrapper>
Expand Down

0 comments on commit 1f961d0

Please sign in to comment.