|
|
|
@ -27,6 +27,7 @@ export const READ_ALL_ID = "read-all"; |
|
|
|
|
interface Props { |
|
|
|
|
sections: Section[]; |
|
|
|
|
currentId: string; |
|
|
|
|
pageTitle: string; |
|
|
|
|
link: Link; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -74,6 +75,7 @@ export function OrganizedContent(props: Props) { |
|
|
|
|
sections={sections} |
|
|
|
|
currentIndex={currentIndex} |
|
|
|
|
link={props.link} |
|
|
|
|
pageTitle={props.pageTitle} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
@ -83,11 +85,13 @@ interface NavProps { |
|
|
|
|
sections: Section[]; |
|
|
|
|
currentIndex: number; |
|
|
|
|
link: Link; |
|
|
|
|
pageTitle?: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function Nav({ sections, currentIndex, link: Link }: NavProps) { |
|
|
|
|
function Nav({ sections, currentIndex, link: Link, pageTitle }: NavProps) { |
|
|
|
|
return ( |
|
|
|
|
<div className={styles.nav}> |
|
|
|
|
{pageTitle && <h1 className={styles.mobileNavTitle}>{pageTitle}</h1>} |
|
|
|
|
{sections.map((section, index) => { |
|
|
|
|
const classNames = [styles.navItem]; |
|
|
|
|
|
|
|
|
@ -161,6 +165,7 @@ interface MobileProps { |
|
|
|
|
sections: Section[]; |
|
|
|
|
currentIndex: number; |
|
|
|
|
link: Link; |
|
|
|
|
pageTitle: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function MobileWrapper(mobileProps: MobileProps) { |
|
|
|
@ -205,17 +210,16 @@ const Burger = ({ open, setOpen }: BurgerProps) => { |
|
|
|
|
return () => window.removeEventListener("scroll", handleScroll); |
|
|
|
|
}, [debouncedPrevScrollPos, visible]); |
|
|
|
|
|
|
|
|
|
const line1 = open ? styles.burgerLineOpen1 : styles.burgerLineClosed1; |
|
|
|
|
const line2 = open ? styles.burgerLineOpen2 : styles.burgerLineClosed2; |
|
|
|
|
const line3 = open ? styles.burgerLineOpen3 : styles.burgerLineClosed3; //BUG!!
|
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
className={styles.burger + " " + (visible ? "" : styles.hiddenBurger)} |
|
|
|
|
onClick={() => setOpen(!open)} |
|
|
|
|
> |
|
|
|
|
<div className={line1} /> |
|
|
|
|
<div className={line2} /> |
|
|
|
|
<div className={line3} /> |
|
|
|
|
<div> |
|
|
|
|
<div /> |
|
|
|
|
<div /> |
|
|
|
|
<div /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
@ -225,15 +229,21 @@ interface MenuProps { |
|
|
|
|
sections: Section[]; |
|
|
|
|
currentIndex: number; |
|
|
|
|
link: Link; |
|
|
|
|
pageTitle: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const Menu = ({ open, sections, currentIndex, link }: MenuProps) => { |
|
|
|
|
const Menu = ({ open, sections, currentIndex, link, pageTitle }: MenuProps) => { |
|
|
|
|
const mobileNav = open |
|
|
|
|
? styles.mobileNav |
|
|
|
|
: styles.mobileNav + " " + styles.mobileNavClosed; |
|
|
|
|
return ( |
|
|
|
|
<div className={mobileNav}> |
|
|
|
|
<Nav sections={sections} currentIndex={currentIndex} link={link} /> |
|
|
|
|
<Nav |
|
|
|
|
sections={sections} |
|
|
|
|
currentIndex={currentIndex} |
|
|
|
|
link={link} |
|
|
|
|
pageTitle={pageTitle} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|