mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
added treeview dependency
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
80f91b5dc1
commit
378bb7d4db
+1
-1
@@ -34,7 +34,7 @@ module.exports = {
|
|||||||
resolve: `gatsby-plugin-manifest`,
|
resolve: `gatsby-plugin-manifest`,
|
||||||
options: {
|
options: {
|
||||||
name: `The Programmers Hangout`,
|
name: `The Programmers Hangout`,
|
||||||
short_name: `starter`,
|
short_name: `TPH`,
|
||||||
start_url: `/`,
|
start_url: `/`,
|
||||||
background_color: `#663399`,
|
background_color: `#663399`,
|
||||||
theme_color: `#ba1a2e`,
|
theme_color: `#ba1a2e`,
|
||||||
|
|||||||
Generated
+17
@@ -1790,6 +1790,15 @@
|
|||||||
"@types/react": "*"
|
"@types/react": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/react-treeview": {
|
||||||
|
"version": "0.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/react-treeview/-/react-treeview-0.4.2.tgz",
|
||||||
|
"integrity": "sha512-pL2IuQrSPbOgn4wQ4B24bekCjyoa6KpereAtYroMwt3dAeFivchksF00oWkNjEoX3NBQ0gZGuu6fa1AzL5Whgw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/react": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/styled-components": {
|
"@types/styled-components": {
|
||||||
"version": "4.1.18",
|
"version": "4.1.18",
|
||||||
"resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.1.18.tgz",
|
"resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.1.18.tgz",
|
||||||
@@ -14092,6 +14101,14 @@
|
|||||||
"shallowequal": "^1.0.1"
|
"shallowequal": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"react-treeview": {
|
||||||
|
"version": "0.4.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-treeview/-/react-treeview-0.4.7.tgz",
|
||||||
|
"integrity": "sha1-9kfgT3BJbrEfsJEsNRh+gOtg1Fg=",
|
||||||
|
"requires": {
|
||||||
|
"prop-types": "^15.5.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"read": {
|
"read": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz",
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
"react-dom": "^16.8.6",
|
"react-dom": "^16.8.6",
|
||||||
"react-helmet": "^5.2.1",
|
"react-helmet": "^5.2.1",
|
||||||
"react-perfect-scrollbar": "^1.5.3",
|
"react-perfect-scrollbar": "^1.5.3",
|
||||||
|
"react-treeview": "^0.4.7",
|
||||||
"styled-components": "^4.3.2"
|
"styled-components": "^4.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
"@types/react": "^16.8.23",
|
"@types/react": "^16.8.23",
|
||||||
"@types/react-dom": "^16.8.5",
|
"@types/react-dom": "^16.8.5",
|
||||||
"@types/react-helmet": "^5.0.8",
|
"@types/react-helmet": "^5.0.8",
|
||||||
|
"@types/react-treeview": "^0.4.2",
|
||||||
"prettier": "^1.18.2",
|
"prettier": "^1.18.2",
|
||||||
"@graphql-codegen/typescript": "1.4.0",
|
"@graphql-codegen/typescript": "1.4.0",
|
||||||
"@graphql-codegen/typescript-operations": "1.4.0",
|
"@graphql-codegen/typescript-operations": "1.4.0",
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { SidebarScroller } from "./style";
|
||||||
|
import Tree from "react-treeview";
|
||||||
|
|
||||||
const Sidebar = () => { }
|
const makeTree = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const Sidebar = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tree
|
||||||
|
nodeLabel={<div>"Javascript"</div>}
|
||||||
|
>
|
||||||
|
<Tree
|
||||||
|
nodeLabel={<div>"Javascript"</div>}
|
||||||
|
>
|
||||||
|
Test
|
||||||
|
</Tree>
|
||||||
|
</Tree>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export default Sidebar;
|
export default Sidebar;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import styled from "styled-components";
|
||||||
|
|
||||||
|
export const SidebarScroller = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
`
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { SidebarTitle } from "./style";
|
||||||
|
|
||||||
|
export interface SidebarSectionProps {
|
||||||
|
readonly title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SidebarSection = ({ title, children }: React.PropsWithChildren<SidebarSectionProps>) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<SidebarTitle>{title}</SidebarTitle>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SidebarSection;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import styled from "styled-components";
|
||||||
|
|
||||||
|
export const SidebarTitle = styled.h3`
|
||||||
|
text-transform: uppercase;
|
||||||
|
`;
|
||||||
@@ -2,6 +2,7 @@ import React from "react";
|
|||||||
import { graphql } from "gatsby";
|
import { graphql } from "gatsby";
|
||||||
import SEO from "../components/SEO";
|
import SEO from "../components/SEO";
|
||||||
import Layout from "../components/Layout";
|
import Layout from "../components/Layout";
|
||||||
|
import { Sidebar } from "../components/Docs";
|
||||||
|
|
||||||
// @todo maybe find alternative type for data
|
// @todo maybe find alternative type for data
|
||||||
const LanguagePost = ({ data }: any) => {
|
const LanguagePost = ({ data }: any) => {
|
||||||
@@ -10,6 +11,7 @@ const LanguagePost = ({ data }: any) => {
|
|||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<SEO title={frontmatter.title} />
|
<SEO title={frontmatter.title} />
|
||||||
|
<Sidebar />
|
||||||
<div dangerouslySetInnerHTML={{ __html: html }} />
|
<div dangerouslySetInnerHTML={{ __html: html }} />
|
||||||
</Layout >
|
</Layout >
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user