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 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
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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
@@ -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
@@ -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
@@ -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 (
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user