diff --git a/contacts/src/App.js b/contacts/src/App.js index fe9ab72..2660374 100644 --- a/contacts/src/App.js +++ b/contacts/src/App.js @@ -1,11 +1,11 @@ import React, {Component} from 'react' +import { Route } from 'react-router-dom' import ListContacts from './ListContacts' import * as ContactsAPI from './utils/ContactsAPI' import CreateContact from './CreateContact' class App extends Component { state = { - screen: 'list', // list, create contacts: [] } removeContact = (contact) => { @@ -24,20 +24,15 @@ class App extends Component { render() { return ( -
- {this.state.screen === 'list' && ( +
+ ( { - this.setState({ screen: 'create'}) - }} + onDeleteContact={this.removeContact} + contacts={this.state.contacts} /> - )} + )}/> - {this.state.screen === 'create' && ( - - )} +