Skip to content

Commit

Permalink
refactored app to use react-router
Browse files Browse the repository at this point in the history
  • Loading branch information
aribray committed Jun 26, 2019
1 parent ff5ff00 commit 3191328
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
32 changes: 23 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,29 @@ class App extends Component {
render() {
return (
<div>
<header>
{/* <Search /> */}
<button onClick={this.showMovieToggle}>Show Movies</button>
<button onClick={this.showCustomerToggle}>Show Customers</button>
</header>
<main>
{this.state.showCustomers && <CustomerList />}
{this.state.showMovies && <RentalLibrary />}
</main>
<Router>
<div>
<nav>
<ul>
{/* <Search /> */}
<li>
<Link to="/movies" className="movies">Movies</Link>
</li>
<li>
<Link to="/customers" className="customers">Customers</Link>
</li>
{/* <button onClick={this.showMovieToggle}>Show Movies</button>
<button onClick={this.showCustomerToggle}>Show Customers</button> */}
</ul>
</nav>
</div>
<main>
<Route path="/movies" component={RentalLibrary} />
<Route path="/customers" component={CustomerList} />
{/* {this.state.showCustomers && <CustomerList />}
{this.state.showMovies && <RentalLibrary />} */}
</main>
</Router>
</div>
);
// return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/Customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import PropTypes from 'prop-types';

const Customer = (props) => {



return (
<div className="customer">
<div className="content">
Expand Down

0 comments on commit 3191328

Please sign in to comment.