Skip to content

Commit a237528

Browse files
authored
Merge pull request #6083 from vishalvivekm/logo-fix
enhance logic to display thumbnail based on theme
2 parents 9b067af + ce46253 commit a237528

File tree

3 files changed

+15
-2
lines changed
  • src
    • collections/news/2024/2024-11-12-layer5-launches-kanvas-a-collaborative-platform-for-cloud-native-infrastructure
    • sections/Company/News-single
    • templates

3 files changed

+15
-2
lines changed

src/collections/news/2024/2024-11-12-layer5-launches-kanvas-a-collaborative-platform-for-cloud-native-infrastructure/index.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ Like Figma for engineers, Kanvas users can access Kanvas from any computer with
6666
<li><strong>Design Reviews</strong>: Collaboratively review and provide feedback on designs and prototypes.</li>
6767
</ul>
6868

69-
69+
<div>
70+
<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>
71+
<p style="font-style:italic;font-size:1rem;margin-left:1rem;">Birth of Kanvas from Meshery</p>
72+
</div>
7073
#### Kanvas caters to a wide range of users, including:
7174
<ul>
7275
<li>Teams and engineering managers for brainstorming, diagramming, wireframing, and interviewing.</li>

src/sections/Company/News-single/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import NewsSidebar from "./Sidebar";
88

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

1213
const NewsSingle = ({ data }) => {
14+
const { isDark } = useStyledDarkMode();
1315
const { frontmatter, body, fields } = data.mdx;
1416
const newsData = useStaticQuery(
1517
graphql`query relatedNewsPosts {
@@ -54,7 +56,8 @@ const NewsSingle = ({ data }) => {
5456
subtitle={frontmatter.subtitle}
5557
category={frontmatter.category}
5658
author={{ name: frontmatter.author }}
57-
thumbnail={frontmatter.thumbnail}
59+
thumbnail={ isDark && frontmatter.darkthumbnail && frontmatter.darkthumbnail.publicURL !== frontmatter.thumbnail.publicURL
60+
? frontmatter.darkthumbnail : frontmatter.thumbnail}
5861
date={frontmatter.date}
5962
/>
6063
<div className="single-post-wrapper">

src/templates/news-single.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ export const query = graphql`
2424
extension
2525
publicURL
2626
}
27+
darkthumbnail {
28+
childImageSharp {
29+
gatsbyImageData(width: 500, layout: CONSTRAINED)
30+
}
31+
extension
32+
publicURL
33+
}
2734
}
2835
fields {
2936
slug

0 commit comments

Comments
 (0)