mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 23:43:45 +02:00
Merge pull request #81 from the-programmers-hangout/refact-clean-up
refact: clean up
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"develop": "gatsby develop",
|
"develop": "gatsby develop",
|
||||||
"fetch-users": "node ./scripts/fetchUsers.js",
|
"fetch-users": "node ./scripts/fetchUsers.js",
|
||||||
"format": "prettier --write src/**/*.{js,jsx}",
|
"format": "prettier --write src/**/*.{js,jsx}",
|
||||||
"lint": "tslint -c tslint.json '{src,scripts}/**/*.{js,ts,tsx}'",
|
"lint": "tslint -p tsconfig.json -c tslint.json '{src,scripts}/**/*.{js,ts,tsx}'",
|
||||||
"lint:fix": "npm run lint -- --fix",
|
"lint:fix": "npm run lint -- --fix",
|
||||||
"serve": "gatsby serve",
|
"serve": "gatsby serve",
|
||||||
"start": "npm run develop",
|
"start": "npm run develop",
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import React, { PropsWithChildren } from "react"
|
import React, { PropsWithChildren } from "react"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
function DiscordButton({ children }: PropsWithChildren<{}>) {
|
export function DiscordButton({ children }: PropsWithChildren<{}>) {
|
||||||
return (
|
return (
|
||||||
<SC.DiscordButtonWrapper>
|
<SC.DiscordButtonWrapper>
|
||||||
<SC.StyledDiscordLogo /> {children}
|
<SC.StyledDiscordLogo /> {children}
|
||||||
</SC.DiscordButtonWrapper>
|
</SC.DiscordButtonWrapper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default DiscordButton
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Link } from "gatsby"
|
|
||||||
import styled from "styled-components"
|
import styled from "styled-components"
|
||||||
|
|
||||||
export const FooterWrapper = styled.footer`
|
export const FooterWrapper = styled.footer`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Link } from "gatsby"
|
import { Link } from "gatsby"
|
||||||
import React, { PropsWithChildren, useLayoutEffect, useState } from "react"
|
import React, { PropsWithChildren, useLayoutEffect, useState } from "react"
|
||||||
import DiscordButton from "../DiscordButton"
|
import { DiscordButton } from "../DiscordButton"
|
||||||
import { WavesBottom, WavesTop } from "../Waves"
|
import { WavesBottom, WavesTop } from "../Waves"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
* See: https://www.gatsbyjs.org/docs/use-static-query/
|
* See: https://www.gatsbyjs.org/docs/use-static-query/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { graphql, useStaticQuery } from "gatsby"
|
|
||||||
import React, { Fragment, PropsWithChildren } from "react"
|
import React, { Fragment, PropsWithChildren } from "react"
|
||||||
|
|
||||||
import { GlobalStyles } from "../../globalStyles"
|
import { GlobalStyles } from "../../globalStyles"
|
||||||
@@ -20,15 +19,6 @@ export function Layout({
|
|||||||
location,
|
location,
|
||||||
}: PropsWithChildren<{ location: Location }>) {
|
}: PropsWithChildren<{ location: Location }>) {
|
||||||
const isHome = location.pathname === "/"
|
const isHome = location.pathname === "/"
|
||||||
const data = useStaticQuery(graphql`
|
|
||||||
query {
|
|
||||||
site {
|
|
||||||
siteMetadata {
|
|
||||||
title
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SC.LayoutWrapper>
|
<SC.LayoutWrapper>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ interface IMarkdownProps {
|
|||||||
export function Markdown({
|
export function Markdown({
|
||||||
content,
|
content,
|
||||||
...restProps
|
...restProps
|
||||||
}: MarkdownProps): JSX.Element {
|
}: IMarkdownProps): JSX.Element {
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
Prism.highlightAll()
|
Prism.highlightAll()
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export function ResourceHeader({
|
|||||||
timeToRead,
|
timeToRead,
|
||||||
recommendedReading,
|
recommendedReading,
|
||||||
externalResources,
|
externalResources,
|
||||||
}: ResourceHeaderProps) {
|
}: IResourceHeaderProps) {
|
||||||
const date = new Date(createdAt)
|
const date = new Date(createdAt)
|
||||||
const month = date.toLocaleString("default", { month: "long" })
|
const month = date.toLocaleString("default", { month: "long" })
|
||||||
const day = date.getDate()
|
const day = date.getDate()
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { graphql } from "gatsby"
|
import { graphql } from "gatsby"
|
||||||
import React, { Fragment } from "react"
|
import React, { Fragment } from "react"
|
||||||
import { MarkdownRemark, Query } from "../../generated/graphql"
|
import { MarkdownRemark } from "../../generated/graphql"
|
||||||
import { Markdown } from "../components/Markdown"
|
import { Markdown } from "../components/Markdown"
|
||||||
import { SEO } from "../components/SEO"
|
import { SEO } from "../components/SEO"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Link } from "gatsby"
|
|
||||||
import React, { Fragment } from "react"
|
import React, { Fragment } from "react"
|
||||||
|
|
||||||
import { SEO } from "../components/SEO"
|
import { SEO } from "../components/SEO"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { graphql } from "gatsby"
|
import { graphql } from "gatsby"
|
||||||
import React, { Fragment } from "react"
|
import React, { Fragment } from "react"
|
||||||
import { MarkdownRemark, Query } from "../../generated/graphql"
|
import { MarkdownRemark } from "../../generated/graphql"
|
||||||
import { Markdown } from "../components/Markdown"
|
import { Markdown } from "../components/Markdown"
|
||||||
import { SEO } from "../components/SEO"
|
import { SEO } from "../components/SEO"
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { SEO } from "../components/SEO"
|
|||||||
function LanguagePost({ data }: any) {
|
function LanguagePost({ data }: any) {
|
||||||
const { relativePath } = data.file
|
const { relativePath } = data.file
|
||||||
const { html, fields, frontmatter, timeToRead } = data.file.post
|
const { html, fields, frontmatter, timeToRead } = data.file.post
|
||||||
console.log(data)
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<SEO title={frontmatter.title} />
|
<SEO title={frontmatter.title} />
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
"no-eval": true,
|
"no-eval": true,
|
||||||
"no-parameter-reassignment": true,
|
"no-parameter-reassignment": true,
|
||||||
"no-submodule-imports": false,
|
"no-submodule-imports": false,
|
||||||
|
"no-unused-variable": true,
|
||||||
|
|
||||||
"react-hooks-nesting": "error"
|
"react-hooks-nesting": "error"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user