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 * as SC from "./styles"
function Container({
export function Container({
children,
...restProps
}: PropsWithChildren<{}>): JSX.Element {
return <SC.ContainerWrapper {...restProps}>{children}</SC.ContainerWrapper>
}
export default Container
+3 -5
View File
@@ -8,11 +8,11 @@
import React, { PropsWithChildren } from "react"
import { useStaticQuery, graphql } from "gatsby"
import DocsSidebar from "../DocsSidebar"
import Footer from "../Footer"
import { DocsSidebar } from "../DocsSidebar"
import { Footer } from "../Footer"
import * as SC from "./styles"
function DocsLayout({ children }: PropsWithChildren<{}>) {
export function DocsLayout({ children }: PropsWithChildren<{}>) {
const data = useStaticQuery(graphql`
query {
site {
@@ -36,5 +36,3 @@ function DocsLayout({ children }: PropsWithChildren<{}>) {
</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 tree = useBuildTree(docs)
@@ -94,5 +94,3 @@ function DocsSidebar() {
</SC.DocsSidebarWrapper>
)
}
export default DocsSidebar
+1 -3
View File
@@ -5,7 +5,7 @@ export interface DocsSidebarSectionProps {
readonly title: string
}
function DocsSidebarSection({
export function DocsSidebarSection({
title,
children,
}: PropsWithChildren<DocsSidebarSectionProps>) {
@@ -16,5 +16,3 @@ function DocsSidebarSection({
</div>
)
}
export default DocsSidebarSection
+2 -4
View File
@@ -1,8 +1,8 @@
import React from "react"
import * as SC from "./styles"
import Container from "../Container"
import { Container } from "../Container"
function Footer() {
export function Footer() {
return (
<SC.FooterWrapper>
<Container>
@@ -13,5 +13,3 @@ function Footer() {
</SC.FooterWrapper>
)
}
export default Footer
+4 -6
View File
@@ -8,15 +8,15 @@
import React, { PropsWithChildren } from "react"
import { useStaticQuery, graphql } from "gatsby"
import Container from "../Container"
import Footer from "../Footer"
import Sidebar from "../Sidebar"
import { Container } from "../Container"
import { Footer } from "../Footer"
import { Sidebar } from "../Sidebar"
import "./layout.scss"
import * as SC from "./styles"
import Scrollbar from "react-perfect-scrollbar"
import "react-perfect-scrollbar/dist/css/styles.css"
function Layout({ children }: PropsWithChildren<{}>) {
export function Layout({ children }: PropsWithChildren<{}>) {
const data = useStaticQuery(graphql`
query {
site {
@@ -42,5 +42,3 @@ function Layout({ children }: PropsWithChildren<{}>) {
</Scrollbar>
)
}
export default Layout
+1 -3
View File
@@ -10,7 +10,7 @@ interface SEOProps {
readonly title: string
}
function SEO({
export function SEO({
description,
lang = "en",
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 (
<SC.SidebarWrapper>
<SC.Logo src={logo} />
@@ -27,5 +27,3 @@ function Sidebar() {
</SC.SidebarWrapper>
)
}
export default Sidebar
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import { Layout } from "../components/Layout"
import { SEO } from "../components/SEO"
function NotFoundPage() {
return (
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react"
import DocsLayout from "../components/DocsLayout"
import SEO from "../components/SEO"
import { DocsLayout } from "../components/DocsLayout"
import { SEO } from "../components/SEO"
function DocsPage() {
return (
+2 -2
View File
@@ -1,8 +1,8 @@
import React from "react"
import { Link } from "gatsby"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import { Layout } from "../components/Layout"
import { SEO } from "../components/SEO"
function IndexPage() {
return (
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react"
import { graphql } from "gatsby"
import SEO from "../components/SEO"
import DocsLayout from "../components/DocsLayout"
import { SEO } from "../components/SEO"
import { DocsLayout } from "../components/DocsLayout"
// @todo maybe find alternative type for data
function LanguagePost({ data }: any) {