From 724ef13186780b51072e7a9ba33f28530b89e539 Mon Sep 17 00:00:00 2001 From: Maganth Seetharaman Date: Sat, 25 Jan 2020 22:08:32 +0530 Subject: [PATCH] feat: move about & rules pages to the sidebar layout --- src/components/Sidebar/index.tsx | 3 ++- src/components/Sidebar/styles.tsx | 3 ++- src/layouts/Layout/index.tsx | 20 +++++++++----------- src/layouts/index.tsx | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 5d5572b..b6edf7b 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -30,6 +30,7 @@ export const Sidebar: FC >> = props => { const { children, ...restProps } = props + const isBorderVisible = children === undefined ? false : true return ( @@ -40,7 +41,7 @@ export const Sidebar: FC {children} - + about rules resources diff --git a/src/components/Sidebar/styles.tsx b/src/components/Sidebar/styles.tsx index 8c6646d..2603a58 100644 --- a/src/components/Sidebar/styles.tsx +++ b/src/components/Sidebar/styles.tsx @@ -34,7 +34,8 @@ export const Inner = styled.div` export const Menu = styled.nav` display: flex; flex-direction: column; - border-top: 1px dashed #a5a5a5; + border-top: ${props => + props.borderVisibility ? "1px dashed #a5a5a5" : "none"}; margin: 20px 0 40px; padding-top: 20px; ` diff --git a/src/layouts/Layout/index.tsx b/src/layouts/Layout/index.tsx index 561f59b..3580531 100644 --- a/src/layouts/Layout/index.tsx +++ b/src/layouts/Layout/index.tsx @@ -1,20 +1,20 @@ import { RouteComponentProps } from "@reach/router" import React, { FC, Fragment, useEffect } from "react" -import { Container } from "../../components/Container" -import { HomeFooter } from "../../components/HomeFooter" import { HomeHeader } from "../../components/HomeHeader" import { SEO } from "../../components/SEO" -import { WavesBottom } from "../../components/Waves" +import { Sidebar } from "../../components/Sidebar" import { GlobalStyles } from "../../globalStyles" import useLocation from "../../hooks/useLocation" import { useLockBodyScroll } from "../../hooks/useLockBodyScroll" import { ThemeProvider } from "../../ThemeProvider" +import { ColumnLayout } from "../ColumnLayout" import * as SC from "./styles" -export const Layout: FC = ({ children }) => { +export const Layout: FC = ({ path, children }) => { const { isHome } = useLocation() const { locked, unlock } = useLockBodyScroll() + const pageName = path?.split("/")[1] === "rules" ? "Rules" : "About" useEffect(() => { if (locked) { @@ -37,13 +37,11 @@ export const Layout: FC = ({ children }) => { )} {!isHome && ( - - - {children} - - - - + )} diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index e386a6b..3b2d46d 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -28,7 +28,7 @@ export default function BaseLayout({ return ( - {children} + {children} ) }