Skip to content

Commit 899e618

Browse files
tmobairdjustin808
authored andcommitted
Updating JS node modules that are directly related to react (react, redux, react-router, etc.) (shakacode#414)
1 parent 8c5b494 commit 899e618

File tree

18 files changed

+235
-118
lines changed

18 files changed

+235
-118
lines changed

client/app/bundles/comments/components/CommentBox/CommentBox.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import Immutable from 'immutable';
34
import ActionCable from 'actioncable';
45
import _ 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
};

client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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';
56
import ReactDOM from 'react-dom';
67
import Col from 'react-bootstrap/lib/Col';
78
import FormControl from 'react-bootstrap/lib/FormControl';

client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BaseComponent from 'libs/components/BaseComponent';
2-
import React, { PropTypes } from 'react';
2+
import React from 'react';
3+
import PropTypes from 'prop-types';
34

45
import marked from 'marked';
56
import css from './Comment.scss';

client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Alert from 'react-bootstrap/lib/Alert';
22
import BaseComponent from 'libs/components/BaseComponent';
33
import Immutable from 'immutable';
4-
import React, { PropTypes } from 'react';
4+
import React from 'react';
5+
import PropTypes from 'prop-types';
56
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
67
import _ from 'lodash';
78

client/app/bundles/comments/components/CommentScreen/CommentScreen.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
import BaseComponent from 'libs/components/BaseComponent';
45

client/app/bundles/comments/components/NavigationBar/CommentsCount.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
const href = 'https://github.com/shakacode/react_on_rails/blob/master/README.md#multiple-react-' +
45
'components-on-a-page-with-one-store';

client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
import classNames from 'classnames';
55
import _ from 'lodash';
6-
import React, { PropTypes } from 'react';
6+
import React from 'react';
7+
import PropTypes from 'prop-types';
78

89
import CommentsCount from './CommentsCount';
910
import * as paths from '../../constants/paths';
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
import React from 'react';
2+
import { Redirect } from 'react-router-dom';
23

34
import BaseComponent from 'libs/components/BaseComponent';
45

56
export 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
}

client/app/bundles/comments/containers/NavigationBarContainer.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34

45
import BaseComponent from 'libs/components/BaseComponent';

client/app/bundles/comments/containers/NonRouterCommentsContainer.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import { bindActionCreators } from 'redux';
45
import BaseComponent from 'libs/components/BaseComponent';

0 commit comments

Comments
 (0)