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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed <img /> to <StaticImage /> to improve performance #6002

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
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
Loading