From 134f64e5086ab5c3ead329752656d7a64ac2481a Mon Sep 17 00:00:00 2001 From: matushl Date: Sun, 10 Dec 2023 11:13:40 +0100 Subject: [PATCH] Add new styles to markdown --- src/components/StaticSites/Markdown.tsx | 3 ++- src/components/StaticSites/Texts.module.scss | 5 +---- .../StaticSites/Texts.module.scss.d.ts | 1 - src/components/StaticSites/Texts.tsx | 21 ++++++++++++------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/StaticSites/Markdown.tsx b/src/components/StaticSites/Markdown.tsx index bf9a8fe9..43c57d26 100644 --- a/src/components/StaticSites/Markdown.tsx +++ b/src/components/StaticSites/Markdown.tsx @@ -6,7 +6,7 @@ import rehypeKatex from 'rehype-katex' import remarkGfm from 'remark-gfm' import remarkMath from 'remark-math' -import {H1, H2, H3, Li, MarkdownLink, P, Table, Td, Th} from './Texts' +import {H1, H2, H3, Li, MarkdownLink, Ol, P, Table, Td, Th} from './Texts' type MarkdownProps = { content: string @@ -25,6 +25,7 @@ export const Markdown: FC = ({content}) => ( h1: H1, h2: H2, h3: H3, + ol: Ol, li: Li, }} > diff --git a/src/components/StaticSites/Texts.module.scss b/src/components/StaticSites/Texts.module.scss index f22dd813..cd0d43fd 100644 --- a/src/components/StaticSites/Texts.module.scss +++ b/src/components/StaticSites/Texts.module.scss @@ -2,11 +2,8 @@ text-align: center; } -.th, .td { - padding: 3px 1.5vw; -} - .th { + padding: 3px 1.5vw; background-color: black; color: white; } \ No newline at end of file diff --git a/src/components/StaticSites/Texts.module.scss.d.ts b/src/components/StaticSites/Texts.module.scss.d.ts index 6aa1d36f..fef8b79b 100644 --- a/src/components/StaticSites/Texts.module.scss.d.ts +++ b/src/components/StaticSites/Texts.module.scss.d.ts @@ -1,6 +1,5 @@ export type Styles = { table: string - td: string th: string } diff --git a/src/components/StaticSites/Texts.tsx b/src/components/StaticSites/Texts.tsx index f9135839..2878e764 100644 --- a/src/components/StaticSites/Texts.tsx +++ b/src/components/StaticSites/Texts.tsx @@ -3,6 +3,7 @@ import {FC, ReactNode} from 'react' import { HeadingProps, LiProps, + OrderedListProps, ReactMarkdownProps, TableDataCellProps, TableHeaderCellProps, @@ -33,17 +34,21 @@ export const Th: FC = ({children}) => ( ) export const Td: FC = ({children}) => ( - - {children} - + + {children} + +) + +export const Ol: FC = ({children}) => ( + + {children} + ) export const Li: FC = ({children}) => ( -
  • - - {children} - -
  • + + {children} + ) export const P: FC = ({children}) => (