Skip to content

Instantly share code, notes, and snippets.

@bautistaaa
Created March 18, 2020 04:14
Show Gist options
  • Select an option

  • Save bautistaaa/32a4d974b6c1b27bb6763a0e98cfc049 to your computer and use it in GitHub Desktop.

Select an option

Save bautistaaa/32a4d974b6c1b27bb6763a0e98cfc049 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import './App.css';
import DummyStore from './dummy-store';
import Header from './Header';
import SidebarSection from './SidebarSection';
import NoteSection from './NoteSection';
class App extends Component {
constructor(props) {
super(props)
this.state = {
folders: DummyStore.folders,
notes: DummyStore.notes,
}
}
render() {
return (
<div>
<Header />
<main>
<Sidebar>
<Route
path='/'
render={(routerProps) =>
<SidebarSection
folders={this.state.folders}
...routerProps
/>
}
/>
<Route
path='/folder/:folderId'
render={(routerProps) =>
<SidebarSection
folders={this.state.folders}
...routerProps
/>
}
/>
</SideBar>
<MainSection>
<Route
path='/'
render={(routerProps) =>
<SidebarSection
folders={this.state.folders}
...routerProps
/>
}
/>
<Route
path='/folder/:folderId'
render={(routerProps) =>
<
folders={this.state.folders}
...routerProps
/>
}
/>
</MainSection>
</main>
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment