Skip to content

Commit

Permalink
Add Clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamilini-GA committed Oct 15, 2023
1 parent a3f27c7 commit e3e05e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class App extends React.Component {
e.preventDefault();
this.componentWillMount();
}

clear(e) {
e.preventDefault();
window.location.reload(false);
}

componentWillMount() {
document.body.style.filter = "blur(0px)";
Expand Down Expand Up @@ -114,9 +119,12 @@ 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="button" onClick={this.clear}>
<p className="p-submit">CLEAR</p>
</button>
</form>
<Appcontainer
temp={this.state.temp}
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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 e3e05e2

Please sign in to comment.