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

enhance logic to display thumbnail based on theme #6083

Merged
merged 2 commits into from
Nov 15, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ Like Figma for engineers, Kanvas users can access Kanvas from any computer with
<li><strong>Design Reviews</strong>: Collaboratively review and provide feedback on designs and prototypes.</li>
</ul>


<div>
<iframe width="100%" height="315" style="margin-right: 1.5rem;margin-left:1.5rem;" src="https://www.youtube.com/embed/4WcofErPTx4?si=UfouUV7mhADg3zkk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<p style="font-style:italic;font-size:1rem;margin-left:1rem;">Birth of Kanvas from Meshery</p>
</div>
#### Kanvas caters to a wide range of users, including:
<ul>
<li>Teams and engineering managers for brainstorming, diagramming, wireframing, and interviewing.</li>
Expand Down
5 changes: 4 additions & 1 deletion src/sections/Company/News-single/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import NewsSidebar from "./Sidebar";

import NewsPageWrapper from "./NewsSingle.style.js";
import RelatedPosts from "../../../components/Related-Posts";
import { useStyledDarkMode } from "../../../theme/app/useStyledDarkMode";

const NewsSingle = ({ data }) => {
const { isDark } = useStyledDarkMode();
const { frontmatter, body, fields } = data.mdx;
const newsData = useStaticQuery(
graphql`query relatedNewsPosts {
Expand Down Expand Up @@ -54,7 +56,8 @@ const NewsSingle = ({ data }) => {
subtitle={frontmatter.subtitle}
category={frontmatter.category}
author={{ name: frontmatter.author }}
thumbnail={frontmatter.thumbnail}
thumbnail={ isDark && frontmatter.darkthumbnail && frontmatter.darkthumbnail.publicURL !== frontmatter.thumbnail.publicURL
? frontmatter.darkthumbnail : frontmatter.thumbnail}
date={frontmatter.date}
/>
<div className="single-post-wrapper">
Expand Down
7 changes: 7 additions & 0 deletions src/templates/news-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export const query = graphql`
extension
publicURL
}
darkthumbnail {
childImageSharp {
gatsbyImageData(width: 500, layout: CONSTRAINED)
}
extension
publicURL
}
}
fields {
slug
Expand Down