Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions src/components/Banners/BannerTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import "./BannerTop.scss"
import { useTheme } from "../../context/themeContext"

const BannerTop = ({ banner }) => {
const { bgImage, bgImageDarkMode, image, title, summary } = banner
const { bgImage, bgImageDarkMode, image, imagePage, title, summary } = banner
const { theme } = useTheme()

const imageBanner = getImage(bgImage?.localFile) || getImage(image?.localFile)
const imageBanner =
getImage(bgImage?.localFile) ||
getImage(image?.localFile) ||
getImage(imagePage?.localFile)
const imageDM = getImage(bgImageDarkMode?.localFile)

return (
Expand Down
12 changes: 10 additions & 2 deletions src/templates/BlogItemDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import { getImage, GatsbyImage } from "gatsby-plugin-image"
import "./BlogItemDetail.scss"

const BlogDetail = ({ data }) => {
const { title, description, image, author } = data?.allStrapiArticle?.nodes[0]
const bannerTop = { title, image }
const { title, description, image, imagePage, author } = data?.allStrapiArticle?.nodes[0]

const bannerTop = imagePage ? { title, imagePage } : { title, image }

let { summary } = author

Expand Down Expand Up @@ -80,6 +81,13 @@ export const query = graphql`
}
}
}
imagePage{
localFile {
childImageSharp {
gatsbyImageData
}
}
}
author {
name
subTitle
Expand Down
1 change: 1 addition & 0 deletions src/templates/BlogItemDetail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
li {
margin-left: 1rem;
font-size: $small;
line-height: normal;
text-align: justify;

&::marker {
Expand Down