From 96834072afa8159c40e09b3b08a9ba5694dd8f1a Mon Sep 17 00:00:00 2001 From: tymur999 Date: Sat, 7 Mar 2026 23:22:58 -0600 Subject: [PATCH] article list init --- .idea/jsLibraryMappings.xml | 6 ++++ .idea/watcherTasks.xml | 2 +- src/articles/ArticlesList.tsx | 56 +++++++++++++++++++++++++++++++++++ src/articles/Reader.tsx | 5 ++++ src/articles/articles.ts | 13 ++++++++ src/articles/list.sass | 55 ++++++++++++++++++++++++++++++++++ 6 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 src/articles/ArticlesList.tsx create mode 100644 src/articles/Reader.tsx create mode 100644 src/articles/articles.ts create mode 100644 src/articles/list.sass diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml index e69de29..d23208f 100644 --- a/.idea/jsLibraryMappings.xml +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml index fb0d65a..3cb109b 100644 --- a/.idea/watcherTasks.xml +++ b/.idea/watcherTasks.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/articles/ArticlesList.tsx b/src/articles/ArticlesList.tsx new file mode 100644 index 0000000..4ec42bc --- /dev/null +++ b/src/articles/ArticlesList.tsx @@ -0,0 +1,56 @@ +import {Article} from "./articles"; +import allBlack from "../img/IMG_3095.jpg"; +import {lazy, useState} from "react"; +import "./list.sass"; +import {ReactComponent as BoxSvg} from "../img/blog-box.svg"; +import {Reader} from "./Reader"; + +const ARTICLES: Article[] = [{ + name: "My high school experience", + description: "My first program, winning two senior superlatives, and why (and how) I chose Georgia Tech", + thumbnail: allBlack, + published: new Date(), + article: lazy(() => import("../about/About.mdx")) +}]; + +export function ArticlesList() { + const [reading, setReading] = useState
(null); + + return
+
+
+ { + ARTICLES.map(a => + + ) + } + { + reading && + } +
+
+
+} + +function BlogBox(props: { article: Article, setReading: (_: Article) => void}) { + const {article, + article: {name, description, thumbnail, published}, + setReading} = props; + + return ( + + + ) +} 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