Skip to content
Open
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
18 changes: 9 additions & 9 deletions src/components/blogPost/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { usePluginData } from "@docusaurus/useGlobalData";
import Link from "@docusaurus/Link";
import SectionContainer from "../sectionContainer";
import { useHistory } from "@docusaurus/router";
import Translate from "@docusaurus/Translate";
import "./index.scss";

Expand All @@ -10,24 +10,24 @@ export default function BlogPost() {
blogGlobalData: { blogPosts },
} = usePluginData("blog-global-dataPlugin");

const history = useHistory();

return (
<SectionContainer className="blogPostContainer">
<div className="row">
<div className="left">
<h1>
<Translate>Recent News</Translate>
</h1>
<a onClick={() => history.push("blog")}>
<Link to="/blog">
<Translate>View All</Translate>
</a>
</Link>
</div>
<div className="right">
{blogPosts.slice(0, 3).map((item, index) => (
<div key={index} className="viewBlogContainer">
<h3 onClick={() => history.push(item.metadata.permalink)}>
{item.metadata.title}
{blogPosts.slice(0, 3).map((item) => (
<div key={item.metadata.permalink} className="viewBlogContainer">
<h3>
<Link className="post-link" to={item.metadata.permalink}>
{item.metadata.title}
</Link>
</h3>
{item.metadata?.frontMatter?.summary && (
<p>{item.metadata?.frontMatter.summary}</p>
Expand Down
23 changes: 20 additions & 3 deletions src/components/blogPost/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@

a {
cursor: pointer;

&:focus-visible {
outline: 2px solid #3578e5;
outline-offset: 2px;
}
}
}

Expand All @@ -50,10 +55,22 @@
.viewBlogContainer {
h3 {
text-align: left;
cursor: pointer;

&:hover {
color: #3578e5;
.post-link {
display: inline-block;
color: inherit;
text-decoration: none;
Comment thread
RedZapdos123 marked this conversation as resolved.

&:hover {
color: #3578e5;
text-decoration: none;
}

&:focus-visible {
outline: 2px solid #3578e5;
outline-offset: 2px;
border-radius: 2px;
}
}
}

Expand Down