Skip to content

Commit

Permalink
misc: handle empty values for github button, sidebar links
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikvt26 authored Feb 25, 2020
1 parent 6956c2e commit 9868ec4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ const SidebarLayout = ({location}) => (
<Tree
edges={allMdx.edges}
/>
<Divider />
{
config.sidebar.links
&& config.sidebar.links.length > 0
&& (<Divider />)
}
{config.sidebar.links.map((link, key) => {
if (link.link !== '' && link.text !== '') {
return (
Expand Down
8 changes: 5 additions & 3 deletions src/templates/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ export default class MDXRuntimeTest extends Component {
{mdx.fields.title}
</h1>
<Edit className={'mobileView'}>
<Link className={'gitBtn'} to={`${docsLocation}/${mdx.parent.relativePath}`}>
<img src={gitHub} alt={'Github logo'} /> Edit on GitHub
</Link>
{docsLocation &&
<Link className={'gitBtn'} to={`${docsLocation}/${mdx.parent.relativePath}`}>
<img src={gitHub} alt={'Github logo'} /> Edit on GitHub
</Link>
}
</Edit>
</div>
<div className={'mainWrapper'}>
Expand Down

0 comments on commit 9868ec4

Please sign in to comment.