mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
Merge pull request #212 from mahanthathreyee/rules-and-about-page-UI-change
Rules and about page layout change
This commit is contained in:
@@ -30,6 +30,7 @@ export const Sidebar: FC<PropsWithChildren<
|
|||||||
HTMLAttributes<HTMLDivElement>
|
HTMLAttributes<HTMLDivElement>
|
||||||
>> = props => {
|
>> = props => {
|
||||||
const { children, ...restProps } = props
|
const { children, ...restProps } = props
|
||||||
|
const isBorderVisible = children === undefined ? false : true
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SC.SidebarWrapper {...restProps}>
|
<SC.SidebarWrapper {...restProps}>
|
||||||
@@ -40,7 +41,7 @@ export const Sidebar: FC<PropsWithChildren<
|
|||||||
<SC.Inner>
|
<SC.Inner>
|
||||||
{children}
|
{children}
|
||||||
|
|
||||||
<SC.Menu>
|
<SC.Menu borderVisibility={isBorderVisible}>
|
||||||
<MenuItem to="/about">about</MenuItem>
|
<MenuItem to="/about">about</MenuItem>
|
||||||
<MenuItem to="/rules">rules</MenuItem>
|
<MenuItem to="/rules">rules</MenuItem>
|
||||||
<MenuItem to="/resources">resources</MenuItem>
|
<MenuItem to="/resources">resources</MenuItem>
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ export const Inner = styled.div`
|
|||||||
export const Menu = styled.nav`
|
export const Menu = styled.nav`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-top: 1px dashed #a5a5a5;
|
border-top: ${props =>
|
||||||
|
props.borderVisibility ? "1px dashed #a5a5a5" : "none"};
|
||||||
margin: 20px 0 40px;
|
margin: 20px 0 40px;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import { RouteComponentProps } from "@reach/router"
|
import { RouteComponentProps } from "@reach/router"
|
||||||
import React, { FC, Fragment, useEffect } from "react"
|
import React, { FC, Fragment, useEffect } from "react"
|
||||||
|
|
||||||
import { Container } from "../../components/Container"
|
|
||||||
import { HomeFooter } from "../../components/HomeFooter"
|
|
||||||
import { HomeHeader } from "../../components/HomeHeader"
|
import { HomeHeader } from "../../components/HomeHeader"
|
||||||
import { SEO } from "../../components/SEO"
|
import { SEO } from "../../components/SEO"
|
||||||
import { WavesBottom } from "../../components/Waves"
|
import { Sidebar } from "../../components/Sidebar"
|
||||||
import { GlobalStyles } from "../../globalStyles"
|
import { GlobalStyles } from "../../globalStyles"
|
||||||
import useLocation from "../../hooks/useLocation"
|
import useLocation from "../../hooks/useLocation"
|
||||||
import { useLockBodyScroll } from "../../hooks/useLockBodyScroll"
|
import { useLockBodyScroll } from "../../hooks/useLockBodyScroll"
|
||||||
import { ThemeProvider } from "../../ThemeProvider"
|
import { ThemeProvider } from "../../ThemeProvider"
|
||||||
|
import { ColumnLayout } from "../ColumnLayout"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
export const Layout: FC<RouteComponentProps> = ({ children }) => {
|
export const Layout: FC<RouteComponentProps> = ({ path, children }) => {
|
||||||
const { isHome } = useLocation()
|
const { isHome } = useLocation()
|
||||||
const { locked, unlock } = useLockBodyScroll()
|
const { locked, unlock } = useLockBodyScroll()
|
||||||
|
const pageName = path?.split("/")[1] === "rules" ? "Rules" : "About"
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (locked) {
|
if (locked) {
|
||||||
@@ -37,13 +37,11 @@ export const Layout: FC<RouteComponentProps> = ({ children }) => {
|
|||||||
)}
|
)}
|
||||||
{!isHome && (
|
{!isHome && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<HomeHeader isHome={isHome} />
|
<ColumnLayout
|
||||||
<SC.MainContent>
|
title={pageName}
|
||||||
<Container>{children}</Container>
|
sidebar={Sidebar}
|
||||||
</SC.MainContent>
|
content={children}
|
||||||
<HomeFooter />
|
/>
|
||||||
<WavesBottom />
|
|
||||||
<SC.WavesSpacer />
|
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
</SC.LayoutWrapper>
|
</SC.LayoutWrapper>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function BaseLayout({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<LocationProvider location={location}>
|
<LocationProvider location={location}>
|
||||||
<ResolvedLayout>{children}</ResolvedLayout>
|
<ResolvedLayout path={location.pathname}>{children}</ResolvedLayout>
|
||||||
</LocationProvider>
|
</LocationProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user