Skip to content

Commit d247aa6

Browse files
committed
tweaks on style and readme
1 parent d53d328 commit d247aa6

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
---
1212

13-
every file and char is made with heart. If you find it flawed or yet to improve, please inform me via github issues.
13+
files and chars are considered and created. If you find it flawed or yet to improve, please inform me via github issues.
1414

1515
My target of mocking is https://vue-hn.now.sh, made with Vue, please do check it out.
1616

src/components/NavBar.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React from 'react'
2-
import {Link} from 'react-router-dom'
2+
import {NavLink} from 'react-router-dom'
33

44
export default function NavBar () {
55
return (
66
<div className="nav">
77
<ul className="nav-container">
8-
<Link to="/top" className="nav-link">Top</Link>
9-
<Link to="/new" className="nav-link">New</Link>
10-
<Link to="/show" className="nav-link">Show</Link>
11-
<Link to="/ask" className="nav-link">ask</Link>
12-
<Link to="/job" className="nav-link">jobs</Link>
8+
<NavLink to="/" className="nav-link nav-title">HN</NavLink>
9+
<NavLink to="/top" activeClassName="is-active" className="nav-link">Top</NavLink>
10+
<NavLink to="/new" activeClassName="is-active" className="nav-link">New</NavLink>
11+
<NavLink to="/show" activeClassName="is-active" className="nav-link">Show</NavLink>
12+
<NavLink to="/ask" activeClassName="is-active" className="nav-link">ask</NavLink>
13+
<NavLink to="/job" activeClassName="is-active" className="nav-link">jobs</NavLink>
14+
<a className="github-link" href="https://github.com/LucasZeng99/react-hackernews">with &hearts; by Lucas Zeng</a>
1315
</ul>
1416
</div>
1517
)

src/css/itemView.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
.item-content {
44
max-width: 800px;
5-
margin: 0 auto;
5+
margin: auto;
6+
display: block;
7+
overflow-x: hidden;
68
}
79

810
.item-head {

src/css/layout.css

+25
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,27 @@ body {
3434
margin-right: 1.8em;
3535
font-weight: 400;
3636
}
37+
.nav-container > a:hover {
38+
text-decoration: underline;
39+
}
40+
.nav-container > a.nav-title {
41+
font-weight: 800;
42+
padding: 3px;
43+
line-height: 16px;
44+
border: 2px solid rgb(255, 252, 252);
45+
}
3746

47+
.nav-container > .is-active {
48+
font-weight: 600;
49+
}
3850

51+
.github-link {
52+
margin-left: auto;
53+
}
54+
.github-link:hover {
55+
text-decoration: underline;
56+
color: #222;
57+
}
3958
/* list-view > list-paginator > paginator-container
4059
/* > item > ... */
4160

@@ -76,4 +95,10 @@ body {
7695
.item {
7796
margin-top: 50px;
7897
background-color: #fff;
98+
}
99+
100+
@media screen and (max-width : 560px) {
101+
.github-link {
102+
display: none;
103+
}
79104
}

src/css/listView.css

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ a:hover {
4242
.li-meta {
4343
margin-top: 9px;
4444
display: flex;
45+
flex-wrap: wrap;
4546
font-weight: 400;
4647
font-size: 0.9rem;
4748
color: #666;

0 commit comments

Comments
 (0)