Skip to content

Commit

Permalink
Sidebar v1.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jun 18, 2024
1 parent 7a9ce15 commit 36a02dc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions client/src/components/pages/SideBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import {
SideBarContainer,
SideBarSiteName,
SideBarEntriesContainer,
SideEntryLink,
SideBarAbout
} from './posts-dictionaries';
import { PostMetadata } from '@components/utils/mdx/fetchPostsMetadata';

interface SideBarProps {
posts: PostMetadata[];
}

const SideBar: React.FC<SideBarProps> = ({ posts }) => {
return (
<SideBarContainer>
<SideBarSiteName fontSize="20px">{`Dereck's Notes`}</SideBarSiteName>
{posts.length > 0
? posts.map((meta) => (
<SideBarEntriesContainer key={meta.slug}>
<SideEntryLink
key={meta.slug}
href={`/${meta.section}/${meta.slug}`}
passHref
>
<span style={{ fontWeight: 'bold' }}>
{meta.date}
</span>
: {meta.title}
</SideEntryLink>
</SideBarEntriesContainer>
))
: null}
<SideBarAbout />
</SideBarContainer>
);
};

export default SideBar;

0 comments on commit 36a02dc

Please sign in to comment.