mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
style: prefer named exports
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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 (
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user