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' ;
23import Immutable from 'immutable' ;
34import ActionCable from 'actioncable' ;
45import _ from 'lodash' ;
@@ -15,13 +16,13 @@ class CommentBox extends BaseComponent {
1516 static propTypes = {
1617 pollInterval : PropTypes . number . isRequired ,
1718 actions : PropTypes . shape ( {
18- fetchComments : React . PropTypes . function ,
19+ fetchComments : PropTypes . function ,
1920 } ) ,
2021 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 ) ,
2526 } ) . isRequired ,
2627 intl : intlShape . isRequired ,
2728 } ;
Original file line number Diff line number Diff line change 11// NOTE: https://github.com/react-bootstrap/react-bootstrap/issues/1850 seesm to require string
22// refs and not the callback kind.
33/* 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' ;
56import ReactDOM from 'react-dom' ;
67import Col from 'react-bootstrap/lib/Col' ;
78import FormControl from 'react-bootstrap/lib/FormControl' ;
Original file line number Diff line number Diff line change 11import BaseComponent from 'libs/components/BaseComponent' ;
2- import React , { PropTypes } from 'react' ;
2+ import React from 'react' ;
3+ import PropTypes from 'prop-types' ;
34
45import marked from 'marked' ;
56import css from './Comment.scss' ;
Original file line number Diff line number Diff line change 11import Alert from 'react-bootstrap/lib/Alert' ;
22import BaseComponent from 'libs/components/BaseComponent' ;
33import Immutable from 'immutable' ;
4- import React , { PropTypes } from 'react' ;
4+ import React from 'react' ;
5+ import PropTypes from 'prop-types' ;
56import ReactCSSTransitionGroup from 'react-addons-css-transition-group' ;
67import _ from 'lodash' ;
78
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' ;
23
34import BaseComponent from 'libs/components/BaseComponent' ;
45
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' ;
23
34const href = 'https://github.com/shakacode/react_on_rails/blob/master/README.md#multiple-react-' +
45 'components-on-a-page-with-one-store' ;
Original file line number Diff line number Diff line change 33
44import classNames from 'classnames' ;
55import _ from 'lodash' ;
6- import React , { PropTypes } from 'react' ;
6+ import React from 'react' ;
7+ import PropTypes from 'prop-types' ;
78
89import CommentsCount from './CommentsCount' ;
910import * as paths from '../../constants/paths' ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import { Redirect } from 'react-router-dom' ;
23
34import BaseComponent from 'libs/components/BaseComponent' ;
45
56export default class TestReactRouterRedirect extends BaseComponent {
6- static checkAuth ( nextState , replace ) {
7+
8+ static checkAuth ( ) {
79 // Hard code this to demonstrate the effect
810 const notAuthorized = true ;
9- if ( notAuthorized ) {
10- replace ( { pathname : '/' , state : { redirectFrom : nextState . location . pathname } } ) ;
11- }
11+ return notAuthorized ;
1212 }
1313
1414 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+ }
1926
27+ return < div > Nope.</ div > ;
28+ }
2029}
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' ;
23import { connect } from 'react-redux' ;
34
45import 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' ;
23import { connect } from 'react-redux' ;
34import { bindActionCreators } from 'redux' ;
45import BaseComponent from 'libs/components/BaseComponent' ;
You can’t perform that action at this time.
0 commit comments