Skip to content

Commit

Permalink
Merge pull request #56 from Yamilini-GA/add_clear_button
Browse files Browse the repository at this point in the history
Add Clear button
  • Loading branch information
surajondev authored Oct 17, 2023
2 parents 9fb60c0 + 30e9a00 commit d775863
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class App extends React.Component {
e.preventDefault();
this.componentWillMount();
}

clearInput() {
this.setState({
city_name: "",
Expand Down Expand Up @@ -197,11 +198,13 @@ class App extends React.Component {
onChange={this.city}
placeholder="Enter desired location"
></input>
<button className="submit-button" onClick={this.submit}>
<button className="button" onClick={this.submit}>
<p className="p-submit">SUBMIT</p>
</button>
<button className="clear-button" onClick={this.clearInput}>
Clear

<button className="button" onClick={this.clear}>
<p className="p-submit">CLEAR</p>

</button>
</form>
<Appcontainer
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ p {
margin-left: 0.8rem;
}

.submit-button {
.button {
margin-top: 1rem;
margin-left: 1rem;
font-family: Arial, sans-serif;
Expand Down

0 comments on commit d775863

Please sign in to comment.