style: prefer named exports

This commit is contained in:
Jean-Philippe Sirois
2019-07-27 18:04:52 -04:00
parent 4d434573d2
commit baa05d1968
12 changed files with 22 additions and 38 deletions
+1 -3
View File
@@ -1,11 +1,9 @@
import React, { PropsWithChildren } from "react" import React, { PropsWithChildren } from "react"
import * as SC from "./styles" import * as SC from "./styles"
function Container({ export function Container({
children, children,
...restProps ...restProps
}: PropsWithChildren<{}>): JSX.Element { }: PropsWithChildren<{}>): JSX.Element {
return <SC.ContainerWrapper {...restProps}>{children}</SC.ContainerWrapper> return <SC.ContainerWrapper {...restProps}>{children}</SC.ContainerWrapper>
} }
export default Container
+3 -5
View File
@@ -8,11 +8,11 @@
import React, { PropsWithChildren } from "react" import React, { PropsWithChildren } from "react"
import { useStaticQuery, graphql } from "gatsby" import { useStaticQuery, graphql } from "gatsby"
import DocsSidebar from "../DocsSidebar" import { DocsSidebar } from "../DocsSidebar"
import Footer from "../Footer" import { Footer } from "../Footer"
import * as SC from "./styles" import * as SC from "./styles"
function DocsLayout({ children }: PropsWithChildren<{}>) { export function DocsLayout({ children }: PropsWithChildren<{}>) {
const data = useStaticQuery(graphql` const data = useStaticQuery(graphql`
query { query {
site { site {
@@ -36,5 +36,3 @@ function DocsLayout({ children }: PropsWithChildren<{}>) {
</div> </div>
) )
} }
export default DocsLayout
+1 -3
View File
@@ -84,7 +84,7 @@ function Folder({ item }: { item: IFolder }) {
) )
} }
function DocsSidebar() { export function DocsSidebar() {
const docs = useStaticQuery<IAllDocsQuery>(ALL_DOCS) const docs = useStaticQuery<IAllDocsQuery>(ALL_DOCS)
const tree = useBuildTree(docs) const tree = useBuildTree(docs)
@@ -94,5 +94,3 @@ function DocsSidebar() {
</SC.DocsSidebarWrapper> </SC.DocsSidebarWrapper>
) )
} }
export default DocsSidebar
+1 -3
View File
@@ -5,7 +5,7 @@ export interface DocsSidebarSectionProps {
readonly title: string readonly title: string
} }
function DocsSidebarSection({ export function DocsSidebarSection({
title, title,
children, children,
}: PropsWithChildren<DocsSidebarSectionProps>) { }: PropsWithChildren<DocsSidebarSectionProps>) {
@@ -16,5 +16,3 @@ function DocsSidebarSection({
</div> </div>
) )
} }
export default DocsSidebarSection
+2 -4
View File
@@ -1,8 +1,8 @@
import React from "react" import React from "react"
import * as SC from "./styles" import * as SC from "./styles"
import Container from "../Container" import { Container } from "../Container"
function Footer() { export function Footer() {
return ( return (
<SC.FooterWrapper> <SC.FooterWrapper>
<Container> <Container>
@@ -13,5 +13,3 @@ function Footer() {
</SC.FooterWrapper> </SC.FooterWrapper>
) )
} }
export default Footer
+4 -6
View File
@@ -8,15 +8,15 @@
import React, { PropsWithChildren } from "react" import React, { PropsWithChildren } from "react"
import { useStaticQuery, graphql } from "gatsby" import { useStaticQuery, graphql } from "gatsby"
import Container from "../Container" import { Container } from "../Container"
import Footer from "../Footer" import { Footer } from "../Footer"
import Sidebar from "../Sidebar" import { Sidebar } from "../Sidebar"
import "./layout.scss" import "./layout.scss"
import * as SC from "./styles" import * as SC from "./styles"
import Scrollbar from "react-perfect-scrollbar" import Scrollbar from "react-perfect-scrollbar"
import "react-perfect-scrollbar/dist/css/styles.css" import "react-perfect-scrollbar/dist/css/styles.css"
function Layout({ children }: PropsWithChildren<{}>) { export function Layout({ children }: PropsWithChildren<{}>) {
const data = useStaticQuery(graphql` const data = useStaticQuery(graphql`
query { query {
site { site {
@@ -42,5 +42,3 @@ function Layout({ children }: PropsWithChildren<{}>) {
</Scrollbar> </Scrollbar>
) )
} }
export default Layout
+1 -3
View File
@@ -10,7 +10,7 @@ interface SEOProps {
readonly title: string readonly title: string
} }
function SEO({ export function SEO({
description, description,
lang = "en", lang = "en",
meta = [], meta = [],
@@ -86,5 +86,3 @@ function SEO({
/> />
) )
} }
export default SEO
+1 -3
View File
@@ -11,7 +11,7 @@ function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) {
) )
} }
function Sidebar() { export function Sidebar() {
return ( return (
<SC.SidebarWrapper> <SC.SidebarWrapper>
<SC.Logo src={logo} /> <SC.Logo src={logo} />
@@ -27,5 +27,3 @@ function Sidebar() {
</SC.SidebarWrapper> </SC.SidebarWrapper>
) )
} }
export default Sidebar
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react" import React from "react"
import Layout from "../components/Layout" import { Layout } from "../components/Layout"
import SEO from "../components/SEO" import { SEO } from "../components/SEO"
function NotFoundPage() { function NotFoundPage() {
return ( return (
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react" import React from "react"
import DocsLayout from "../components/DocsLayout" import { DocsLayout } from "../components/DocsLayout"
import SEO from "../components/SEO" import { SEO } from "../components/SEO"
function DocsPage() { function DocsPage() {
return ( return (
+2 -2
View File
@@ -1,8 +1,8 @@
import React from "react" import React from "react"
import { Link } from "gatsby" import { Link } from "gatsby"
import Layout from "../components/Layout" import { Layout } from "../components/Layout"
import SEO from "../components/SEO" import { SEO } from "../components/SEO"
function IndexPage() { function IndexPage() {
return ( return (
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react" import React from "react"
import { graphql } from "gatsby" import { graphql } from "gatsby"
import SEO from "../components/SEO" import { SEO } from "../components/SEO"
import DocsLayout from "../components/DocsLayout" import { DocsLayout } from "../components/DocsLayout"
// @todo maybe find alternative type for data // @todo maybe find alternative type for data
function LanguagePost({ data }: any) { function LanguagePost({ data }: any) {