โฌ ๏ธ Back to Table of Contents
๐ RecentBlogPosts¶
๐ Analysis Summary¶
| Metric | Count |
|---|---|
| ๐ง Functions | 1 |
| ๐ฆ Imports | 7 |
| ๐ JSX Elements | 13 |
๐ Table of Contents¶
๐ ๏ธ File Location:¶
๐ packages/website/src/components/home/RecentBlogPosts/index.tsx
๐ฆ Imports¶
| Name | Source |
|---|---|
Link |
@docusaurus/Link |
recentPosts |
@site/data/recent-blog-posts.json |
Heading |
@theme/Heading |
clsx |
clsx |
React |
react |
Markdown |
react-markdown |
styles |
./styles.module.css |
JSX Elements¶
Functions¶
RecentBlogPosts(): React.JSX.Element¶
Returns: React.JSX.Element
Calls:
recentPosts.mapnew Date(post.date).toLocaleDateStringclsx (from clsx)
Code
export function RecentBlogPosts(): React.JSX.Element {
return (
<section className={styles.blogPosts}>
<div className="container text--center padding-vert--lg">
<Heading as="h2" id="financial-contributors">
Recent Blog Posts
</Heading>
<ul className={styles.postsList}>
{recentPosts.map(post => (
<li className={styles.post} key={post.title}>
<a className={styles.postLink} href={`/blog/${post.slug}`}>
<div className={styles.postTitle}>
<Markdown>{post.title}</Markdown>
</div>
<Markdown>{post.description}</Markdown>
<div className={styles.postTiming}>
<time dateTime={post.date}>
{new Date(post.date).toLocaleDateString('en-US', {
day: 'numeric',
month: 'long',
year: 'numeric',
})}
</time>
ยท<div>{post.readingTime} minute read</div>
</div>
</a>
</li>
))}
</ul>
<Link
className={clsx('button button--primary', styles.seeAll)}
to="/blog"
>
See all blog posts
</Link>
</div>
</section>
);
}
Generated by Syntax Scribe