Skip to content

Commit

Permalink
fix(clayui.com): A page wasn't found for "/docs" message in browser c…
Browse files Browse the repository at this point in the history
…onsole

fix(clayui.com): Blogs `Warning: ClayIcon requires a `spritemap` via prop or ClayIconSpriteContext` in console

fix(clayui.com): Removes `13:7  warning  'spritemap' is assigned a value but never used  no-unused-vars` from blog.js
  • Loading branch information
pat270 committed Aug 12, 2020
1 parent 27bd552 commit 0f577c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 10 additions & 4 deletions clayui.com/src/components/LayoutNav/LayoutNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const spritemap = '/images/icons/icons.svg';

const DEV = process.env.GATSBY_CLAY_NIGHTLY === 'true';

export default () => {
export default (location) => {
const [showAtlas, setShowAtlas] = useStateWithLocalStorage(
true,
'clay.showAtlas'
Expand All @@ -26,6 +26,8 @@ export default () => {
'clay.showSiteCss'
);

const pathname = location.pathname || '';

return (
<nav className="navbar navbar-clay-site navbar-expand-lg navbar-light">
<div className="autofit-float-sm-down autofit-padded autofit-row">
Expand All @@ -36,10 +38,13 @@ export default () => {
<ul className="ml-auto navbar-nav">
<li className="nav-item">
<Link
activeStyle={{color: '#b3472d'}}
className="nav-link"
partiallyActive
to="/docs/"
style={{
color: pathname.match(/docs\//g)
? '#b3472d'
: '',
}}
to="/docs/get-started/index.html"
>
<span className="c-inner" tabIndex="-1">
{'Docs'}
Expand Down Expand Up @@ -149,6 +154,7 @@ export default () => {
<ClayButtonWithIcon
className="nav-link"
displayType="unstyled"
spritemap={spritemap}
symbol="cog"
/>
}
Expand Down
2 changes: 1 addition & 1 deletion clayui.com/src/templates/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default ({data, location}) => {
<div className="flex-xl-nowrap row">
<Sidebar data={list} location={location} />
<div className="col-xl sidebar-offset">
<LayoutNav />
<LayoutNav pathname={location.pathname} />
<div className="clay-blog-content">
<header>
<div className="clay-site-container container-fluid">
Expand Down
4 changes: 3 additions & 1 deletion clayui.com/src/templates/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export default (props) => {
location={location}
/>
<div className="col-xl sidebar-offset">
<LayoutNav />
<LayoutNav
pathname={location.pathname}
/>
<header>
<div className="clay-site-container container-fluid">
<div className="row">
Expand Down

0 comments on commit 0f577c2

Please sign in to comment.