File tree 5 files changed +38
-8
lines changed
5 files changed +38
-8
lines changed Original file line number Diff line number Diff line change 10
10
11
11
---
12
12
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.
14
14
15
15
My target of mocking is https://vue-hn.now.sh , made with Vue, please do check it out.
16
16
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import { Link } from 'react-router-dom'
2
+ import { NavLink } from 'react-router-dom'
3
3
4
4
export default function NavBar ( ) {
5
5
return (
6
6
< div className = "nav" >
7
7
< 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 ♥ by Lucas Zeng</ a >
13
15
</ ul >
14
16
</ div >
15
17
)
Original file line number Diff line number Diff line change 2
2
3
3
.item-content {
4
4
max-width : 800px ;
5
- margin : 0 auto;
5
+ margin : auto;
6
+ display : block;
7
+ overflow-x : hidden;
6
8
}
7
9
8
10
.item-head {
Original file line number Diff line number Diff line change @@ -34,8 +34,27 @@ body {
34
34
margin-right : 1.8em ;
35
35
font-weight : 400 ;
36
36
}
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
+ }
37
46
47
+ .nav-container > .is-active {
48
+ font-weight : 600 ;
49
+ }
38
50
51
+ .github-link {
52
+ margin-left : auto;
53
+ }
54
+ .github-link : hover {
55
+ text-decoration : underline;
56
+ color : # 222 ;
57
+ }
39
58
/* list-view > list-paginator > paginator-container
40
59
/* > item > ... */
41
60
@@ -76,4 +95,10 @@ body {
76
95
.item {
77
96
margin-top : 50px ;
78
97
background-color : # fff ;
98
+ }
99
+
100
+ @media screen and (max-width : 560px ) {
101
+ .github-link {
102
+ display : none;
103
+ }
79
104
}
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ a:hover {
42
42
.li-meta {
43
43
margin-top : 9px ;
44
44
display : flex;
45
+ flex-wrap : wrap;
45
46
font-weight : 400 ;
46
47
font-size : 0.9rem ;
47
48
color : # 666 ;
You can’t perform that action at this time.
0 commit comments