diff --git a/package.json b/package.json index 5c0a2c219..0d98bffe3 100644 --- a/package.json +++ b/package.json @@ -101,9 +101,10 @@ "immutable": "^3.7.3", "jsonp": "^0.2.0", "password-sheriff": "^1.1.0", - "react": "^15.0.0 || ^16.0.0", - "react-addons-css-transition-group": "^15.0.0 || ^16.0.0", - "react-dom": "^15.0.0 || ^16.0.0", + "prop-types": "^15.5.7 || ^16.0.0", + "react": "^15.3.0 || ^16.0.0", + "react-addons-css-transition-group": "^15.3.0 || ^16.0.0", + "react-dom": "^15.3.0 || ^16.0.0", "superagent": "^3.3.1", "trim": "0.0.1", "url-join": "^1.1.0" diff --git a/src/connection/database/login_pane.jsx b/src/connection/database/login_pane.jsx index 2ac4aa319..63a8f5296 100644 --- a/src/connection/database/login_pane.jsx +++ b/src/connection/database/login_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import EmailPane from '../../field/email/email_pane'; import UsernamePane from '../../field/username/username_pane'; @@ -72,14 +73,14 @@ export default class LoginPane extends React.Component { } LoginPane.propTypes = { - emailInputPlaceholder: React.PropTypes.string.isRequired, - forgotPasswordAction: React.PropTypes.string.isRequired, - i18n: React.PropTypes.object.isRequired, - instructions: React.PropTypes.any, - lock: React.PropTypes.object.isRequired, - passwordInputPlaceholder: React.PropTypes.string.isRequired, - showForgotPasswordLink: React.PropTypes.bool.isRequired, - showPassword: React.PropTypes.bool.isRequired, - usernameInputPlaceholder: React.PropTypes.string.isRequired, - usernameStyle: React.PropTypes.oneOf(["any", "email", "username"]) + emailInputPlaceholder: PropTypes.string.isRequired, + forgotPasswordAction: PropTypes.string.isRequired, + i18n: PropTypes.object.isRequired, + instructions: PropTypes.any, + lock: PropTypes.object.isRequired, + passwordInputPlaceholder: PropTypes.string.isRequired, + showForgotPasswordLink: PropTypes.bool.isRequired, + showPassword: PropTypes.bool.isRequired, + usernameInputPlaceholder: PropTypes.string.isRequired, + usernameStyle: PropTypes.oneOf(["any", "email", "username"]) }; diff --git a/src/connection/database/login_sign_up_tabs.jsx b/src/connection/database/login_sign_up_tabs.jsx index ec9245437..a166cb4d6 100644 --- a/src/connection/database/login_sign_up_tabs.jsx +++ b/src/connection/database/login_sign_up_tabs.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import { showLoginActivity, showSignUpActivity } from './actions'; import * as l from '../../core/index'; @@ -53,10 +54,10 @@ export default class LoginSignUpTabs extends React.Component { } LoginSignUpTabs.propTypes = { - lock: React.PropTypes.object.isRequired, - loginLabel: React.PropTypes.string.isRequired, - signUpLabel: React.PropTypes.string.isRequired, - signUpLink: React.PropTypes.string + lock: PropTypes.object.isRequired, + loginLabel: PropTypes.string.isRequired, + signUpLabel: PropTypes.string.isRequired, + signUpLink: PropTypes.string }; class LoginSignUpTab extends React.Component { diff --git a/src/connection/database/mfa_pane.jsx b/src/connection/database/mfa_pane.jsx index 808010954..09478ed65 100644 --- a/src/connection/database/mfa_pane.jsx +++ b/src/connection/database/mfa_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import MFACodePane from '../../field/mfa-code/mfa_code_pane'; @@ -29,9 +30,9 @@ export default class MFAPane extends React.Component { } MFAPane.propTypes = { - mfaInputPlaceholder: React.PropTypes.string.isRequired, - title: React.PropTypes.string.isRequired, - i18n: React.PropTypes.object.isRequired, - instructions: React.PropTypes.any, - lock: React.PropTypes.object.isRequired + mfaInputPlaceholder: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + i18n: PropTypes.object.isRequired, + instructions: PropTypes.any, + lock: PropTypes.object.isRequired }; diff --git a/src/connection/database/password_reset_confirmation.jsx b/src/connection/database/password_reset_confirmation.jsx index dbe5c08d1..a545a39df 100644 --- a/src/connection/database/password_reset_confirmation.jsx +++ b/src/connection/database/password_reset_confirmation.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import SuccessPane from '../../ui/box/success_pane'; import { closeLock } from '../../core/actions'; @@ -25,8 +26,8 @@ export default class PasswordResetConfirmation extends React.Component { } PasswordResetConfirmation.propTypes = { - closeHandler: React.PropTypes.func.isRequired, - lock: React.PropTypes.object.isRequired + closeHandler: PropTypes.func.isRequired, + lock: PropTypes.object.isRequired }; export function renderPasswordResetConfirmation(m, props = {}) { diff --git a/src/connection/database/reset_password_pane.jsx b/src/connection/database/reset_password_pane.jsx index fd136e697..44b516faa 100644 --- a/src/connection/database/reset_password_pane.jsx +++ b/src/connection/database/reset_password_pane.jsx @@ -1,11 +1,12 @@ +import PropTypes from 'prop-types'; import React from 'react'; import EmailPane from '../../field/email/email_pane'; import * as l from '../../core/index'; export default class ResetPasswordPane extends React.Component { static propTypes = { - emailInputPlaceholder: React.PropTypes.string.isRequired, - lock: React.PropTypes.object.isRequired + emailInputPlaceholder: PropTypes.string.isRequired, + lock: PropTypes.object.isRequired }; render() { diff --git a/src/connection/database/signed_up_confirmation.jsx b/src/connection/database/signed_up_confirmation.jsx index d5013be51..e3085ddd0 100644 --- a/src/connection/database/signed_up_confirmation.jsx +++ b/src/connection/database/signed_up_confirmation.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import SuccessPane from '../../ui/box/success_pane'; import { closeLock } from '../../core/actions'; @@ -26,8 +27,8 @@ export default class SignedUpConfirmation extends React.Component { } SignedUpConfirmation.propTypes = { - closeHandler: React.PropTypes.func.isRequired, - lock: React.PropTypes.object.isRequired + closeHandler: PropTypes.func.isRequired, + lock: PropTypes.object.isRequired }; export function renderSignedUpConfirmation(m, props = {}) { diff --git a/src/connection/enterprise/hrd_pane.jsx b/src/connection/enterprise/hrd_pane.jsx index 949f9ecce..840a6930b 100644 --- a/src/connection/enterprise/hrd_pane.jsx +++ b/src/connection/enterprise/hrd_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import UsernamePane from '../../field/username/username_pane'; import PasswordPane from '../../field/password/password_pane'; @@ -35,9 +36,9 @@ export default class HRDPane extends React.Component { } HRDPane.propTypes = { - header: React.PropTypes.element, - i18n: React.PropTypes.object.isRequired, - model: React.PropTypes.object.isRequired, - passwordInputPlaceholder: React.PropTypes.string.isRequired, - usernameInputPlaceholder: React.PropTypes.string.isRequired + header: PropTypes.element, + i18n: PropTypes.object.isRequired, + model: PropTypes.object.isRequired, + passwordInputPlaceholder: PropTypes.string.isRequired, + usernameInputPlaceholder: PropTypes.string.isRequired }; diff --git a/src/core/error_screen.jsx b/src/core/error_screen.jsx index 5f80634df..7cd194cac 100644 --- a/src/core/error_screen.jsx +++ b/src/core/error_screen.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import Screen from './screen'; import * as l from './index'; @@ -22,5 +23,5 @@ const ErrorPane = ({i18n}) => ( ErrorPane.propTypes = { - i18n: React.PropTypes.object.isRequired + i18n: PropTypes.object.isRequired }; diff --git a/src/core/loading_screen.jsx b/src/core/loading_screen.jsx index 8f13c6501..ab1c19588 100644 --- a/src/core/loading_screen.jsx +++ b/src/core/loading_screen.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import Screen from './screen'; import { pinLoadingPane, unpinLoadingPane } from './actions'; @@ -36,5 +37,5 @@ class LoadingPane extends React.Component { } LoadingPane.propTypes = { - model: React.PropTypes.object.isRequired + model: PropTypes.object.isRequired }; diff --git a/src/core/signed_in_confirmation.jsx b/src/core/signed_in_confirmation.jsx index eb76003e0..d04d0c00a 100644 --- a/src/core/signed_in_confirmation.jsx +++ b/src/core/signed_in_confirmation.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import SuccessPane from '../ui/box/success_pane'; import { closeLock } from './actions'; @@ -25,8 +26,8 @@ export default class SignedInConfirmation extends React.Component { } SignedInConfirmation.propTypes = { - closeHandler: React.PropTypes.func.isRequired, - lock: React.PropTypes.object.isRequired + closeHandler: PropTypes.func.isRequired, + lock: PropTypes.object.isRequired }; export function renderSignedInConfirmation(lock, props = {}) { diff --git a/src/field/email/email_pane.jsx b/src/field/email/email_pane.jsx index 9bfa494f7..a1a9b59d5 100644 --- a/src/field/email/email_pane.jsx +++ b/src/field/email/email_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import EmailInput from '../../ui/input/email_input'; import * as c from '../index'; @@ -48,7 +49,7 @@ export default class EmailPane extends React.Component { } EmailPane.propTypes = { - i18n: React.PropTypes.object.isRequired, - lock: React.PropTypes.object.isRequired, - placeholder: React.PropTypes.string.isRequired + i18n: PropTypes.object.isRequired, + lock: PropTypes.object.isRequired, + placeholder: PropTypes.string.isRequired }; diff --git a/src/field/mfa-code/mfa_code_pane.jsx b/src/field/mfa-code/mfa_code_pane.jsx index 4ea634fa2..8c8dc7f03 100644 --- a/src/field/mfa-code/mfa_code_pane.jsx +++ b/src/field/mfa-code/mfa_code_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import MFACodeInput from '../../ui/input/mfa_code_input'; import * as c from '../index'; @@ -29,7 +30,7 @@ export default class MFACodePane extends React.Component { } MFACodePane.propTypes = { - i18n: React.PropTypes.object.isRequired, - lock: React.PropTypes.object.isRequired, - placeholder: React.PropTypes.string.isRequired + i18n: PropTypes.object.isRequired, + lock: PropTypes.object.isRequired, + placeholder: PropTypes.string.isRequired }; diff --git a/src/field/password/password_pane.jsx b/src/field/password/password_pane.jsx index a5eb4e1cd..94e26da67 100644 --- a/src/field/password/password_pane.jsx +++ b/src/field/password/password_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import PasswordInput from '../../ui/input/password_input'; import * as c from '../index'; @@ -32,10 +33,10 @@ export default class PasswordPane extends React.Component { } PasswordPane.propTypes = { - i18n: React.PropTypes.object.isRequired, - lock: React.PropTypes.object.isRequired, - onChange: React.PropTypes.func, - placeholder: React.PropTypes.string.isRequired, - policy: React.PropTypes.string, - strengthMessages: React.PropTypes.object + i18n: PropTypes.object.isRequired, + lock: PropTypes.object.isRequired, + onChange: PropTypes.func, + placeholder: PropTypes.string.isRequired, + policy: PropTypes.string, + strengthMessages: PropTypes.object }; diff --git a/src/field/phone-number/phone_number_pane.jsx b/src/field/phone-number/phone_number_pane.jsx index cdbe5d57e..372ea4341 100644 --- a/src/field/phone-number/phone_number_pane.jsx +++ b/src/field/phone-number/phone_number_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import PhoneNumberInput from '../../ui/input/phone_number_input'; @@ -46,7 +47,7 @@ export default class PhoneNumberPane extends React.Component { } PhoneNumberPane.propTypes = { - instructions: React.PropTypes.element, - lock: React.PropTypes.object.isRequired, - placeholder: React.PropTypes.string.isRequired + instructions: PropTypes.element, + lock: PropTypes.object.isRequired, + placeholder: PropTypes.string.isRequired }; diff --git a/src/field/social/social_buttons_pane.jsx b/src/field/social/social_buttons_pane.jsx index eea428bd5..56e86e87a 100644 --- a/src/field/social/social_buttons_pane.jsx +++ b/src/field/social/social_buttons_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import AuthButton from '../../ui/button/auth_button'; import * as l from '../../core/index'; @@ -61,13 +62,13 @@ export default class SocialButtonsPane extends React.Component { } SocialButtonsPane.propTypes = { - bigButtons: React.PropTypes.bool.isRequired, - instructions: React.PropTypes.any, - labelFn: React.PropTypes.func.isRequired, - lock: React.PropTypes.object.isRequired, - showLoading: React.PropTypes.bool.isRequired, - signUp: React.PropTypes.bool.isRequired, - disabled: React.PropTypes.bool, + bigButtons: PropTypes.bool.isRequired, + instructions: PropTypes.any, + labelFn: PropTypes.func.isRequired, + lock: PropTypes.object.isRequired, + showLoading: PropTypes.bool.isRequired, + signUp: PropTypes.bool.isRequired, + disabled: PropTypes.bool, }; SocialButtonsPane.defaultProps = { diff --git a/src/field/username/username_pane.jsx b/src/field/username/username_pane.jsx index 4c053833c..9aa91e603 100644 --- a/src/field/username/username_pane.jsx +++ b/src/field/username/username_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import UsernameInput from '../../ui/input/username_input'; import * as c from '../index'; @@ -61,11 +62,11 @@ export default class UsernamePane extends React.Component { } UsernamePane.propTypes = { - i18n: React.PropTypes.object.isRequired, - lock: React.PropTypes.object.isRequired, - placeholder: React.PropTypes.string.isRequired, - validateFormat: React.PropTypes.bool.isRequired, - usernameStyle: React.PropTypes.oneOf(["any", "email", "username"]) + i18n: PropTypes.object.isRequired, + lock: PropTypes.object.isRequired, + placeholder: PropTypes.string.isRequired, + validateFormat: PropTypes.bool.isRequired, + usernameStyle: PropTypes.oneOf(["any", "email", "username"]) }; UsernamePane.defaultProps = { diff --git a/src/field/vcode/vcode_pane.jsx b/src/field/vcode/vcode_pane.jsx index 31561a7f4..5db6e0af6 100644 --- a/src/field/vcode/vcode_pane.jsx +++ b/src/field/vcode/vcode_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import VcodeInput from '../../ui/input/vcode_input'; import * as l from '../../core/index'; @@ -50,9 +51,9 @@ export default class VcodePane extends React.Component { } VcodePane.propTypes = { - instructions: React.PropTypes.element, - lock: React.PropTypes.object.isRequired, - placeholder: React.PropTypes.string.isRequired, - resendLabel: React.PropTypes.string.isRequired, - onRestart: React.PropTypes.func.isRequired + instructions: PropTypes.element, + lock: PropTypes.object.isRequired, + placeholder: PropTypes.string.isRequired, + resendLabel: PropTypes.string.isRequired, + onRestart: PropTypes.func.isRequired }; diff --git a/src/ui/box/button.jsx b/src/ui/box/button.jsx index 6e70fa598..96a39fc16 100644 --- a/src/ui/box/button.jsx +++ b/src/ui/box/button.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; const svgs = { @@ -15,9 +16,9 @@ const IconButton = ({name, onClick, svg}) => ( ); IconButton.propTypes = { - name: React.PropTypes.string.isRequired, - onClick: React.PropTypes.func.isRequired, - svg: React.PropTypes.string.isRequired + name: PropTypes.string.isRequired, + onClick: PropTypes.func.isRequired, + svg: PropTypes.string.isRequired }; // const createButton = name => { @@ -39,7 +40,7 @@ export const CloseButton = ({onClick}) => ( ); CloseButton.propTypes = { - onClick: React.PropTypes.func.isRequired + onClick: PropTypes.func.isRequired }; export const BackButton = ({onClick}) => ( @@ -47,5 +48,5 @@ export const BackButton = ({onClick}) => ( ); BackButton.propTypes = { - onClick: React.PropTypes.func.isRequired + onClick: PropTypes.func.isRequired }; diff --git a/src/ui/box/chrome.jsx b/src/ui/box/chrome.jsx index 626214678..0393bef30 100644 --- a/src/ui/box/chrome.jsx +++ b/src/ui/box/chrome.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; @@ -41,9 +42,9 @@ class SubmitButton extends React.Component { } SubmitButton.propTypes = { - color: React.PropTypes.string.isRequired, - disabled: React.PropTypes.bool, - label: React.PropTypes.string + color: PropTypes.string.isRequired, + disabled: PropTypes.bool, + label: PropTypes.string }; const MESSAGE_ANIMATION_DURATION = 250; @@ -296,23 +297,23 @@ export default class Chrome extends React.Component { } Chrome.propTypes = { - autofocus: React.PropTypes.bool.isRequired, - avatar: React.PropTypes.string, - auxiliaryPane: React.PropTypes.element, - backHandler: React.PropTypes.func, - contentComponent: React.PropTypes.func.isRequired, // TODO: it also can be a class component - contentProps: React.PropTypes.object.isRequired, - disableSubmitButton: React.PropTypes.bool.isRequired, - error: React.PropTypes.node, - isSubmitting: React.PropTypes.bool.isRequired, - logo: React.PropTypes.string.isRequired, - primaryColor: React.PropTypes.string.isRequired, - showSubmitButton: React.PropTypes.bool.isRequired, - submitButtonLabel: React.PropTypes.string, - success: React.PropTypes.node, - terms: React.PropTypes.element, - title: React.PropTypes.string, - transitionName: React.PropTypes.string.isRequired + autofocus: PropTypes.bool.isRequired, + avatar: PropTypes.string, + auxiliaryPane: PropTypes.element, + backHandler: PropTypes.func, + contentComponent: PropTypes.func.isRequired, // TODO: it also can be a class component + contentProps: PropTypes.object.isRequired, + disableSubmitButton: PropTypes.bool.isRequired, + error: PropTypes.node, + isSubmitting: PropTypes.bool.isRequired, + logo: PropTypes.string.isRequired, + primaryColor: PropTypes.string.isRequired, + showSubmitButton: PropTypes.bool.isRequired, + submitButtonLabel: PropTypes.string, + success: PropTypes.node, + terms: PropTypes.element, + title: PropTypes.string, + transitionName: PropTypes.string.isRequired }; Chrome.defaultProps = { diff --git a/src/ui/box/confirmation_pane.jsx b/src/ui/box/confirmation_pane.jsx index 3990cfbf1..010fb14b6 100644 --- a/src/ui/box/confirmation_pane.jsx +++ b/src/ui/box/confirmation_pane.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import { BackButton, CloseButton } from './button'; @@ -13,13 +14,13 @@ const ConfirmationPane = ({backHandler, children, closeHandler, svg}) => ( ); ConfirmationPane.propTypes = { - backHandler: React.PropTypes.func, - closeHandler: React.PropTypes.func, - children: React.PropTypes.oneOfType([ - React.PropTypes.element.isRequired, - React.PropTypes.arrayOf(React.PropTypes.element).isRequired + backHandler: PropTypes.func, + closeHandler: PropTypes.func, + children: PropTypes.oneOfType([ + PropTypes.element.isRequired, + PropTypes.arrayOf(PropTypes.element).isRequired ]), - svg: React.PropTypes.string.isRequired + svg: PropTypes.string.isRequired }; export default ConfirmationPane; diff --git a/src/ui/box/container.jsx b/src/ui/box/container.jsx index 3321948da..210923f43 100644 --- a/src/ui/box/container.jsx +++ b/src/ui/box/container.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import Chrome from './chrome'; import { CloseButton } from './button'; @@ -19,7 +20,7 @@ const Avatar = ({imageUrl}) => ( ); Avatar.propTypes = { - imageUrl: React.PropTypes.string.isRequired + imageUrl: PropTypes.string.isRequired } class EscKeyDownHandler { @@ -212,29 +213,29 @@ export default class Container extends React.Component { } Container.propTypes = { - autofocus: React.PropTypes.bool.isRequired, - avatar: React.PropTypes.string, - auxiliaryPane: React.PropTypes.element, - backHandler: React.PropTypes.func, - badgeLink: React.PropTypes.string.isRequired, - closeHandler: React.PropTypes.func, - contentComponent: React.PropTypes.func.isRequired, // TODO: it also can be a class component - contentProps: React.PropTypes.object.isRequired, - disableSubmitButton: React.PropTypes.bool.isRequired, - error: React.PropTypes.node, - isMobile: React.PropTypes.bool.isRequired, - isModal: React.PropTypes.bool.isRequired, - isSubmitting: React.PropTypes.bool.isRequired, - logo: React.PropTypes.string.isRequired, - primaryColor: React.PropTypes.string.isRequired, - screenName: React.PropTypes.string.isRequired, - showBadge: React.PropTypes.bool.isRequired, - submitButtonLabel: React.PropTypes.string, - success: React.PropTypes.node, - tabs: React.PropTypes.bool, - terms: React.PropTypes.element, - title: React.PropTypes.string, - transitionName: React.PropTypes.string.isRequired + autofocus: PropTypes.bool.isRequired, + avatar: PropTypes.string, + auxiliaryPane: PropTypes.element, + backHandler: PropTypes.func, + badgeLink: PropTypes.string.isRequired, + closeHandler: PropTypes.func, + contentComponent: PropTypes.func.isRequired, // TODO: it also can be a class component + contentProps: PropTypes.object.isRequired, + disableSubmitButton: PropTypes.bool.isRequired, + error: PropTypes.node, + isMobile: PropTypes.bool.isRequired, + isModal: PropTypes.bool.isRequired, + isSubmitting: PropTypes.bool.isRequired, + logo: PropTypes.string.isRequired, + primaryColor: PropTypes.string.isRequired, + screenName: PropTypes.string.isRequired, + showBadge: PropTypes.bool.isRequired, + submitButtonLabel: PropTypes.string, + success: PropTypes.node, + tabs: PropTypes.bool, + terms: PropTypes.element, + title: PropTypes.string, + transitionName: PropTypes.string.isRequired // escHandler // submitHandler, }; diff --git a/src/ui/box/global_message.jsx b/src/ui/box/global_message.jsx index 566092f55..7a2ebf93d 100644 --- a/src/ui/box/global_message.jsx +++ b/src/ui/box/global_message.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; @@ -16,6 +17,6 @@ export default class GlobalMessage extends React.Component { } GlobalMessage.propTypes = { - message: React.PropTypes.node.isRequired, - type: React.PropTypes.oneOf(['error', 'success']).isRequired + message: PropTypes.node.isRequired, + type: PropTypes.oneOf(['error', 'success']).isRequired } diff --git a/src/ui/box/header.jsx b/src/ui/box/header.jsx index 9fa1497e1..efd49a2d3 100644 --- a/src/ui/box/header.jsx +++ b/src/ui/box/header.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import { BackButton } from './button'; @@ -18,9 +19,9 @@ export default class Header extends React.Component { } Header.propTypes = { - backgroundUrl: React.PropTypes.string, - logoUrl: React.PropTypes.string, - name: React.PropTypes.string + backgroundUrl: PropTypes.string, + logoUrl: PropTypes.string, + name: PropTypes.string }; class Welcome extends React.Component { @@ -40,8 +41,8 @@ class Welcome extends React.Component { } Welcome.propTypes = { - imageUrl: React.PropTypes.string, - name: React.PropTypes.string + imageUrl: PropTypes.string, + name: PropTypes.string }; class WelcomeMessage extends React.Component { @@ -62,7 +63,7 @@ class WelcomeMessage extends React.Component { } WelcomeMessage.propTypes = { - name: React.PropTypes.string + name: PropTypes.string } const cssBlurSupport = (function() { @@ -111,7 +112,7 @@ class Background extends React.Component { } Background.propTypes = { - backgroundColor: React.PropTypes.string, - grayScale: React.PropTypes.bool, - imageUrl: React.PropTypes.string + backgorundColor: PropTypes.string, + grayScale: PropTypes.bool, + imageUrl: PropTypes.string } diff --git a/src/ui/box/multisize_slide.js b/src/ui/box/multisize_slide.js index 9ee90088c..0faae2a71 100644 --- a/src/ui/box/multisize_slide.js +++ b/src/ui/box/multisize_slide.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; import CSSCore from 'fbjs/lib/CSSCore'; @@ -90,13 +91,13 @@ export default class Slider extends React.Component { } Slider.propTypes = { - component: React.PropTypes.string, - delay: React.PropTypes.number.isRequired, - onDidAppear: React.PropTypes.func.isRequired, - onDidSlide: React.PropTypes.func.isRequired, - onWillSlide: React.PropTypes.func.isRequired, - reverse: React.PropTypes.bool.isRequired, - transitionName: React.PropTypes.string.isRequired + component: PropTypes.string, + delay: PropTypes.number.isRequired, + onDidAppear: PropTypes.func.isRequired, + onDidSlide: PropTypes.func.isRequired, + onWillSlide: PropTypes.func.isRequired, + reverse: PropTypes.bool.isRequired, + transitionName: PropTypes.string.isRequired }; Slider.defaultProps = { diff --git a/src/ui/button/auth_button.jsx b/src/ui/button/auth_button.jsx index 5b480cbfe..caed55345 100644 --- a/src/ui/button/auth_button.jsx +++ b/src/ui/button/auth_button.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; const AuthButton = (props) => { @@ -37,14 +38,14 @@ const AuthButton = (props) => { }; AuthButton.propTypes = { - disabled: React.PropTypes.bool.isRequired, - isBig: React.PropTypes.bool.isRequired, - label: React.PropTypes.string.isRequired, - onClick: React.PropTypes.func.isRequired, - strategy: React.PropTypes.string.isRequired, - icon: React.PropTypes.string, - primaryColor: React.PropTypes.string, - foregroundColor: React.PropTypes.string + disabled: PropTypes.bool.isRequired, + isBig: PropTypes.bool.isRequired, + label: PropTypes.string.isRequired, + onClick: PropTypes.func.isRequired, + strategy: PropTypes.string.isRequired, + icon: PropTypes.string, + primaryColor: PropTypes.string, + foregroundColor: PropTypes.string }; AuthButton.defaultProps = { diff --git a/src/ui/input/input_wrap.jsx b/src/ui/input/input_wrap.jsx index 8692e0ecf..67a45edce 100644 --- a/src/ui/input/input_wrap.jsx +++ b/src/ui/input/input_wrap.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; @@ -46,14 +47,14 @@ export default class InputWrap extends React.Component { } InputWrap.propTypes = { - before: React.PropTypes.element, - children: React.PropTypes.oneOfType([ - React.PropTypes.element.isRequired, - React.PropTypes.arrayOf(React.PropTypes.element).isRequired + before: PropTypes.element, + children: PropTypes.oneOfType([ + PropTypes.element.isRequired, + PropTypes.arrayOf(PropTypes.element).isRequired ]), - focused: React.PropTypes.bool, - invalidHint: React.PropTypes.string, - isValid: React.PropTypes.bool.isRequired, - name: React.PropTypes.string.isRequired, - svg: React.PropTypes.string + focused: PropTypes.bool, + invalidHint: PropTypes.string, + isValid: PropTypes.bool.isRequired, + name: PropTypes.string.isRequired, + svg: PropTypes.string }; diff --git a/src/ui/input/mfa_code_input.jsx b/src/ui/input/mfa_code_input.jsx index 7bfcd7b84..21716da16 100644 --- a/src/ui/input/mfa_code_input.jsx +++ b/src/ui/input/mfa_code_input.jsx @@ -1,14 +1,15 @@ +import PropTypes from 'prop-types'; import React from 'react'; import InputWrap from './input_wrap'; import { icon } from './password_input'; export default class MFACodeInput extends React.Component { static propTypes = { - invalidHint: React.PropTypes.string.isRequired, - isValid: React.PropTypes.bool.isRequired, - onChange: React.PropTypes.func, - placeholder: React.PropTypes.string, - value: React.PropTypes.string.isRequired + invalidHint: PropTypes.string.isRequired, + isValid: PropTypes.bool.isRequired, + onChange: PropTypes.func, + placeholder: PropTypes.string, + value: PropTypes.string.isRequired }; constructor(props) { diff --git a/src/ui/input/password/password_strength.jsx b/src/ui/input/password/password_strength.jsx index 9f8e0e0c0..f7f21e7db 100644 --- a/src/ui/input/password/password_strength.jsx +++ b/src/ui/input/password/password_strength.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import createPolicy from 'password-sheriff'; import util from 'util'; @@ -33,9 +34,9 @@ export default class PasswordStrength extends React.Component { } PasswordStrength.propTypes = { - messages: React.PropTypes.object.isRequired, - password: React.PropTypes.string.isRequired, - policy: React.PropTypes.oneOf([ + messages: PropTypes.object.isRequired, + password: PropTypes.string.isRequired, + policy: PropTypes.oneOf([ "none", "low", "fair", @@ -61,7 +62,7 @@ class List extends React.Component { } List.propTypes = { - items: React.PropTypes.arrayOf(React.PropTypes.object) + items: PropTypes.arrayOf(PropTypes.object) }; class Item extends React.Component { @@ -81,7 +82,7 @@ class Item extends React.Component { } Item.propTypes = { - items: React.PropTypes.array, - message: React.PropTypes.string.isRequired, - verified: React.PropTypes.bool.isRequired + items: PropTypes.array, + message: PropTypes.string.isRequired, + verified: PropTypes.bool.isRequired }; diff --git a/src/ui/input/password_input.jsx b/src/ui/input/password_input.jsx index 91af189f5..3ad13d863 100644 --- a/src/ui/input/password_input.jsx +++ b/src/ui/input/password_input.jsx @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import InputWrap from './input_wrap'; import PasswordStrength from './password/password_strength'; @@ -6,13 +7,13 @@ export const icon = '