Refactor, update UI, and add notes

This commit is contained in:
2022-10-04 23:41:59 -04:00
parent fde6c7fa69
commit 160f23cb01
31 changed files with 813 additions and 265 deletions
+20 -3
View File
@@ -1,16 +1,33 @@
import React from 'react';
import Link from 'next/link';
import Layout from '../components/layout';
import QuickLinks from '../components/quick-links';
import RecentNotes from '../components/recent-notes';
import RecentPosts from '../components/recent-posts';
import { getNotesMeta, getPostsMeta, NoteMeta, PostMeta } from '../util/slug';
import { getNotesMeta, getPostsMeta, INoteMeta, IPostMeta } from '../lib/slug';
function HomePage({ postsMeta, notesMeta }: { postsMeta: PostMeta[], notesMeta: NoteMeta[] }) {
function Nav() {
const nav = {'Posts': '/posts', 'Notes': '/notes', 'About': '/about', };
return (
<div className='block' style={{textAlign: 'center'}}>
{
Object.entries(nav).map(([k, v]) => {
return <Link href={v}>
<a className='button green'>{k}</a>
</Link>
})
}
</div>
)
}
function HomePage({ postsMeta, notesMeta }: { postsMeta: IPostMeta[], notesMeta: INoteMeta[] }) {
return (
<Layout name='' title='PaulW.XYZ'>
<Nav />
<QuickLinks />
<RecentPosts postsMeta={postsMeta} />
<RecentNotes notesMeta={notesMeta} />
<RecentPosts postsMeta={postsMeta} />
</Layout>
)
}