diff --git a/src/components/Container/index.tsx b/src/components/Container/index.tsx index 5407dc3..d8a2a60 100644 --- a/src/components/Container/index.tsx +++ b/src/components/Container/index.tsx @@ -1,11 +1,11 @@ import React, { PropsWithChildren } from "react" import * as SC from "./styles" -const Container = ({ +function Container({ children, ...restProps -}: PropsWithChildren<{}>): JSX.Element => ( - {children} -) +}: PropsWithChildren<{}>): JSX.Element { + return {children} +} export default Container diff --git a/src/components/DocsLayout/index.tsx b/src/components/DocsLayout/index.tsx index e79ab1d..e393248 100644 --- a/src/components/DocsLayout/index.tsx +++ b/src/components/DocsLayout/index.tsx @@ -12,7 +12,7 @@ import DocsSidebar from "../DocsSidebar" import Footer from "../Footer" import * as SC from "./styles" -const DocsLayout = ({ children }: PropsWithChildren<{}>) => { +function DocsLayout({ children }: PropsWithChildren<{}>) { const data = useStaticQuery(graphql` query { site { diff --git a/src/components/DocsSidebar/index.tsx b/src/components/DocsSidebar/index.tsx index cc221ba..691deb4 100644 --- a/src/components/DocsSidebar/index.tsx +++ b/src/components/DocsSidebar/index.tsx @@ -55,7 +55,7 @@ const ALL_DOCS = graphql` } ` -const plantTree = (item: IFileOrFolder) => { +function plantTree(item: IFileOrFolder) { if (item.type === "file") { return ( @@ -84,7 +84,7 @@ function Folder({ item }: { item: IFolder }) { ) } -const DocsSidebar = () => { +function DocsSidebar() { const docs = useStaticQuery(ALL_DOCS) const tree = useBuildTree(docs) diff --git a/src/components/DocsSidebar/useBuildTree.tsx b/src/components/DocsSidebar/useBuildTree.tsx index a3d6e5a..630f034 100644 --- a/src/components/DocsSidebar/useBuildTree.tsx +++ b/src/components/DocsSidebar/useBuildTree.tsx @@ -7,10 +7,10 @@ import { IFileQuery, } from "./index" -const traverse = ( +function traverse( [head, ...tail]: string[], basePath = "/docs" -): IFileOrFolder => { +): IFileOrFolder { const path = basePath + "/" + head const isFile = !tail.length if (isFile) { @@ -30,7 +30,7 @@ const traverse = ( } } -const generateFolder = ({ +function generateFolder({ title, path, targets, @@ -38,7 +38,7 @@ const generateFolder = ({ title: IFolder["title"] path: IFile["path"] targets: IFolder[] -}): IFolder => { +}): IFolder { const children = join(R.chain(target => target.children, targets)) return { @@ -49,13 +49,13 @@ const generateFolder = ({ } } -const generateFile = ({ +function generateFile({ title, path, }: { title: IFile["title"] path: IFile["path"] -}): IFile => { +}): IFile { return { title, path, @@ -63,7 +63,7 @@ const generateFile = ({ } } -const join = ([head, ...tail]: IFileOrFolder[]): IFileOrFolder[] => { +function join([head, ...tail]: IFileOrFolder[]): IFileOrFolder[] { if (!head) return [] const [similarFs, remaining] = R.partition( diff --git a/src/components/DocsSidebarSection/index.tsx b/src/components/DocsSidebarSection/index.tsx index c99975c..587ddd1 100644 --- a/src/components/DocsSidebarSection/index.tsx +++ b/src/components/DocsSidebarSection/index.tsx @@ -5,10 +5,10 @@ export interface DocsSidebarSectionProps { readonly title: string } -const DocsSidebarSection = ({ +function DocsSidebarSection({ title, children, -}: PropsWithChildren) => { +}: PropsWithChildren) { return (
{title} diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 5b32eb1..289cf04 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -2,7 +2,7 @@ import React from "react" import * as SC from "./styles" import Container from "../Container" -const Footer = () => { +function Footer() { return ( diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 86d6c52..f9efd41 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -16,7 +16,7 @@ import * as SC from "./styles" import Scrollbar from "react-perfect-scrollbar" import "react-perfect-scrollbar/dist/css/styles.css" -const Layout = ({ children }: PropsWithChildren<{}>) => { +function Layout({ children }: PropsWithChildren<{}>) { const data = useStaticQuery(graphql` query { site { diff --git a/src/components/SEO/index.tsx b/src/components/SEO/index.tsx index 1384238..6c3d872 100644 --- a/src/components/SEO/index.tsx +++ b/src/components/SEO/index.tsx @@ -10,13 +10,13 @@ interface SEOProps { readonly title: string } -const SEO = ({ +function SEO({ description, lang = "en", meta = [], keywords = [], title, -}: SEOProps) => { +}: SEOProps) { const { site } = useStaticQuery( graphql` query { diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 9f5099a..6d33338 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -11,7 +11,7 @@ function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) { ) } -const Sidebar = () => { +function Sidebar() { return ( diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 5d1fa25..0b82e4e 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -3,12 +3,14 @@ import React from "react" import Layout from "../components/Layout" import SEO from "../components/SEO" -const NotFoundPage = () => ( - - -

NOT FOUND

-

You just hit a route that doesn't exist... the sadness.

-
-) +function NotFoundPage() { + return ( + + +

NOT FOUND

+

You just hit a route that doesn't exist... the sadness.

+
+ ) +} export default NotFoundPage diff --git a/src/pages/docs.tsx b/src/pages/docs.tsx index 249bac7..1a13229 100644 --- a/src/pages/docs.tsx +++ b/src/pages/docs.tsx @@ -3,11 +3,13 @@ import React from "react" import DocsLayout from "../components/DocsLayout" import SEO from "../components/SEO" -const DocsPage = () => ( - - - the docs - -) +function DocsPage() { + return ( + + + the docs + + ) +} export default DocsPage diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 7674819..c2d3c0b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -4,15 +4,17 @@ import { Link } from "gatsby" import Layout from "../components/Layout" import SEO from "../components/SEO" -const IndexPage = () => ( - - -

Hi people

-

Welcome to your new Gatsby site.

-

Now go build something great.

-
- Go to page 2 -
-) +function IndexPage() { + return ( + + +

Hi people

+

Welcome to your new Gatsby site.

+

Now go build something great.

+
+ Go to page 2 +
+ ) +} export default IndexPage diff --git a/src/templates/languagePost.tsx b/src/templates/languagePost.tsx index a0c94b8..bec0944 100644 --- a/src/templates/languagePost.tsx +++ b/src/templates/languagePost.tsx @@ -4,7 +4,7 @@ import SEO from "../components/SEO" import DocsLayout from "../components/DocsLayout" // @todo maybe find alternative type for data -const LanguagePost = ({ data }: any) => { +function LanguagePost({ data }: any) { const { html, frontmatter } = data.file.post console.log(data) return (