From da40cdfaba5d4d8c5b6e6049129e75565cfac417 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sun, 9 Apr 2023 12:52:32 -0500 Subject: [PATCH] feat: get to displaying markdown copy --- src/app/components/Article.module.css | 14 ---- src/app/components/Article.tsx | 14 ---- src/app/components/NavBar.module.css | 4 +- src/app/components/Section.module.css | 20 +++++ src/app/components/Section.tsx | 18 +++++ src/app/components/SideBar.tsx | 12 ++- src/app/globals.css | 3 - src/app/page.module.css | 2 - src/app/page.tsx | 77 ++++++++++++++++++- src/docs/version_002/authentication/copy.md | 3 + .../version_002/authentication/example.md | 3 + src/docs/version_002/introduction/copy.md | 3 + src/docs/version_002/introduction/example.md | 5 ++ 13 files changed, 135 insertions(+), 43 deletions(-) delete mode 100644 src/app/components/Article.module.css delete mode 100644 src/app/components/Article.tsx create mode 100644 src/app/components/Section.module.css create mode 100644 src/app/components/Section.tsx create mode 100644 src/docs/version_002/authentication/copy.md create mode 100644 src/docs/version_002/authentication/example.md diff --git a/src/app/components/Article.module.css b/src/app/components/Article.module.css deleted file mode 100644 index 2517f15..0000000 --- a/src/app/components/Article.module.css +++ /dev/null @@ -1,14 +0,0 @@ -.container { - display: flex; - align-items: center; - width: 100%; - gap: 1rem; -} - -.copy { - flex: 1; -} - -.example { - flex: 1; -} \ No newline at end of file diff --git a/src/app/components/Article.tsx b/src/app/components/Article.tsx deleted file mode 100644 index fd1d7fa..0000000 --- a/src/app/components/Article.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import styles from './Article.module.css'; - -export default function Article() { - return ( -
-
- This is the copy -
-
- This is the example -
-
- ); -} diff --git a/src/app/components/NavBar.module.css b/src/app/components/NavBar.module.css index 17d2d39..c74756d 100644 --- a/src/app/components/NavBar.module.css +++ b/src/app/components/NavBar.module.css @@ -2,8 +2,10 @@ display: flex; justify-content: flex-end; align-items: center; - padding: 0 1rem; + padding: 1rem; width: 100%; + max-width: 1450px; + margin: 0 auto; } .navList { diff --git a/src/app/components/Section.module.css b/src/app/components/Section.module.css new file mode 100644 index 0000000..323f54f --- /dev/null +++ b/src/app/components/Section.module.css @@ -0,0 +1,20 @@ +.container { + display: flex; + align-items: center; + width: 100%; + gap: 1rem; + border-bottom: 1px solid #848586; + padding: 5rem; +} + +@media screen and (max-width: 1000px) { + .container { + flex-direction: column; + align-items: flex-start; + justify-content: center; + } +} + +.container>article { + flex: 1; +} \ No newline at end of file diff --git a/src/app/components/Section.tsx b/src/app/components/Section.tsx new file mode 100644 index 0000000..f559fd0 --- /dev/null +++ b/src/app/components/Section.tsx @@ -0,0 +1,18 @@ +import styles from './Section.module.css'; + +export default function Section({ + copy, + example, +}: { + copy: string; + example: string; +}) { + return ( +
+ ); +} diff --git a/src/app/components/SideBar.tsx b/src/app/components/SideBar.tsx index 86b01e4..f27ba98 100644 --- a/src/app/components/SideBar.tsx +++ b/src/app/components/SideBar.tsx @@ -14,13 +14,11 @@ function TreeNode({ doc }: { doc: DocsStructure }) { return (
  • {hasChildren ? ( -
    - setIsExpanded(!isExpanded)} - className={styles.link} - > - {doc.title} - +
    setIsExpanded(!isExpanded)} + className={styles.expandable} + > + {doc.title} {isExpanded ? ( 0) { + loadSections(doc.children, sections); + } + } catch (error) { + console.log(error); + continue; + } + } + + return sections; +} export default function Home() { + const versionTwoSections = loadSections(versionTwo); + console.log(versionTwoSections); return (
    -
    + {versionTwoSections.map(article => ( +
    + ))}
    ); } diff --git a/src/docs/version_002/authentication/copy.md b/src/docs/version_002/authentication/copy.md new file mode 100644 index 0000000..c331cc2 --- /dev/null +++ b/src/docs/version_002/authentication/copy.md @@ -0,0 +1,3 @@ +# Authentication + +This is the copy for the authentication page. diff --git a/src/docs/version_002/authentication/example.md b/src/docs/version_002/authentication/example.md new file mode 100644 index 0000000..532ed8e --- /dev/null +++ b/src/docs/version_002/authentication/example.md @@ -0,0 +1,3 @@ +# Example + +This is an example for the authentication page. diff --git a/src/docs/version_002/introduction/copy.md b/src/docs/version_002/introduction/copy.md index e69de29..59682ec 100644 --- a/src/docs/version_002/introduction/copy.md +++ b/src/docs/version_002/introduction/copy.md @@ -0,0 +1,3 @@ +# Introduction + +This is the copy for the introduction page. diff --git a/src/docs/version_002/introduction/example.md b/src/docs/version_002/introduction/example.md index e69de29..af00f8f 100644 --- a/src/docs/version_002/introduction/example.md +++ b/src/docs/version_002/introduction/example.md @@ -0,0 +1,5 @@ +{% .custom-class-name-here %} + +# Example + +This is the example for the introduction page.