mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-07 07:56:12 +02:00
Merge pull request #102 from the-programmers-hangout/refact-extract-layout-components
refact: extract layout components to the layouts directory
This commit is contained in:
@@ -5,21 +5,18 @@
|
|||||||
* See: https://www.gatsbyjs.org/docs/use-static-query/
|
* See: https://www.gatsbyjs.org/docs/use-static-query/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { RouteComponentProps } from '@reach/router'
|
import { RouteComponentProps } from "@reach/router"
|
||||||
import React, { FC, Fragment } from "react"
|
import React, { FC, Fragment } from "react"
|
||||||
|
|
||||||
|
import { Container } from "../../components/Container"
|
||||||
|
import { Footer } from "../../components/Footer"
|
||||||
|
import { Header } from "../../components/Header"
|
||||||
|
import { WavesBottom } from "../../components/Waves"
|
||||||
import { GlobalStyles } from "../../globalStyles"
|
import { GlobalStyles } from "../../globalStyles"
|
||||||
import { ThemeProvider } from "../../ThemeProvider"
|
import { ThemeProvider } from "../../ThemeProvider"
|
||||||
import { Container } from "../Container"
|
|
||||||
import { Footer } from "../Footer"
|
|
||||||
import { Header } from "../Header"
|
|
||||||
import { WavesBottom } from "../Waves"
|
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
export const Layout: FC<RouteComponentProps> = ({
|
export const Layout: FC<RouteComponentProps> = ({ children, location }) => {
|
||||||
children,
|
|
||||||
location,
|
|
||||||
}) => {
|
|
||||||
const isHome = location ? location.pathname === "/" : false
|
const isHome = location ? location.pathname === "/" : false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
import React, { FC, useState } from "react"
|
import React, { FC, useState } from "react"
|
||||||
|
|
||||||
|
import { MobileHeader } from "../../components/MobileHeader"
|
||||||
|
import { ResourcesSidebar } from "../../components/ResourcesSidebar"
|
||||||
import { GlobalStyles } from "../../globalStyles"
|
import { GlobalStyles } from "../../globalStyles"
|
||||||
import { SidebarProvider } from "../../SidebarProvider"
|
import { SidebarProvider } from "../../SidebarProvider"
|
||||||
import { ThemeProvider } from "../../ThemeProvider"
|
import { ThemeProvider } from "../../ThemeProvider"
|
||||||
import { MobileHeader } from "../MobileHeader"
|
|
||||||
import { ResourcesSidebar } from "../ResourcesSidebar"
|
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
export const ResourcesLayout: FC = ({ children }) => {
|
export const ResourcesLayout: FC = ({ children }) => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { PropsWithChildren } from "react"
|
import React, { PropsWithChildren } from "react"
|
||||||
import { Layout } from "../components/Layout"
|
import { Layout } from "./Layout"
|
||||||
import { ResourcesLayout } from "../components/ResourcesLayout"
|
import { ResourcesLayout } from "./ResourcesLayout"
|
||||||
|
|
||||||
export default function BaseLayout({
|
export default function BaseLayout({
|
||||||
children,
|
children,
|
||||||
|
|||||||
Reference in New Issue
Block a user