Skip to content

Commit

Permalink
Fix Modal propType warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eliihen committed Nov 14, 2016
1 parent f32b4b2 commit c16fe59
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -26,6 +26,7 @@
"classnames": "^2.2.5",
"immutable": "^3.8.1",
"lodash.flow": "^3.5.0",
"md5": "^2.2.1",
"object-assign": "^4.1.0",
"react": "15.4.0-rc.4",
"react-bootstrap": "^0.30.5",
Expand Down
9 changes: 8 additions & 1 deletion src/components/Modal/index.js
@@ -1,6 +1,7 @@
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { Modal, Button } from 'react-bootstrap';
import md5 from 'md5';

import modalPropTypes from '../../propTypes/modal';
import * as Actions from '../../store/modal/actions';
Expand All @@ -21,6 +22,7 @@ function ModalComponent({ modal, removeModal }) {
<Modal.Footer>
{modal.actions && modal.actions.map(action => (
<Button
key={md5(action)}
data-dismiss="modal"
onClick={action.click}
>
Expand All @@ -43,7 +45,12 @@ function ModalComponent({ modal, removeModal }) {
}

ModalComponent.propTypes = {
modal: modalPropTypes.isRequired,
modal: PropTypes.oneOfType([
modalPropTypes.isRequired, // Visible state
PropTypes.shape({ // Hidden state
visible: PropTypes.oneOf([false]).isRequired, // eslint-disable-line react/no-unused-prop-types
}).isRequired,
]).isRequired,
removeModal: PropTypes.func.isRequired,
};

Expand Down
18 changes: 17 additions & 1 deletion yarn.lock
Expand Up @@ -942,6 +942,10 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

charenc@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.1.tgz#004cff9feaf102382ed12db58dd6f962796d6e88"

cheerio@^0.22.0:
version "0.22.0"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e"
Expand Down Expand Up @@ -1149,6 +1153,10 @@ create-hmac@^1.1.0, create-hmac@^1.1.2:
create-hash "^1.1.0"
inherits "^2.0.1"

crypt@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.1.tgz#5f11b21a6c05ef1b5e79708366da6374ece1e6a2"

cryptiles@2.x.x:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
Expand Down Expand Up @@ -2156,7 +2164,7 @@ is-binary-path@^1.0.0:
dependencies:
binary-extensions "^1.0.0"

is-buffer@^1.0.2:
is-buffer@^1.0.2, is-buffer@~1.1.1:
version "1.1.4"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b"

Expand Down Expand Up @@ -2931,6 +2939,14 @@ marked@^0.3.6:
version "0.3.6"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7"

md5:
version "2.2.1"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9"
dependencies:
charenc "~0.0.1"
crypt "~0.0.1"
is-buffer "~1.1.1"

memory-fs@^0.3.0, memory-fs@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.3.0.tgz#7bcc6b629e3a43e871d7e29aca6ae8a7f15cbb20"
Expand Down

0 comments on commit c16fe59

Please sign in to comment.