mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 16:06:12 +02:00
ui: prepare base layout
This commit is contained in:
@@ -8,11 +8,13 @@
|
||||
import React, { PropsWithChildren } from "react"
|
||||
import { useStaticQuery, graphql } from "gatsby"
|
||||
|
||||
import Container from "../Container"
|
||||
import Navbar from "../Navbar"
|
||||
import Sidebar from "../Sidebar"
|
||||
import "./layout.scss"
|
||||
import { MainContent } from "./styles";
|
||||
import { Main, MainContent } from "./styles"
|
||||
import Scrollbar from "react-perfect-scrollbar"
|
||||
import "react-perfect-scrollbar/dist/css/styles.css";
|
||||
import "react-perfect-scrollbar/dist/css/styles.css"
|
||||
|
||||
const Layout = ({ children }: PropsWithChildren<{}>) => {
|
||||
const data = useStaticQuery(graphql`
|
||||
@@ -27,22 +29,22 @@ const Layout = ({ children }: PropsWithChildren<{}>) => {
|
||||
|
||||
return (
|
||||
<Scrollbar>
|
||||
<Navbar siteTitle={data.site.siteMetadata.title} />
|
||||
<div
|
||||
style={{
|
||||
margin: `0 auto`,
|
||||
maxWidth: 960,
|
||||
padding: `0px 1.0875rem 1.45rem`,
|
||||
paddingTop: 0,
|
||||
}}
|
||||
>
|
||||
<MainContent>{children}</MainContent>
|
||||
<footer>
|
||||
<Container>
|
||||
<Main>
|
||||
<Sidebar />
|
||||
<MainContent>
|
||||
<h1>{data.site.siteMetadata.title}</h1>
|
||||
{children}
|
||||
</MainContent>
|
||||
</Main>
|
||||
</Container>
|
||||
<footer>
|
||||
<Container>
|
||||
© {new Date().getFullYear()}, Built with
|
||||
{` `}
|
||||
<a href="https://www.gatsbyjs.org">Gatsby</a>
|
||||
</footer>
|
||||
</div>
|
||||
</Container>
|
||||
</footer>
|
||||
</Scrollbar>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// TODO: refactor this into styled components
|
||||
|
||||
html {
|
||||
font-family: 'Lato', sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
|
||||
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
@@ -37,4 +38,4 @@ body {
|
||||
padding: 0;
|
||||
padding-left: 2.8em;
|
||||
overflow: initial;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components"
|
||||
|
||||
export const Main = styled.div`
|
||||
display: flex;
|
||||
margin: 128px auto 64px !important;
|
||||
width: 100%;
|
||||
`
|
||||
|
||||
export const MainContent = styled.main`
|
||||
padding: 2.5em 0;
|
||||
`;
|
||||
flex: 1 0 auto;
|
||||
|
||||
& > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
& > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user