refact: convert components to use React.FC type + type improvements

This commit is contained in:
Phi
2019-09-17 17:06:43 -04:00
committed by Jean-Philippe Sirois
parent d61c218657
commit 1d88367645
23 changed files with 89 additions and 74 deletions
+5 -4
View File
@@ -5,7 +5,8 @@
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React, { Fragment, PropsWithChildren } from "react"
import { RouteComponentProps } from '@reach/router'
import React, { FC, Fragment } from "react"
import { GlobalStyles } from "../../globalStyles"
import { ThemeProvider } from "../../ThemeProvider"
@@ -15,11 +16,11 @@ import { Header } from "../Header"
import { WavesBottom } from "../Waves"
import * as SC from "./styles"
export function Layout({
export const Layout: FC<RouteComponentProps> = ({
children,
location,
}: PropsWithChildren<{ location: Location }>) {
const isHome = location.pathname === "/"
}) => {
const isHome = location ? location.pathname === "/" : false
return (
<ThemeProvider>