Skip to content

Commit 24d7c40

Browse files
committed
removing react-transitions-group
1 parent 9b36d46 commit 24d7c40

File tree

5 files changed

+23
-68
lines changed

5 files changed

+23
-68
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"react-router-dom": "^4.2.2",
3939
"react-scripts": "1.0.17",
4040
"react-select": "^1.1.0",
41-
"react-transition-group": "1.x",
4241
"sass-loader": "^6.0.6",
4342
"shelljs": "^0.7.8",
4443
"webpack": "^3.10.0",

src/components/App.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ it('renders without crashing', () => {
99
router_mode: 'history',
1010
mode: 'grid',
1111
}
12-
ReactDOM.render(<Router><App config={config}/></Router>, div)
12+
ReactDOM.render(<Router><App config={config} url_generator={u => u}/></Router>, div)
1313
})

src/components/shared/Modal.js

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React, { Component } from 'react'
2-
import { CSSTransitionGroup } from 'react-transition-group'
32
import { Cross, Footer } from './Tools'
43

54
class Modal extends Component {
65
constructor (props) {
76
super(props)
87
this.state = {
9-
show: true,
8+
show: false,
109
}
1110
this.scroll_disabled = false
1211
this.close = this.close.bind(this)
@@ -26,6 +25,7 @@ class Modal extends Component {
2625
window.onwheel = this.prevent_scroll
2726
window.onmousewheel = document.onmousewheel = this.prevent_scroll
2827
window.ontouchmove = this.prevent_scroll
28+
setTimeout(() => this.setState({show: true}), 0)
2929
}
3030

3131
componentWillUnmount () {
@@ -42,29 +42,22 @@ class Modal extends Component {
4242

4343
render () {
4444
return (
45-
<CSSTransitionGroup
46-
transitionName="tcs-modal-trans"
47-
transitionAppear={true}
48-
transitionAppearTimeout={200}
49-
transitionEnter={false}
50-
transitionLeaveTimeout={200}>
51-
{this.state.show && (
52-
<div className="tcs-modal-mask" onClick={this.close}>
53-
<div className="tcs-modal" onClick={e => e.stopPropagation()}>
54-
<div className="tcs-header">
55-
<h2>{this.props.title}</h2>
56-
<div className="close" onClick={this.close}>
57-
<Cross/>
58-
</div>
45+
<div className={'tcs-modal-trans' + (this.state.show ? ' show' : '')}>
46+
<div className="tcs-modal-mask" onClick={this.close}>
47+
<div className="tcs-modal" onClick={e => e.stopPropagation()}>
48+
<div className="tcs-header">
49+
<h2>{this.props.title}</h2>
50+
<div className="close" onClick={this.close}>
51+
<Cross/>
5952
</div>
53+
</div>
6054

61-
{this.props.children}
55+
{this.props.children}
6256

63-
<Footer/>
64-
</div>
57+
<Footer/>
6558
</div>
66-
)}
67-
</CSSTransitionGroup>
59+
</div>
60+
</div>
6861
)
6962
}
7063
}

src/styles/modal.scss

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,17 @@
4141
}
4242
}
4343

44-
// auto applied:
45-
.tcs-modal-trans-appear {
44+
.tcs-modal-trans {
4645
opacity: 0;
47-
.tcs-modal {
48-
transform: translate(0, 40px);
49-
}
50-
}
51-
52-
.tcs-modal-trans-appear.tcs-modal-trans-appear-active {
53-
opacity: 1;
54-
transition: all .3s ease;
55-
.tcs-modal {
56-
transition: all .3s ease;
57-
transform: translate(0, 0);
58-
}
59-
}
60-
61-
.tcs-modal-trans-leave {
62-
opacity: 1;
6346
transition: all .3s ease;
6447
.tcs-modal {
6548
transition: all .3s ease;
66-
transform: translate(0, 0);
67-
}
68-
}
69-
70-
.tcs-modal-trans-leave.tcs-modal-trans-leave-active {
71-
opacity: 0;
72-
.tcs-modal {
7349
transform: translate(0, 40px);
7450
}
51+
&.show {
52+
opacity: 1;
53+
.tcs-modal {
54+
transform: translate(0, 0);
55+
}
56+
}
7557
}
76-

yarn.lock

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,10 +1277,6 @@ center-align@^0.1.1:
12771277
align-text "^0.1.3"
12781278
lazy-cache "^1.0.3"
12791279

1280-
chain-function@^1.0.0:
1281-
version "1.0.0"
1282-
resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"
1283-
12841280
[email protected], chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
12851281
version "1.1.3"
12861282
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
@@ -1934,10 +1930,6 @@ dom-converter@~0.1:
19341930
dependencies:
19351931
utila "~0.3"
19361932

1937-
dom-helpers@^3.2.0:
1938-
version "3.2.1"
1939-
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.2.1.tgz#3203e07fed217bd1f424b019735582fc37b2825a"
1940-
19411933
dom-serializer@0:
19421934
version "0.1.0"
19431935
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
@@ -5216,7 +5208,7 @@ promise@^7.1.1:
52165208
dependencies:
52175209
asap "~2.0.3"
52185210

5219-
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0:
5211+
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0:
52205212
version "15.6.0"
52215213
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
52225214
dependencies:
@@ -5471,16 +5463,6 @@ react-select@^1.1.0:
54715463
prop-types "^15.5.8"
54725464
react-input-autosize "^2.1.0"
54735465

5474-
5475-
version "1.2.1"
5476-
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-1.2.1.tgz#e11f72b257f921b213229a774df46612346c7ca6"
5477-
dependencies:
5478-
chain-function "^1.0.0"
5479-
dom-helpers "^3.2.0"
5480-
loose-envify "^1.3.1"
5481-
prop-types "^15.5.6"
5482-
warning "^3.0.0"
5483-
54845466
react@^16.2.0:
54855467
version "16.2.0"
54865468
resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba"

0 commit comments

Comments
 (0)