forked from devsonket/devsonket.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary.js
More file actions
74 lines (70 loc) · 1.71 KB
/
Copy pathlibrary.js
File metadata and controls
74 lines (70 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import React from "react"
import { StaticQuery, graphql } from "gatsby"
import styled from "@emotion/styled"
import { Container, Card } from "./common"
import { organizedData } from "../utils"
const LibraryContainer = styled.div`
h2 {
text-align: center;
font-size: 22px;
color: rgba(0, 0, 0, 0.5);
}
.content h3 {
font-size: 18px;
padding-left: 15px;
margin-bottom: 15px;
color: rgba(0, 0, 0, 0.5);
}
.items {
display: flex;
flex-wrap: wrap;
margin-bottom: 30px;
}
.items > div {
width: calc(33.3333% - 20px);
@media only screen and (max-width: 460px) {
width: 100%;
}
}
`
export default () => (
<LibraryContainer>
<Container>
<h2>সবগুলো</h2>
<StaticQuery
query={graphql`
query {
allFile(
filter: {
extension: { eq: "json" }
relativeDirectory: { nin: "demo", ne: "draft" }
}
limit: 1000
) {
edges {
node {
id
name
}
}
}
}
`}
render={({ allFile: { edges } }) =>
Object.keys(organizedData(edges)).map((char, index) => (
<React.Fragment key={index}>
<div className="content">
<h3>{char}</h3>
<div className="items">
{organizedData(edges)[char].map(({ id, title }) => (
<Card contentCard key={id} id={id} title={title} />
))}
</div>
</div>
</React.Fragment>
))
}
/>
</Container>
</LibraryContainer>
)