mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
Merge pull request #85 from the-programmers-hangout/refact-general-cleanup
refact: general cleanup
This commit is contained in:
+1
-1
@@ -6,4 +6,4 @@
|
||||
|
||||
// You can delete this file if you're not using it
|
||||
|
||||
require('prismjs/themes/prism-tomorrow.css');
|
||||
require("prismjs/themes/prism-tomorrow.css")
|
||||
|
||||
@@ -13,15 +13,16 @@ export const SidebarContext = React.createContext<ISidebarContextInterface | nul
|
||||
null
|
||||
)
|
||||
|
||||
export function SidebarProvider({
|
||||
children,
|
||||
}: ISidebarProviderProps) {
|
||||
export function SidebarProvider({ children }: ISidebarProviderProps) {
|
||||
const [current, setCurrent] = useState(0)
|
||||
|
||||
const memoizedContextValue = useMemo(() => ({
|
||||
current,
|
||||
setCurrent,
|
||||
}), [current, setCurrent])
|
||||
const memoizedContextValue = useMemo(
|
||||
() => ({
|
||||
current,
|
||||
setCurrent,
|
||||
}),
|
||||
[current, setCurrent]
|
||||
)
|
||||
|
||||
return (
|
||||
<SidebarContext.Provider value={memoizedContextValue}>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import styled from "styled-components"
|
||||
|
||||
export const ContainerWrapper = styled.div`
|
||||
`
|
||||
export const ContainerWrapper = styled.div``
|
||||
|
||||
@@ -11,7 +11,6 @@ export function Footer() {
|
||||
{` `}
|
||||
<a href="https://www.gatsbyjs.org">Gatsby</a>
|
||||
</p>
|
||||
|
||||
</Container>
|
||||
</SC.FooterWrapper>
|
||||
)
|
||||
|
||||
@@ -69,14 +69,14 @@ export function ResourceBreadcrumb({ relativePath }: IResourceBreadcrumbProps) {
|
||||
{breadcrumbItems.map(item => {
|
||||
if (item.type === "folder") {
|
||||
return (
|
||||
<SC.LinkWrapper>
|
||||
<SC.LinkWrapper key={item.path}>
|
||||
<Link item={item} />
|
||||
<ChevronUp />
|
||||
</SC.LinkWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
return <SC.CurrentPage>{item.title}</SC.CurrentPage>
|
||||
return <SC.CurrentPage key={item.path}>{item.title}</SC.CurrentPage>
|
||||
})}
|
||||
</SC.ResourceBreadcrumbWrapper>
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Link } from "gatsby"
|
||||
import { darken, lighten } from "polished"
|
||||
import styled, { css } from "styled-components"
|
||||
import { fontFamily, modularScale } from "../../design/typography"
|
||||
import { darken, lighten } from "polished"
|
||||
|
||||
export const ResourceHeaderWrapper = styled.div`
|
||||
border-bottom: 1px solid #dbdbdb;
|
||||
|
||||
@@ -33,9 +33,7 @@ export function ResourcesLayout({ children }: PropsWithChildren<{}>) {
|
||||
<MobileHeader openMenu={openMenu} />
|
||||
<ResourcesSidebar className={activeMobileMenu ? "is-open" : ""} />
|
||||
<SC.MainContent>
|
||||
<SC.Container>
|
||||
{children}
|
||||
</SC.Container>
|
||||
<SC.Container>{children}</SC.Container>
|
||||
</SC.MainContent>
|
||||
</SC.Main>
|
||||
<SC.Overlay
|
||||
|
||||
@@ -120,7 +120,6 @@ export const TreeWrapper = styled.div<{ collapsed: boolean }>`
|
||||
|
||||
${Children} {
|
||||
display: ${props => (props.collapsed ? "none" : "flex")};
|
||||
/* height: ${props => (props.collapsed ? 0 : "auto")}; */
|
||||
}
|
||||
|
||||
& > ${Label} svg {
|
||||
|
||||
@@ -44,7 +44,9 @@ function generateFile({
|
||||
}
|
||||
|
||||
function join([head, ...tail]: IFileOrFolder[]): IFileOrFolder[] {
|
||||
if (!head) { return [] }
|
||||
if (!head) {
|
||||
return []
|
||||
}
|
||||
|
||||
const [similarFs, remaining] = partition(
|
||||
obj => obj.title === head.title && obj.type === head.type,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { graphql } from "gatsby"
|
||||
import React, { Fragment } from "react"
|
||||
import { MarkdownRemark } from "../../generated/graphql"
|
||||
import { ComponentQuery } from "../../typings"
|
||||
import { Markdown } from "../components/Markdown"
|
||||
import { SEO } from "../components/SEO"
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { graphql } from "gatsby"
|
||||
import React, { Fragment } from "react"
|
||||
import { MarkdownRemark } from "../../generated/graphql"
|
||||
import { ComponentQuery } from "../../typings"
|
||||
import { Markdown } from "../components/Markdown"
|
||||
import { SEO } from "../components/SEO"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user