Skip to content

Commit f50e76b

Browse files
committed
Added Post Info back to Sidebar
1 parent b77f5df commit f50e76b

File tree

5 files changed

+34
-23
lines changed

5 files changed

+34
-23
lines changed

src/components/sidebar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function SideBar(props) {
77
let post = props.post;
88
return (
99
<div id="post-sidebar">
10+
<PostInfo post={post} />
1011
<TagList tags={post.tags} />
1112
</div>
1213
);

src/components/sidebar/post_data.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ function Entry(props) {
1414
function PostInfo(props) {
1515
let post = props.post;
1616
if (post.created_at === undefined) return <div className="post-info" />;
17+
18+
let created_at = new Date(post.created_at * 1000).toLocaleDateString();
1719
return (
18-
<div>
19-
<Entry name="Created At" value={new Date(post.created_at * 1000).toDateString()} />
20+
<div id="post_data">
21+
<Entry name="ID" value={post.id} />
22+
<Entry name="Created At" value={created_at} />
23+
<Entry name="Source" value={post.source} />
24+
<Entry name="Views" value={post.views} />
2025
</div>
2126
);
2227
}

src/components/sidebar/sidebar.css

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,18 @@
55
min-width: 15rem;
66
max-width: 15rem;
77

8-
padding: .5rem;
9-
padding-right: 1rem;
10-
118
/* Look */
129
overflow-x: hidden;
1310
overflow-y: auto;
1411
background-color: var(--COLOR-2);
12+
border-right: 1px solid black;
1513
}
1614

15+
1716
@media screen and (max-aspect-ratio: 1/1) {
1817
#post-sidebar{display:none !important}
1918
}
2019

21-
22-
.tag-list{
23-
display: flex;
24-
flex-direction: column;
25-
flex-wrap: nowrap;
26-
}
27-
28-
.namespace-generic{
29-
color: black;
30-
}
31-
32-
.namespace-character{
33-
color: purple;
34-
}
35-
36-
.namespace-meta{
37-
color: rgb(40, 40, 40);
20+
#post_data{
21+
margin: .5rem;
3822
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.tag-list{
2+
display: flex;
3+
flex-direction: column;
4+
flex-wrap: nowrap;
5+
6+
padding: .5rem;
7+
border-top: 1px solid black;
8+
}
9+
10+
.namespace-generic{
11+
color: black;
12+
}
13+
14+
.namespace-character{
15+
color: purple;
16+
}
17+
18+
.namespace-meta{
19+
color: rgb(40, 40, 40);
20+
}

src/components/sidebar/tag_list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from "react";
2+
import "./tag_list.css"
23

34
function Tag(props) {
45
let namespace = props.namespace || "generic";
5-
return <a className={`namespace-${namespace}`}>{props.name}</a>;
6+
return <span className={`namespace-${namespace}`}>{props.name}</span>;
67
}
78

89
function TagList(props) {

0 commit comments

Comments
 (0)