Skip to content

Commit 0173eab

Browse files
committed
refactored
1 parent 942b15b commit 0173eab

File tree

9 files changed

+10
-105
lines changed

9 files changed

+10
-105
lines changed

gatsby-node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ exports.createPages = ({ actions, graphql }) => {
3939
const edges = res.data.allFile.edges
4040
for (let i = 0; i < edges.length; i++) {
4141
const filename = edges[i].node.name
42+
console.log(filename)
4243
const { data: contributorsRaw } = await axios.get(
4344
`https://api.github.com/repos/devsonket/devsonket.github.io/commits?path=data/${filename}.json`,
4445
{

src/components/common/description.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react"
22
import styled from "@emotion/styled"
3-
import Contributors from "../contributors"
43

54
const DescriptionContainer = styled.div`
65
text-align: center;

src/components/content.js

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,9 @@
1-
// import React from "react"
2-
// import styled from "@emotion/styled"
3-
4-
// import { Sheet } from "./common"
5-
6-
// const SingleContent = styled.div`
7-
// display: flex;
8-
// flex-flow: row wrap;
9-
// & > div {
10-
// margin: 15px;
11-
// flex: 1 1 calc(50% - 30px);
12-
// @media print {
13-
// margin: 15px 50px;
14-
// }
15-
// @media only screen and (max-width: 668px) {
16-
// flex-basis: calc(100% - 20px);
17-
// margin: 0 10px;
18-
// margin-bottom: 15px;
19-
// }
20-
// @media print {
21-
// flex-basis: 100%;
22-
// }
23-
// }
24-
// `
25-
26-
// const SheetTitle = styled.div`
27-
// display: flex;
28-
// flex-wrap: wrap;
29-
// align-items: center;
30-
// justify-content: space-between;
31-
// & a {
32-
// text-decoration: none;
33-
// background: #00000080;
34-
// color: #fff;
35-
// font-weight: 900;
36-
// text-transform: uppercase;
37-
// font-size: 13px;
38-
// padding: 1px 10px;
39-
// border-radius: 4px;
40-
// margin-bottom: 15px;
41-
// opacity: 0;
42-
// }
43-
// `
44-
45-
// const Content = ({ data }) => (
46-
// <SingleContent>
47-
// {data.contents.map(({ title, items, code: onlyCode }, index) => (
48-
// <Sheet id={index + 1} key={index}>
49-
// <SheetTitle className="sheet-title">
50-
// <h3>{title}</h3>
51-
// <a href={`/${data.slug}/#${index + 1}`}>Link</a>
52-
// </SheetTitle>
53-
// <ul className="single-item">
54-
// {items ? (
55-
// items.map(({ definition, code }, index) => (
56-
// <li key={index} className="item">
57-
// {definition && (
58-
// <p
59-
// className="def"
60-
// dangerouslySetInnerHTML={{ __html: definition }}
61-
// />
62-
// )}
63-
// {code && (
64-
// <pre className="code">
65-
// <code>{code}</code>
66-
// </pre>
67-
// )}
68-
// </li>
69-
// ))
70-
// ) : (
71-
// <pre className="code">
72-
// <code>{onlyCode}</code>
73-
// </pre>
74-
// )}
75-
// </ul>
76-
// </Sheet>
77-
// ))}
78-
// </SingleContent>
79-
// )
80-
81-
// export default Content
82-
831
import React from "react"
842
import styled from "@emotion/styled"
853

864
import AllItems from "./allitems"
875

88-
import { Container, Curve, Section, ThinContainer } from "./common"
6+
import { Curve, Section, ThinContainer } from "./common"
897
import PopularItems from "./popularitems"
908
import Item from "./item"
919

src/components/intro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Header from "./header"
55
import IntroHome from "./introhome"
66
import IntroItem from "./introitem"
77

8-
import { Container, Logo, ThinContainer } from "./common"
8+
import { Container, ThinContainer } from "./common"
99

1010
const IntroContainer = styled.div`
1111
background: ${props => props.colorpref};

src/components/introitem.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react"
22
import styled from "@emotion/styled"
33
import { FiPrinter } from "react-icons/fi"
4-
import SearchResult from "./searchresult"
54
import { ThinContainer, Description } from "./common"
65
import SocialShare from "./socialshare"
76
import Contributors from "./contributors"

src/components/navbar.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ const Navbar = styled.nav`
2222
ul li {
2323
display: inline-block;
2424
}
25-
/* li.btn-add {
26-
float: right;
27-
@media only screen and (max-width: 460px) {
28-
display: none;
29-
}
30-
} */
31-
/* .btn-add a {
32-
background-color: #4caf50;
33-
color: #fff;
34-
text-decoration: none;
35-
padding: 5px 10px;
36-
border-radius: 4px;
37-
} */
3825
`
3926

4027
export default () => (

src/components/printcontent.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import React, { useState, useEffect } from "react"
1+
import React from "react"
22
import styled from "@emotion/styled"
3-
import axios from "axios"
43

54
import { PrintSheet, Logo, Button } from "./common"
6-
import { cheatsheetMap, contributorMap } from "../utils"
5+
import { cheatsheetMap } from "../utils"
76

87
import githubLogo from "../images/github.png"
98

src/components/searchresult.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ const SearchResult = () => {
167167
) {
168168
return edge
169169
}
170+
return false
170171
})
171172
}
172173
const data = matchNums.map(one => edges[one])

src/components/socialshare.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const SocialShareContainer = styled.div`
2020
list-style: none;
2121
li {
2222
margin: 0 5px;
23-
a {
23+
a,
24+
span {
2425
cursor: pointer;
2526
display: inline-block;
2627
background: ${props =>
@@ -95,9 +96,9 @@ const SocialShare = ({ id, description, islightcolor }) => {
9596
</a>
9697
</li>
9798
<li>
98-
<a onClick={handleCopy}>
99+
<span onClick={handleCopy}>
99100
<FiLink />
100-
</a>
101+
</span>
101102
</li>
102103
</ul>
103104
</SocialShareContainer>

0 commit comments

Comments
 (0)