End of chapter 17

This commit is contained in:
Martin Donnelly 2019-09-27 10:36:50 +01:00
parent b86fbe309f
commit 2c8932d42c
3 changed files with 48 additions and 3 deletions

View File

@ -2,6 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="5be46653-49b7-409a-9549-21ca1be137cc" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/components/users/Search.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/App.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/App.js" afterDir="false" />
</list>
@ -100,7 +101,7 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1569429914875</updated>
<workItem from="1569429916226" duration="9177000" />
<workItem from="1569429916226" duration="10267000" />
</task>
<task id="LOCAL-00001" summary="End of Chapter 14">
<created>1569512995385</created>
@ -123,7 +124,14 @@
<option name="project" value="LOCAL" />
<updated>1569528324388</updated>
</task>
<option name="localTasksCounter" value="4" />
<task id="LOCAL-00004" summary="End of chapter 16">
<created>1569576014565</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1569576014565</updated>
</task>
<option name="localTasksCounter" value="5" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -145,6 +153,7 @@
<MESSAGE value="End of Chapter 14" />
<MESSAGE value="End of Chapter 15" />
<MESSAGE value="Added some settings" />
<option name="LAST_COMMIT_MESSAGE" value="Added some settings" />
<MESSAGE value="End of chapter 16" />
<option name="LAST_COMMIT_MESSAGE" value="End of chapter 16" />
</component>
</project>

View File

@ -1,6 +1,7 @@
import React, { Component } from 'react';
import Navbar from './components/layout/Navbar';
import Users from './components/users/Users';
import Search from './components/users/Search';
import axios from 'axios';
import './App.css';
@ -21,7 +22,9 @@ class App extends Component {
return (
<div className="App">
<Navbar title="Github Finder" icon='fab fa-github'/>
<div className="container">
<Search />
<Users loading={this.state.loading} users={this.state.users}/>
</div>

View File

@ -0,0 +1,33 @@
import React, {Component} from 'react';
// import PropTypes from 'prop-types';
class Search extends Component {
state = {
text:'martind2000'
};
onChange = e => {
this.setState({[e.target.name]: e.target.value});
};
onSubmit = e => {
e.preventDefault();
console.log(this.state.text);
};
render() {
return (
<div>
<form className='form' onSubmit={this.onSubmit}>
<input type='text' name='text' placeholder='Search users...' value={this.state.text} onChange={this.onChange.bind(this)}/>
<input type='submit' value='Search' className='btn btn-dark btn-block' />
</form>
</div>
);
}
}
// Search.propTypes = {};
export default Search;