Skip to content

Instantly share code, notes, and snippets.

@yusinto
Last active July 16, 2018 10:11
Show Gist options
  • Save yusinto/c53edbc178d9dd3289c1a80050e9f20f to your computer and use it in GitHub Desktop.
Save yusinto/c53edbc178d9dd3289c1a80050e9f20f to your computer and use it in GitHub Desktop.
Adding react-site-nav to create-react-app
import React from 'react';
import logo from './logo.svg';
import './App.css';
import SiteNav, {ContentGroup} from 'react-site-nav';
export default () => (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo"/>
<h1 className="App-title">Welcome to React</h1>
</header>
<SiteNav>
<ContentGroup title="About" width="240" height="140">
<ul>
<li>About me</li>
<li>My projects</li>
</ul>
</ContentGroup>
<ContentGroup title="Contact" width="200" height="150">
<ul>
<li><a href="https://github.com/yusinto">Github</a></li>
<li><a href="https://twitter.com/yusinto">Twitter</a></li>
</ul>
</ContentGroup>
</SiteNav>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment