Skip to content

Commit

Permalink
access PropTypes via prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
erlswtshrt committed Feb 5, 2018
1 parent f197b4a commit 1723ac1
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 24 deletions.
3 changes: 2 additions & 1 deletion ui/components/breadcrumbs/index.react.jsx
Expand Up @@ -3,14 +3,15 @@

import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';

const Crumb = props => (
<li className={classNames('slds-breadcrumb__item', props.className)}>
{props.hasMenu ? props.children : <a href={props.href}>{props.children}</a>}
</li>
);

Crumb.propTypes = { href: React.PropTypes.string };
Crumb.propTypes = { href: PropTypes.string };

const BreadCrumbs = props => (
<nav {...props} role="navigation" aria-label="Breadcrumbs">
Expand Down
5 changes: 3 additions & 2 deletions ui/components/dynamic-icons/ellie/example.jsx
Expand Up @@ -4,6 +4,7 @@
import React from 'react';
import _ from '../../../shared/helpers';
import classNames from 'classnames';
import PropTypes from 'prop-types';

// This icon is a sprite of 20 frames laid out horizontally
// Each frame is composed of 2 circles positioned on top of each other
Expand Down Expand Up @@ -36,8 +37,8 @@ export const Ellie = props => (
);

Ellie.propTypes = {
title: React.PropTypes.string.isRequired,
assistiveText: React.PropTypes.string.isRequired
title: PropTypes.string.isRequired,
assistiveText: PropTypes.string.isRequired
};

/* -----------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions ui/components/dynamic-icons/trend/example.jsx
Expand Up @@ -4,6 +4,7 @@
import React from 'react';
import _ from '../../../shared/helpers';
import classNames from 'classnames';
import PropTypes from 'prop-types';

/* -----------------------------------------------------------------------------
Private
Expand Down Expand Up @@ -33,8 +34,8 @@ let Trend = props => {
};

Trend.propTypes = {
title: React.PropTypes.string.isRequired,
assistiveText: React.PropTypes.string.isRequired
title: PropTypes.string.isRequired,
assistiveText: PropTypes.string.isRequired
};

/* -----------------------------------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions ui/components/dynamic-icons/typing/example.jsx
Expand Up @@ -3,6 +3,7 @@

import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';

export const TypingIcon = props => (
<span
Expand All @@ -22,10 +23,10 @@ export const TypingIcon = props => (
);

TypingIcon.propTypes = {
isAnimated: React.PropTypes.bool,
isPaused: React.PropTypes.bool,
title: React.PropTypes.string.isRequired,
assistiveText: React.PropTypes.string
isAnimated: PropTypes.bool,
isPaused: PropTypes.bool,
title: PropTypes.string.isRequired,
assistiveText: PropTypes.string
};

export default (
Expand Down
5 changes: 3 additions & 2 deletions ui/components/heading/index.react.jsx
Expand Up @@ -4,6 +4,7 @@
import _ from '../../shared/helpers';
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';

import Truncate from '../../shared/truncate/index.react.jsx';

Expand Down Expand Up @@ -41,8 +42,8 @@ class Heading extends React.Component {
}

Heading.propTypes = {
flavor: React.PropTypes.oneOf(['label', 'medium']),
truncate: React.PropTypes.number
flavor: PropTypes.oneOf(['label', 'medium']),
truncate: PropTypes.number
};

Heading.defaultProps = { flavor: 'label' };
Expand Down
3 changes: 2 additions & 1 deletion ui/components/progress-ring/index.jsx
Expand Up @@ -3,6 +3,7 @@

import React, { Component } from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';

class ProgressRing extends Component {
getCoordinatesForPercent(percent) {
Expand Down Expand Up @@ -48,7 +49,7 @@ class ProgressRing extends Component {
}

ProgressRing.propTypes = {
percent: React.PropTypes.number
percent: PropTypes.number
};

ProgressRing.defaultProps = {
Expand Down
3 changes: 2 additions & 1 deletion ui/components/tabs/index.react.jsx
Expand Up @@ -4,8 +4,9 @@
import _ from '../../shared/helpers';
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';

const PT = React.PropTypes;
const PT = PropTypes;

class TabContent extends React.Component {
render() {
Expand Down
7 changes: 4 additions & 3 deletions ui/shared/svg-icon/index.jsx
Expand Up @@ -10,6 +10,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
*/

import React from 'react';
import PropTypes from 'prop-types';

class SvgIcon extends React.Component {
render() {
Expand All @@ -33,9 +34,9 @@ class SvgIcon extends React.Component {
}

SvgIcon.propTypes = {
className: React.PropTypes.string,
sprite: React.PropTypes.string,
symbol: React.PropTypes.string
className: PropTypes.string,
sprite: PropTypes.string,
symbol: PropTypes.string
};

export default SvgIcon;
3 changes: 2 additions & 1 deletion ui/shared/truncate/index.react.jsx
Expand Up @@ -3,6 +3,7 @@

import _ from '../helpers';
import React from 'react';
import PropTypes from 'prop-types';

class Truncate extends React.Component {
// TODO: Remove span
Expand All @@ -16,6 +17,6 @@ class Truncate extends React.Component {
}
}

Truncate.propTypes = { truncate: React.PropTypes.number };
Truncate.propTypes = { truncate: PropTypes.number };

export default Truncate;
15 changes: 8 additions & 7 deletions ui/utilities/media-objects/index.react.jsx
Expand Up @@ -3,6 +3,7 @@

import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';

class Component extends React.Component {
render() {
Expand Down Expand Up @@ -42,13 +43,13 @@ class Component extends React.Component {

Component.displayName = 'MediaObject';
Component.PropTypes = {
figureLeft: React.PropTypes.node,
figureLeftClassName: React.PropTypes.string,
figureRight: React.PropTypes.node,
figureRightClassName: React.PropTypes.string,
figureCenter: React.PropTypes.node,
figureCenterClassName: React.PropTypes.string,
flavor: React.PropTypes.oneOf(['center', 'small', 'stacked'])
figureLeft: PropTypes.node,
figureLeftClassName: PropTypes.string,
figureRight: PropTypes.node,
figureRightClassName: PropTypes.string,
figureCenter: PropTypes.node,
figureCenterClassName: PropTypes.string,
flavor: PropTypes.oneOf(['center', 'small', 'stacked'])
};

export default Component;

0 comments on commit 1723ac1

Please sign in to comment.