From 70049d9e30637df984da7dfdcbab10b12357eadf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Sirois Date: Thu, 21 Nov 2019 03:15:12 -0500 Subject: [PATCH] feat: support custom mobile header title --- src/components/HomeMobileHeader/index.tsx | 7 +++++-- src/layouts/ArchivesLayout/index.tsx | 8 +++++++- src/layouts/ColumnLayout/index.tsx | 9 +++++++-- src/layouts/ResourcesLayout/index.tsx | 8 +++++++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/components/HomeMobileHeader/index.tsx b/src/components/HomeMobileHeader/index.tsx index bff1b4e..a653bea 100644 --- a/src/components/HomeMobileHeader/index.tsx +++ b/src/components/HomeMobileHeader/index.tsx @@ -5,13 +5,16 @@ interface IHomeMobileHeaderProps { openMenu: () => void } -export const HomeMobileHeader: FC = ({ openMenu }) => { +export const HomeMobileHeader: FC = ({ + openMenu, + children, +}) => { return ( - Resources + {children} ) diff --git a/src/layouts/ArchivesLayout/index.tsx b/src/layouts/ArchivesLayout/index.tsx index a0523b1..8d047b6 100644 --- a/src/layouts/ArchivesLayout/index.tsx +++ b/src/layouts/ArchivesLayout/index.tsx @@ -4,5 +4,11 @@ import { ArchivesSidebar } from "../../components/ArchivesSidebar" import { ColumnLayout } from "../ColumnLayout" export const ArchivesLayout: FC = ({ children }) => { - return + return ( + + ) } diff --git a/src/layouts/ColumnLayout/index.tsx b/src/layouts/ColumnLayout/index.tsx index e77a1be..b952082 100644 --- a/src/layouts/ColumnLayout/index.tsx +++ b/src/layouts/ColumnLayout/index.tsx @@ -8,11 +8,16 @@ import { ThemeProvider } from "../../ThemeProvider" import * as SC from "./styles" interface IColumnLayoutProps { + title: string sidebar: React.ReactNode content: React.ReactNode } -export const ColumnLayout: FC = ({ sidebar, content }) => { +export const ColumnLayout: FC = ({ + title, + sidebar, + content, +}) => { const [activeMobileMenu, setActiveMobileMenu] = useState(false) const { lock, unlock } = useLockBodyScroll() @@ -31,7 +36,7 @@ export const ColumnLayout: FC = ({ sidebar, content }) => { - + {title} {sidebar({ className: activeMobileMenu ? "is-open" : "" })} {content} diff --git a/src/layouts/ResourcesLayout/index.tsx b/src/layouts/ResourcesLayout/index.tsx index 9d5a020..e684e64 100644 --- a/src/layouts/ResourcesLayout/index.tsx +++ b/src/layouts/ResourcesLayout/index.tsx @@ -4,5 +4,11 @@ import { ResourcesSidebar } from "../../components/ResourcesSidebar" import { ColumnLayout } from "../ColumnLayout" export const ResourcesLayout: FC = ({ children }) => { - return + return ( + + ) }