-
-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved banner for latest blog post & bcp img
- Loading branch information
Showing
6 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+33.4 KB
...7-20-rider-language-injection/hot-chocolate-rider-language-injection-banner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-40.6 KB
website/src/blog/2021-07-20-rider-language-injection/rider-language-injection.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,47 @@ | ||
import { graphql, useStaticQuery } from "gatsby"; | ||
import { GatsbyImage } from "gatsby-plugin-image"; | ||
import React, { FC } from "react"; | ||
import styled from "styled-components"; | ||
import { GetBananaCakePopImageQuery } from "../../../graphql-types"; | ||
|
||
export const BananaCakePop: FC = () => { | ||
export interface BananaCakePopProps { | ||
readonly shadow?: boolean; | ||
} | ||
|
||
export const BananaCakePop: FC<BananaCakePopProps> = ({ shadow }) => { | ||
const data = useStaticQuery<GetBananaCakePopImageQuery>(graphql` | ||
query getBananaCakePopImage { | ||
file( | ||
relativePath: { eq: "banana-cake-pop.png" } | ||
sourceInstanceName: { eq: "images" } | ||
) { | ||
childImageSharp { | ||
gatsbyImageData( | ||
layout: CONSTRAINED | ||
width: 1200 | ||
) | ||
gatsbyImageData(layout: CONSTRAINED, width: 1200) | ||
} | ||
} | ||
} | ||
`); | ||
|
||
return ( | ||
return shadow ? ( | ||
<Container> | ||
<GatsbyImage | ||
image={data.file?.childImageSharp?.gatsbyImageData} | ||
alt="Banana Cake Pop" | ||
/> | ||
</Container> | ||
) : ( | ||
<GatsbyImage | ||
image={data.file?.childImageSharp?.gatsbyImageData} | ||
alt="Banana Cake Pop" | ||
/> | ||
); | ||
}; | ||
|
||
const Container = styled.div` | ||
padding: 30px; | ||
.gatsby-image-wrapper { | ||
border-radius: var(--border-radius); | ||
box-shadow: 0 9px 18px rgba(0, 0, 0, 0.25); | ||
} | ||
`; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters