Skip to content

Commit b907f77

Browse files
committed
hide best header link if not on /best
1 parent 819c230 commit b907f77

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/components/presentational/HeaderNav.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import Link from 'next/link';
33
import PropTypes from 'prop-types';
44

5-
const HeaderNav = props => (
5+
const HeaderNav = props => (console.log(props.currentUrl),
66
props.isNavVisible ?
77
<span className="pagetop">
88
<b className="hnname">
@@ -43,10 +43,16 @@ const HeaderNav = props => (
4343
<Link prefetch href="/submit">
4444
<a className={props.currentURL === '/submit' ? 'topsel' : ''}>submit</a>
4545
</Link>
46-
{' | '}
47-
<Link prefetch href="/best">
48-
<a className={props.currentURL === '/best' ? 'topsel' : ''}>best</a>
49-
</Link>
46+
{
47+
props.currentURL === '/best' && ' | '
48+
}
49+
{
50+
props.currentURL === '/best' && (
51+
<Link prefetch href="/best">
52+
<a className="topsel">best</a>
53+
</Link>
54+
)
55+
}
5056
</span>
5157
:
5258
<span className="pagetop">

0 commit comments

Comments
 (0)