(null); + + return + + + { + ARTICLES.map(a => + + ) + } + { + reading && + } + + + +} + +function BlogBox(props: { article: Article, setReading: (_: Article) => void}) { + const {article, + article: {name, description, thumbnail, published}, + setReading} = props; + + return ( + setReading(article)}> + + + + {name} + + {description} + {published.toDateString()} + + + + + + + ) +} diff --git a/src/articles/Reader.tsx b/src/articles/Reader.tsx new file mode 100644 index 0000000..45be439 --- /dev/null +++ b/src/articles/Reader.tsx @@ -0,0 +1,5 @@ +import {Article} from "./articles"; + +export function Reader(article: Article) { + return {article.name} +} \ No newline at end of file diff --git a/src/articles/articles.ts b/src/articles/articles.ts new file mode 100644 index 0000000..e04d641 --- /dev/null +++ b/src/articles/articles.ts @@ -0,0 +1,13 @@ +import {Path} from "../router/router"; +import {MDXContent} from "mdx/types"; +import type {LazyExoticComponent} from "react"; + +export interface Article { + name: string, + description: string, + // image thumbnail + thumbnail: Path, + published: Date, + // lazy load article content + article: MDXContent | LazyExoticComponent +} \ No newline at end of file diff --git a/src/articles/list.sass b/src/articles/list.sass new file mode 100644 index 0000000..c0480f6 --- /dev/null +++ b/src/articles/list.sass @@ -0,0 +1,55 @@ +@use "../nav/nav" +$entry-width: 400px + +.art-ctr + display: flex + flex-direction: row + min-height: 100vh + + button + z-index: 999 + display: flex + flex-direction: column + max-width: $entry-width + margin: nav.$padding * 2 + &>div + background: #282c34 + color: white + padding: 0 + +.thumbnail + width: $entry-width + height: 400px + object-fit: cover + object-position: 0 0 + +.spacer + background: #393984FF + width: 33% + flex-grow: 1 + +.titles + font-family: Neuton, serif + margin: 10px + gap: 15px + display: flex + align-items: center + + >h1 + flex-grow: 3 + text-align: left + + >div + flex-grow: 1 + text-align: center + + h4 + color: grey + +.articles + display: flex + flex-grow: 4 + margin-top: 100px + flex-direction: column + align-items: center + flex-wrap: wrap