File tree Expand file tree Collapse file tree 18 files changed +235
-118
lines changed Expand file tree Collapse file tree 18 files changed +235
-118
lines changed Original file line number Diff line number Diff line change 1
- import React , { PropTypes } from 'react' ;
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
import Immutable from 'immutable' ;
3
4
import ActionCable from 'actioncable' ;
4
5
import _ from 'lodash' ;
@@ -15,13 +16,13 @@ class CommentBox extends BaseComponent {
15
16
static propTypes = {
16
17
pollInterval : PropTypes . number . isRequired ,
17
18
actions : PropTypes . shape ( {
18
- fetchComments : React . PropTypes . function ,
19
+ fetchComments : PropTypes . function ,
19
20
} ) ,
20
21
data : PropTypes . shape ( {
21
- isFetching : React . PropTypes . boolean ,
22
- isSaving : React . PropTypes . boolean ,
23
- submitCommentError : React . PropTypes . string ,
24
- $$comments : React . PropTypes . arrayOf ( CommentPropTypes ) ,
22
+ isFetching : PropTypes . boolean ,
23
+ isSaving : PropTypes . boolean ,
24
+ submitCommentError : PropTypes . string ,
25
+ $$comments : PropTypes . arrayOf ( CommentPropTypes ) ,
25
26
} ) . isRequired ,
26
27
intl : intlShape . isRequired ,
27
28
} ;
Original file line number Diff line number Diff line change 1
1
// NOTE: https://github.com/react-bootstrap/react-bootstrap/issues/1850 seesm to require string
2
2
// refs and not the callback kind.
3
3
/* eslint-disable react/no-find-dom-node, react/no-string-refs */
4
- import React , { PropTypes } from 'react' ;
4
+ import React from 'react' ;
5
+ import PropTypes from 'prop-types' ;
5
6
import ReactDOM from 'react-dom' ;
6
7
import Col from 'react-bootstrap/lib/Col' ;
7
8
import FormControl from 'react-bootstrap/lib/FormControl' ;
Original file line number Diff line number Diff line change 1
1
import BaseComponent from 'libs/components/BaseComponent' ;
2
- import React , { PropTypes } from 'react' ;
2
+ import React from 'react' ;
3
+ import PropTypes from 'prop-types' ;
3
4
4
5
import marked from 'marked' ;
5
6
import css from './Comment.scss' ;
Original file line number Diff line number Diff line change 1
1
import Alert from 'react-bootstrap/lib/Alert' ;
2
2
import BaseComponent from 'libs/components/BaseComponent' ;
3
3
import Immutable from 'immutable' ;
4
- import React , { PropTypes } from 'react' ;
4
+ import React from 'react' ;
5
+ import PropTypes from 'prop-types' ;
5
6
import ReactCSSTransitionGroup from 'react-addons-css-transition-group' ;
6
7
import _ from 'lodash' ;
7
8
Original file line number Diff line number Diff line change 1
- import React , { PropTypes } from 'react' ;
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
3
4
import BaseComponent from 'libs/components/BaseComponent' ;
4
5
Original file line number Diff line number Diff line change 1
- import React , { PropTypes } from 'react' ;
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
3
4
const href = 'https://github.com/shakacode/react_on_rails/blob/master/README.md#multiple-react-' +
4
5
'components-on-a-page-with-one-store' ;
Original file line number Diff line number Diff line change 3
3
4
4
import classNames from 'classnames' ;
5
5
import _ from 'lodash' ;
6
- import React , { PropTypes } from 'react' ;
6
+ import React from 'react' ;
7
+ import PropTypes from 'prop-types' ;
7
8
8
9
import CommentsCount from './CommentsCount' ;
9
10
import * as paths from '../../constants/paths' ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
+ import { Redirect } from 'react-router-dom' ;
2
3
3
4
import BaseComponent from 'libs/components/BaseComponent' ;
4
5
5
6
export default class TestReactRouterRedirect extends BaseComponent {
6
- static checkAuth ( nextState , replace ) {
7
+
8
+ static checkAuth ( ) {
7
9
// Hard code this to demonstrate the effect
8
10
const notAuthorized = true ;
9
- if ( notAuthorized ) {
10
- replace ( { pathname : '/' , state : { redirectFrom : nextState . location . pathname } } ) ;
11
- }
11
+ return notAuthorized ;
12
12
}
13
13
14
14
render ( ) {
15
- return (
16
- < div > Nope.</ div >
17
- ) ;
18
- }
15
+ if ( TestReactRouterRedirect . checkAuth ( ) ) {
16
+ return (
17
+ < Redirect
18
+ push
19
+ to = { {
20
+ pathname : '/' ,
21
+ state : { redirectFrom : this . props . location . pathname } ,
22
+ } }
23
+ />
24
+ ) ;
25
+ }
19
26
27
+ return < div > Nope.</ div > ;
28
+ }
20
29
}
Original file line number Diff line number Diff line change 1
- import React , { PropTypes } from 'react' ;
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
import { connect } from 'react-redux' ;
3
4
4
5
import BaseComponent from 'libs/components/BaseComponent' ;
Original file line number Diff line number Diff line change 1
- import React , { PropTypes } from 'react' ;
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
import { connect } from 'react-redux' ;
3
4
import { bindActionCreators } from 'redux' ;
4
5
import BaseComponent from 'libs/components/BaseComponent' ;
You can’t perform that action at this time.
0 commit comments