From c364c4b0273e76cb13571878d1a4a2853a392b9b Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 12 Apr 2024 10:31:48 +0200 Subject: WIP transition to jekyll --- components/button.tsx | 9 ------- components/card.tsx | 14 ---------- components/chapters.tsx | 68 ---------------------------------------------- components/image.tsx | 11 -------- components/navbar.tsx | 70 ------------------------------------------------ components/seperator.tsx | 12 --------- components/tag.tsx | 28 ------------------- 7 files changed, 212 deletions(-) delete mode 100644 components/button.tsx delete mode 100644 components/card.tsx delete mode 100644 components/chapters.tsx delete mode 100644 components/image.tsx delete mode 100644 components/navbar.tsx delete mode 100644 components/seperator.tsx delete mode 100644 components/tag.tsx (limited to 'components') diff --git a/components/button.tsx b/components/button.tsx deleted file mode 100644 index 23201aa..0000000 --- a/components/button.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export default function Button(props: { - text: string; - href?: string; - onclick?: () => void; -}) { - return props.href - ? {props.text} - : ; -} diff --git a/components/card.tsx b/components/card.tsx deleted file mode 100644 index 7a6a472..0000000 --- a/components/card.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import Tags from './tag'; - -import { ArticleMeta } from '../pages/post/[id]'; - -export default function PostCard(props: { - post: ArticleMeta; -}) { - return - {props.post.cover && } -

{props.post.title}

- {props.post.subtitle} - {props.post.tags?.length != 0 && } -
; -} diff --git a/components/chapters.tsx b/components/chapters.tsx deleted file mode 100644 index 62d8285..0000000 --- a/components/chapters.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { CSSProperties, ReactNode, useState } from 'react'; - -import { NavbarItem } from '../components/navbar'; - -import KeyboardArrowDownRoundedIcon from '@material-ui/icons/KeyboardArrowDownRounded'; -import RemoveRoundedIcon from '@material-ui/icons/RemoveRounded'; - -export interface chapter { - name: string; - sectionLink?: string; - children?: Array; -} - -function NavbarChapter(props: { - level: number; - chapter: chapter; - children?: ReactNode; -}) { - var [collapsed, setCollapsed] = useState(true); - - var icon =
- {props.chapter.children?.length > 0 - ? - : } -
; - - var classes = [ - 'chapter', - `indentLevel${props.level}`, - ]; - !collapsed && classes.push('childrenCollapsed'); - - var outercss = /* { "--children-height": 0 + "px" } */ {} as CSSProperties; - - return props.chapter.children?.length > 0 && setCollapsed(!collapsed)} - href={props.chapter.sectionLink} - key={(() => Math.round(Math.random() * 1e12))()} - style={{ - marginLeft: 12 * props.level, - }} - outerStyle={outercss} - > - {props.children} - ; -} - -class Chapter { - constructor(public chapters: Array, public level: number) {} - render() { - return
- {this.chapters?.map(chapter => { - return - {new Chapter(chapter.children, this.level + 1).render()} - ; - })} -
; - } -} - -export default function Chapters(props: { - chapters: Array; -}) { - return new Chapter(props.chapters, 0).render(); -} diff --git a/components/image.tsx b/components/image.tsx deleted file mode 100644 index 5a8b2cf..0000000 --- a/components/image.tsx +++ /dev/null @@ -1,11 +0,0 @@ -export default function Image(props: { - src: string; - alt?: string; -}) { - return
- {props.alt} - {props.alt &&
-

{props.alt}

-
} -
; -} diff --git a/components/navbar.tsx b/components/navbar.tsx deleted file mode 100644 index acbec40..0000000 --- a/components/navbar.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { CSSProperties, ReactNode } from 'react'; - -import HomeRoundedIcon from '@material-ui/icons/HomeRounded'; -import MenuIcon from '@material-ui/icons/Menu'; -import SearchRoundedIcon from '@material-ui/icons/SearchRounded'; - -export function NavbarItem(props: { - icon?: ReactNode; - title: string; - href?: string; - active?: boolean; - children?: ReactNode; - classList?: Array; - style?: CSSProperties; - outerStyle?: CSSProperties; - onIconClick?: () => void; - onClick?: () => void; -}) { - var classes = props.classList || []; - classes.push('navbarItem'); - props.active && classes.push('active'); - return -
-
{props.icon}
- {props.title} -
- {props.children} -
; -} - -export default function Navbar(props: { - page?: string; -}) { - return
- } - title='Home' - href='/' - classList={['indentLevel0', 'link']} - /> - } - title='Search for posts' - href='/search' - classList={['indentLevel0', 'link']} - /> -
; -} - -export function MobileNavbar() { - return
- - - - - - -
{ - document.getElementsByClassName('mobileNav')[0].classList.toggle('open'); - document.getElementsByClassName('navAreaWrapper')[0].classList.toggle('navVisible'); - }} - > - -
-
; -} diff --git a/components/seperator.tsx b/components/seperator.tsx deleted file mode 100644 index f1843a7..0000000 --- a/components/seperator.tsx +++ /dev/null @@ -1,12 +0,0 @@ -export default function ArticleSeperator() { - return
- - - -
; -} diff --git a/components/tag.tsx b/components/tag.tsx deleted file mode 100644 index 048c405..0000000 --- a/components/tag.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { CSSProperties } from 'react'; - -export default function Tags(props: { - tags: Array; -}) { - return
- Tags: - {props.tags.map(tag => )} -
; -} - -export function Tag(props: { - name: string; -}) { - return char.charCodeAt(0)) - .reduce((a, b) => a + b) - % 360, - } as CSSProperties} - > - {props.name} - ; -} -- cgit v1.2.3