Skip to content

Instantly share code, notes, and snippets.

@kkemple
Created February 1, 2019 13:39
Show Gist options
  • Save kkemple/cbdcf607ebf980ff64ef49408153616d to your computer and use it in GitHub Desktop.
Save kkemple/cbdcf607ebf980ff64ef49408153616d to your computer and use it in GitHub Desktop.
...
return (
<div
style={{
marginLeft: `auto`,
marginRight: `auto`,
maxWidth: rhythm(24),
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
}}
>
{!isDashboard && (
<div
style={{
position: `fixed`,
top: `8px`,
right: `16px`,
}}
>
<Link to="/dashboard">Dashboard</Link>
</div>
)}
{header}
{children}
<footer>
© {new Date().getFullYear()}, Built with
{` `}
<a href="https://www.gatsbyjs.org">Gatsby</a>
</footer>
</div>
)
...
@thelovesmith
Copy link

thelovesmith commented Jul 12, 2019

Good afternoon, I am following the tutorial on HackerNews how ever When updating the above return statement to add the Dashboard link I keep getting "isDashboard" is not defined: I am sending 'isDashboard' through the Dashboard component on dashboard.js but it still doesn't work. And I definitely followed the tutorial. I'm not sure what is missing. My code looks exactly like above. And i keep getting the below error

Error:
`
error in ./src/components/layout.js

Module Error (from ./node_modules/eslint-loader/index.js):

/mnt/c/Users/PARFunding/Desktop/AHinds/blog/src/components/layout.js
64:12 error 'isDashboard' is not defined no-undef

✖ 1 problem (1 error, 0 warnings)

@ ./src/templates/blog-post.js 17:0-42 38:31-37
@ ./.cache/sync-requires.js
@ ./.cache/app.js
@ multi ./node_modules/event-source-polyfill/src/eventsource.js (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment