Skip to content

Commit 36ef7c9

Browse files
add limitation of animations
1 parent 91e231e commit 36ef7c9

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,17 @@
1212
"build": "react-scripts build",
1313
"test": "react-scripts test --env=jsdom",
1414
"eject": "react-scripts eject"
15+
},
16+
"browserslist": {
17+
"production": [
18+
">0.2%",
19+
"not dead",
20+
"not op_mini all"
21+
],
22+
"development": [
23+
"last 1 chrome version",
24+
"last 1 firefox version",
25+
"last 1 safari version"
26+
]
1527
}
1628
}

src/App.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ class App extends Component {
2323
return (
2424
<div className="App">
2525
<h1>React Animations</h1>
26-
<Modal
27-
show={this.state.modalIsOpen}
28-
closed={this.closeModal}
29-
/>
30-
<Backdrop show={this.state.modalIsOpen} />
26+
{this.state.modalIsOpen ? <Modal show={this.state.modalIsOpen} closed={this.closeModal}/> : null }
27+
{this.state.modalIsOpen ? <Backdrop show={this.state.modalIsOpen} /> : null }
3128
<button className="Button" onClick={this.showModal}>Open Modal</button>
3229
<h3>Animating Lists</h3>
3330
<List />

src/components/Modal/Modal.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
}
1515

1616
.ModalOpen {
17-
visibility: visible;
17+
/* visibility: visible; */
1818
animation: openModal 0.4s ease-out forwards ;
1919
}
2020

2121
.ModalClosed {
22-
visibility: hidden;
22+
/* visibility: hidden; */
2323
animation: closeModal 0.4s ease-out forwards ;
2424
}
2525

0 commit comments

Comments
 (0)