diff --git a/components/OrganizedContent.module.css b/components/OrganizedContent.module.css index 990d5343..95c8b32f 100644 --- a/components/OrganizedContent.module.css +++ b/components/OrganizedContent.module.css @@ -2,7 +2,7 @@ display: flex; } -.contentHeading { +.organizedContent h1 { font-size: 1.5rem; margin: 1rem 0 1rem 0; color: var(--blue-2); @@ -35,7 +35,7 @@ display: flex; } -.selectedHeading { +.selectedHeadingArea > .navOption { color: var(--blue-2); font-weight: bold; } diff --git a/components/OrganizedContent.tsx b/components/OrganizedContent.tsx index 7a0e8f1a..bdbd7782 100644 --- a/components/OrganizedContent.tsx +++ b/components/OrganizedContent.tsx @@ -27,58 +27,49 @@ interface ChildProps { link: Link; } -export const OrganizedContent: React.FC = ({ +export const OrganizedContent = ({ headings, currentIndex, - children, link: Link, -}) => { + children, +}: Props) => { const isReadAll = headings[currentIndex].name === "Read All"; - const isMobile = false; + const readAllContent = headings .filter((heading: { name: string }) => heading.name !== "Read All") .map((heading) => (
-

{heading.name}

+

{heading.name}

{heading.content}
)); - if (isMobile) { - return ( + const childProps: ChildProps = { + headings: headings, + currentIndex: currentIndex, + link: Link, + }; + + return ( +
+
+ ); }; -const Nav: React.FC = ({ headings, currentIndex, link: Link }) => { +//todo push class to link +const Nav = ({ headings, currentIndex, link: Link }: ChildProps) => { return (
{headings.map((heading, index) => ( @@ -90,11 +81,7 @@ const Nav: React.FC = ({ headings, currentIndex, link: Link }) => { className={ styles.navOption + " " + - (index === currentIndex - ? styles.selectedHeading - : heading.name === "Read All" - ? styles.readAll - : "") + (heading.name === "Read All" ? styles.readAll : "") } > {index === currentIndex && ( @@ -109,67 +96,60 @@ const Nav: React.FC = ({ headings, currentIndex, link: Link }) => { ); }; -const Footer: React.FC = ({ - headings, - currentIndex, - link: Link, -}) => { - const isReadAll = headings[currentIndex].name === "Read All"; +const Footer = ({ headings, currentIndex, link: Link }: ChildProps) => { const prevHeading = currentIndex > 0 && headings[currentIndex - 1].name !== "Read All" ? headings[currentIndex - 1] : undefined; const nextHeading = - currentIndex < headings.length - 1 && !isReadAll + currentIndex < headings.length - 1 && + headings[currentIndex + 1].name !== "Read All" ? headings[currentIndex + 1] : undefined; return (
{prevHeading && ( -
- -
- - - -
-
Previous
-
{prevHeading.name}
-
+ +
+ + + +
+
Previous
+
{prevHeading.name}
- -
+
+ )} + {/* used to always push options to the edges with space-between */}
{nextHeading && ( -
- -
-
-
- Next -
-
{nextHeading.name}
+ +
+
+
+ Next
- - - +
{nextHeading.name}
- -
+ + + +
+ )}
);