diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index 69f4ed0..727579f 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -242,7 +242,7 @@ export function AppLayout(props: Immutable): JSX.Element { {/* Content panel */}
{contentPanel ? ( diff --git a/src/components/Markdown/Markdawn.tsx b/src/components/Markdown/Markdawn.tsx index ecc1269..18059d7 100644 --- a/src/components/Markdown/Markdawn.tsx +++ b/src/components/Markdown/Markdawn.tsx @@ -314,27 +314,27 @@ export function preprocessMarkDawn(text: string): string { } if (line.startsWith("# ")) { - return markdawnHeadersParser(headerLevels.h1, line, visitedSlugs); + return markdawnHeadersParser(HeaderLevels.H1, line, visitedSlugs); } if (line.startsWith("## ")) { - return markdawnHeadersParser(headerLevels.h2, line, visitedSlugs); + return markdawnHeadersParser(HeaderLevels.H2, line, visitedSlugs); } if (line.startsWith("### ")) { - return markdawnHeadersParser(headerLevels.h3, line, visitedSlugs); + return markdawnHeadersParser(HeaderLevels.H3, line, visitedSlugs); } if (line.startsWith("#### ")) { - return markdawnHeadersParser(headerLevels.h4, line, visitedSlugs); + return markdawnHeadersParser(HeaderLevels.H4, line, visitedSlugs); } if (line.startsWith("##### ")) { - return markdawnHeadersParser(headerLevels.h5, line, visitedSlugs); + return markdawnHeadersParser(HeaderLevels.H5, line, visitedSlugs); } if (line.startsWith("###### ")) { - return markdawnHeadersParser(headerLevels.h6, line, visitedSlugs); + return markdawnHeadersParser(HeaderLevels.H6, line, visitedSlugs); } return line; @@ -342,17 +342,17 @@ export function preprocessMarkDawn(text: string): string { return result.join("\n"); } -enum headerLevels { - h1 = 1, - h2 = 2, - h3 = 3, - h4 = 4, - h5 = 5, - h6 = 6, +enum HeaderLevels { + H1 = 1, + H2 = 2, + H3 = 3, + H4 = 4, + H5 = 5, + H6 = 6, } function markdawnHeadersParser( - headerLevel: headerLevels, + headerLevel: HeaderLevels, line: string, visitedSlugs: string[] ): string { @@ -365,5 +365,5 @@ function markdawnHeadersParser( index += 1; } visitedSlugs.push(newSlug); - return `<${headerLevels[headerLevel]} id="${newSlug}">${lineText}`; + return `<${HeaderLevels[headerLevel]} id="${newSlug}">${lineText}`; } diff --git a/src/components/PanelComponents/ReturnButton.tsx b/src/components/PanelComponents/ReturnButton.tsx index 7384507..2eef3de 100644 --- a/src/components/PanelComponents/ReturnButton.tsx +++ b/src/components/PanelComponents/ReturnButton.tsx @@ -15,9 +15,9 @@ interface Props { } export enum ReturnButtonType { - mobile = "mobile", - desktop = "desktop", - both = "both", + Mobile = "mobile", + Desktop = "desktop", + Both = "both", } export function ReturnButton(props: Immutable): JSX.Element { @@ -26,9 +26,9 @@ export function ReturnButton(props: Immutable): JSX.Element { return (
): JSX.Element { - const width = props.width ? props.width : ContentPanelWidthSizes.default; + const width = props.width ? props.width : ContentPanelWidthSizes.Default; const widthCSS = - width === ContentPanelWidthSizes.default ? "max-w-2xl" : "w-full"; + width === ContentPanelWidthSizes.Default ? "max-w-2xl" : "w-full"; return (
diff --git a/src/components/PostPage.tsx b/src/components/PostPage.tsx index 300a487..b51d0ac 100644 --- a/src/components/PostPage.tsx +++ b/src/components/PostPage.tsx @@ -70,7 +70,7 @@ export function PostPage(props: Immutable): JSX.Element { href={returnHref} title={returnTitle} langui={langui} - displayOn={ReturnButtonType.desktop} + displayOn={ReturnButtonType.Desktop} horizontalLine /> )} @@ -126,7 +126,7 @@ export function PostPage(props: Immutable): JSX.Element { href={returnHref} title={returnTitle} langui={langui} - displayOn={ReturnButtonType.mobile} + displayOn={ReturnButtonType.Mobile} horizontalLine /> )} diff --git a/src/hooks/useScrollTopOnChange.ts b/src/hooks/useScrollTopOnChange.ts index d7f2335..fb7347d 100644 --- a/src/hooks/useScrollTopOnChange.ts +++ b/src/hooks/useScrollTopOnChange.ts @@ -1,7 +1,7 @@ import { DependencyList, useEffect } from "react"; export enum AnchorIds { - CONTENT_PANEL = "contentPanel495922447721572", + ContentPanel = "contentPanel495922447721572", } // Scroll to top of element "id" when "deps" update. diff --git a/src/pages/404.tsx b/src/pages/404.tsx index e2ba153..836e83b 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -19,7 +19,7 @@ export default function FourOhFour(props: Immutable): JSX.Element { href="/" title="Home" langui={langui} - displayOn={ReturnButtonType.both} + displayOn={ReturnButtonType.Both} /> ); diff --git a/src/pages/500.tsx b/src/pages/500.tsx index a09e9e3..3ce261b 100644 --- a/src/pages/500.tsx +++ b/src/pages/500.tsx @@ -19,7 +19,7 @@ export default function FiveHundred(props: Immutable): JSX.Element { href="/" title="Home" langui={langui} - displayOn={ReturnButtonType.both} + displayOn={ReturnButtonType.Both} /> ); diff --git a/src/pages/archives/videos/c/[uid].tsx b/src/pages/archives/videos/c/[uid].tsx index 6474bcb..46f8368 100644 --- a/src/pages/archives/videos/c/[uid].tsx +++ b/src/pages/archives/videos/c/[uid].tsx @@ -39,7 +39,7 @@ export default function Channel(props: Props): JSX.Element { href="/archives/videos/" title={langui.videos} langui={langui} - displayOn={ReturnButtonType.desktop} + displayOn={ReturnButtonType.Desktop} className="mb-10" /> @@ -57,7 +57,7 @@ export default function Channel(props: Props): JSX.Element { ); const contentPanel = ( - +

{channel?.title}

{channel?.subscribers.toLocaleString()} subscribers

diff --git a/src/pages/archives/videos/index.tsx b/src/pages/archives/videos/index.tsx index ec0aa0c..2c43ca1 100644 --- a/src/pages/archives/videos/index.tsx +++ b/src/pages/archives/videos/index.tsx @@ -57,7 +57,7 @@ export default function Videos(props: Props): JSX.Element { href="/archives/" title={"Archives"} langui={langui} - displayOn={ReturnButtonType.desktop} + displayOn={ReturnButtonType.Desktop} className="mb-10" /> @@ -75,7 +75,7 @@ export default function Videos(props: Props): JSX.Element { ); const contentPanel = ( - + @@ -72,12 +72,12 @@ export default function Video(props: Props): JSX.Element { ); const contentPanel = ( - + diff --git a/src/pages/contents/[slug]/index.tsx b/src/pages/contents/[slug]/index.tsx index daab996..77aa093 100644 --- a/src/pages/contents/[slug]/index.tsx +++ b/src/pages/contents/[slug]/index.tsx @@ -47,7 +47,7 @@ export default function Content(props: Immutable): JSX.Element { languageExtractor: (item) => item.language?.data?.attributes?.code, }); - useScrollTopOnChange(AnchorIds.CONTENT_PANEL, [selectedTranslation]); + useScrollTopOnChange(AnchorIds.ContentPanel, [selectedTranslation]); const previousContent = content.group?.data?.attributes?.contents ? getPreviousContent( @@ -66,7 +66,7 @@ export default function Content(props: Immutable): JSX.Element { href={`/contents`} title={langui.contents} langui={langui} - displayOn={ReturnButtonType.desktop} + displayOn={ReturnButtonType.Desktop} horizontalLine /> @@ -205,7 +205,7 @@ export default function Content(props: Immutable): JSX.Element { href={`/contents`} title={langui.contents} langui={langui} - displayOn={ReturnButtonType.mobile} + displayOn={ReturnButtonType.Mobile} className="mb-10" /> diff --git a/src/pages/contents/index.tsx b/src/pages/contents/index.tsx index 3870984..d7f9fbc 100644 --- a/src/pages/contents/index.tsx +++ b/src/pages/contents/index.tsx @@ -116,7 +116,7 @@ export default function Contents(props: Immutable): JSX.Element { ); const contentPanel = ( - + {[...groups].map(([name, items]) => ( {items.length > 0 && ( diff --git a/src/pages/dev/checkup/contents.tsx b/src/pages/dev/checkup/contents.tsx index 0b3cbeb..6a7cdc5 100644 --- a/src/pages/dev/checkup/contents.tsx +++ b/src/pages/dev/checkup/contents.tsx @@ -21,7 +21,7 @@ export default function CheckupContents(props: Immutable): JSX.Element { const testReport = testingContent(contents); const contentPanel = ( - + {

{testReport.title}

}
diff --git a/src/pages/dev/checkup/libraryitems.tsx b/src/pages/dev/checkup/libraryitems.tsx index 8163cd5..81b4d64 100644 --- a/src/pages/dev/checkup/libraryitems.tsx +++ b/src/pages/dev/checkup/libraryitems.tsx @@ -26,7 +26,7 @@ export default function CheckupLibraryItems( const testReport = testingLibraryItem(libraryItems); const contentPanel = ( - + {

{testReport.title}

}
diff --git a/src/pages/dev/editor.tsx b/src/pages/dev/editor.tsx index 8545e8c..4c2725d 100644 --- a/src/pages/dev/editor.tsx +++ b/src/pages/dev/editor.tsx @@ -40,7 +40,7 @@ export default function Editor(props: Immutable): JSX.Element { } const contentPanel = ( - +

Convert HTML to markdown

diff --git a/src/pages/library/[slug]/index.tsx b/src/pages/library/[slug]/index.tsx index 178dbc2..1501773 100644 --- a/src/pages/library/[slug]/index.tsx +++ b/src/pages/library/[slug]/index.tsx @@ -58,7 +58,7 @@ export default function LibrarySlug(props: Immutable): JSX.Element { const { item, langui, currencies } = props; const appLayout = useAppLayout(); - useScrollTopOnChange(AnchorIds.CONTENT_PANEL, [item]); + useScrollTopOnChange(AnchorIds.ContentPanel, [item]); const isVariantSet = item?.metadata?.[0]?.__typename === "ComponentMetadataGroup" && @@ -85,7 +85,7 @@ export default function LibrarySlug(props: Immutable): JSX.Element { href="/library/" title={langui.library} langui={langui} - displayOn={ReturnButtonType.desktop} + displayOn={ReturnButtonType.Desktop} horizontalLine /> @@ -114,14 +114,14 @@ export default function LibrarySlug(props: Immutable): JSX.Element { ); const contentPanel = ( - +
@@ -438,7 +438,10 @@ export default function LibrarySlug(props: Immutable): JSX.Element {

{langui.contents}

{displayOpenScans && ( -