Skip to content

Commit

Permalink
First pass at proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino authored and Luke Edwards committed Sep 18, 2018
1 parent 71ff1a7 commit e71f12a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
7 changes: 4 additions & 3 deletions client/src/components/GridField/GridFieldTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

class GridFieldTable extends Component {
/**
Expand Down Expand Up @@ -54,9 +55,9 @@ class GridFieldTable extends Component {
}

GridFieldTable.propTypes = {
data: React.PropTypes.object,
header: React.PropTypes.object,
rows: React.PropTypes.array,
data: PropTypes.object,
header: PropTypes.object,
rows: PropTypes.array,
};

export default GridFieldTable;
3 changes: 2 additions & 1 deletion client/src/components/GridFieldActions/GridFieldActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import GridFieldDropdownAction from './GridFieldDropdownAction';
import ActionMenu from '../ActionMenu/ActionMenu';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import PropTypes from 'prop-types';

class GridFieldActions extends PureComponent {
constructor(props) {
Expand Down Expand Up @@ -96,7 +97,7 @@ const actionShape = GridFieldDropdownAction.propTypes;
actionShape.group = PropTypes.string;

GridFieldActions.propTypes = PropTypes.arrayOf(
React.PropTypes.shape(actionShape)
PropTypes.shape(actionShape)
).isRequired;

export default GridFieldActions;
9 changes: 5 additions & 4 deletions client/src/components/TimeField/TimeField.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Component as DateField } from '../DateField/DateField';
import moment from 'moment';
import modernizr from 'modernizr';
import i18n from 'i18n';
import PropTypes from 'prop-types';

const localFormat = 'LT';

Expand Down Expand Up @@ -53,10 +54,10 @@ class TimeField extends DateField {
}

TimeField.propTypes = {
lang: React.PropTypes.string,
modernizr: React.PropTypes.object,
data: React.PropTypes.shape({
html5: React.PropTypes.boolean,
lang: PropTypes.string,
modernizr: PropTypes.object,
data: PropTypes.shape({
html5: PropTypes.boolean,
}),
};

Expand Down
3 changes: 2 additions & 1 deletion client/src/containers/Form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { reduxForm } from 'redux-form';
import { inject } from 'lib/Injector';
import getFormState from 'lib/getFormState';
import PropTypes from 'prop-types';

const InjectableForm = (props) => {
const FormComponent = props.formComponent;
Expand All @@ -14,7 +15,7 @@ const InjectableForm = (props) => {
};

InjectableForm.propTypes = {
formComponent: React.PropTypes.func.isRequired,
formComponent: PropTypes.func.isRequired,
};

const InjectedForm = inject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import { createStore } from 'redux';
import PropTypes from 'prop-types';

const mockStore = createStore(state => state);

Expand Down Expand Up @@ -34,8 +35,8 @@ jest.mock('../provideInjector', () => function mockInjector(Injected) {
}

MockedInjector.childContextTypes = {
injector: React.PropTypes.shape({
get: React.PropTypes.func,
injector: PropTypes.shape({
get: PropTypes.func,
}),
};

Expand Down

0 comments on commit e71f12a

Please sign in to comment.