mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-07 16:06:12 +02:00
feat: support custom mobile header title
This commit is contained in:
@@ -5,13 +5,16 @@ interface IHomeMobileHeaderProps {
|
|||||||
openMenu: () => void
|
openMenu: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export const HomeMobileHeader: FC<IHomeMobileHeaderProps> = ({ openMenu }) => {
|
export const HomeMobileHeader: FC<IHomeMobileHeaderProps> = ({
|
||||||
|
openMenu,
|
||||||
|
children,
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<SC.HomeMobileHeaderWrapper>
|
<SC.HomeMobileHeaderWrapper>
|
||||||
<SC.LogoWrapper>
|
<SC.LogoWrapper>
|
||||||
<SC.StyledLogo />
|
<SC.StyledLogo />
|
||||||
</SC.LogoWrapper>
|
</SC.LogoWrapper>
|
||||||
Resources
|
{children}
|
||||||
<SC.Burger onClick={openMenu} />
|
<SC.Burger onClick={openMenu} />
|
||||||
</SC.HomeMobileHeaderWrapper>
|
</SC.HomeMobileHeaderWrapper>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,5 +4,11 @@ import { ArchivesSidebar } from "../../components/ArchivesSidebar"
|
|||||||
import { ColumnLayout } from "../ColumnLayout"
|
import { ColumnLayout } from "../ColumnLayout"
|
||||||
|
|
||||||
export const ArchivesLayout: FC = ({ children }) => {
|
export const ArchivesLayout: FC = ({ children }) => {
|
||||||
return <ColumnLayout sidebar={ArchivesSidebar} content={children} />
|
return (
|
||||||
|
<ColumnLayout
|
||||||
|
title="Archives"
|
||||||
|
sidebar={ArchivesSidebar}
|
||||||
|
content={children}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,16 @@ import { ThemeProvider } from "../../ThemeProvider"
|
|||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
interface IColumnLayoutProps {
|
interface IColumnLayoutProps {
|
||||||
|
title: string
|
||||||
sidebar: React.ReactNode
|
sidebar: React.ReactNode
|
||||||
content: React.ReactNode
|
content: React.ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ColumnLayout: FC<IColumnLayoutProps> = ({ sidebar, content }) => {
|
export const ColumnLayout: FC<IColumnLayoutProps> = ({
|
||||||
|
title,
|
||||||
|
sidebar,
|
||||||
|
content,
|
||||||
|
}) => {
|
||||||
const [activeMobileMenu, setActiveMobileMenu] = useState(false)
|
const [activeMobileMenu, setActiveMobileMenu] = useState(false)
|
||||||
const { lock, unlock } = useLockBodyScroll()
|
const { lock, unlock } = useLockBodyScroll()
|
||||||
|
|
||||||
@@ -31,7 +36,7 @@ export const ColumnLayout: FC<IColumnLayoutProps> = ({ sidebar, content }) => {
|
|||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
<GlobalStyles />
|
<GlobalStyles />
|
||||||
<SC.Main>
|
<SC.Main>
|
||||||
<HomeMobileHeader openMenu={openMenu} />
|
<HomeMobileHeader openMenu={openMenu}>{title}</HomeMobileHeader>
|
||||||
{sidebar({ className: activeMobileMenu ? "is-open" : "" })}
|
{sidebar({ className: activeMobileMenu ? "is-open" : "" })}
|
||||||
<SC.MainContent>
|
<SC.MainContent>
|
||||||
<SC.Container>{content}</SC.Container>
|
<SC.Container>{content}</SC.Container>
|
||||||
|
|||||||
@@ -4,5 +4,11 @@ import { ResourcesSidebar } from "../../components/ResourcesSidebar"
|
|||||||
import { ColumnLayout } from "../ColumnLayout"
|
import { ColumnLayout } from "../ColumnLayout"
|
||||||
|
|
||||||
export const ResourcesLayout: FC = ({ children }) => {
|
export const ResourcesLayout: FC = ({ children }) => {
|
||||||
return <ColumnLayout sidebar={ResourcesSidebar} content={children} />
|
return (
|
||||||
|
<ColumnLayout
|
||||||
|
title="Resources"
|
||||||
|
sidebar={ResourcesSidebar}
|
||||||
|
content={children}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user