Skip to content

Commit 16efd72

Browse files
manosimclaydiffrient
authored andcommittedApr 13, 2017
Use prop-types
1 parent e579a0d commit 16efd72

File tree

3 files changed

+91
-93
lines changed

3 files changed

+91
-93
lines changed
 

Diff for: ‎lib/components/Modal.js

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var React = require('react');
22
var ReactDOM = require('react-dom');
3+
var PropTypes = require('prop-types');
34
var ExecutionEnvironment = require('exenv');
45
var ModalPortal = React.createFactory(require('./ModalPortal'));
56
var ariaAppHider = require('../helpers/ariaAppHider');
@@ -30,21 +31,21 @@ var Modal = React.createClass({
3031
},
3132

3233
propTypes: {
33-
isOpen: React.PropTypes.bool.isRequired,
34-
style: React.PropTypes.shape({
35-
content: React.PropTypes.object,
36-
overlay: React.PropTypes.object
34+
isOpen: PropTypes.bool.isRequired,
35+
style: PropTypes.shape({
36+
content: PropTypes.object,
37+
overlay: PropTypes.object
3738
}),
38-
portalClassName: React.PropTypes.string,
39-
appElement: React.PropTypes.instanceOf(SafeHTMLElement),
40-
onAfterOpen: React.PropTypes.func,
41-
onRequestClose: React.PropTypes.func,
42-
closeTimeoutMS: React.PropTypes.number,
43-
ariaHideApp: React.PropTypes.bool,
44-
shouldCloseOnOverlayClick: React.PropTypes.bool,
45-
parentSelector: React.PropTypes.func,
46-
role: React.PropTypes.string,
47-
contentLabel: React.PropTypes.string.isRequired
39+
portalClassName: PropTypes.string,
40+
appElement: PropTypes.instanceOf(SafeHTMLElement),
41+
onAfterOpen: PropTypes.func,
42+
onRequestClose: PropTypes.func,
43+
closeTimeoutMS: PropTypes.number,
44+
ariaHideApp: PropTypes.bool,
45+
shouldCloseOnOverlayClick: PropTypes.bool,
46+
parentSelector: PropTypes.func,
47+
role: PropTypes.string,
48+
contentLabel: PropTypes.string.isRequired
4849
},
4950

5051
getDefaultProps: function () {

Diff for: ‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"dependencies": {
5959
"element-class": "^0.2.0",
6060
"exenv": "1.2.0",
61-
"lodash.assign": "^4.2.0"
61+
"lodash.assign": "^4.2.0",
62+
"prop-types": "^15.5.7"
6263
},
6364
"peerDependencies": {
6465
"react": "^0.14.0 || ^15.0.0",
@@ -75,4 +76,4 @@
7576
"modal",
7677
"dialog"
7778
]
78-
}
79+
}

Diff for: ‎yarn.lock

+73-77
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ amdefine@>=0.0.4:
4444
version "1.0.1"
4545
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
4646

47-
ansi-regex@*, ansi-regex@^2.0.0:
47+
ansi-regex@^2.0.0:
4848
version "2.0.0"
4949
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107"
5050

@@ -1155,7 +1155,7 @@ debug@^2.1.1, debug@^2.2.0:
11551155
dependencies:
11561156
ms "0.7.2"
11571157

1158-
debuglog@*, debuglog@^1.0.1:
1158+
debuglog@^1.0.1:
11591159
version "1.0.1"
11601160
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
11611161

@@ -1575,6 +1575,18 @@ fbjs@^0.8.1, fbjs@^0.8.4:
15751575
setimmediate "^1.0.5"
15761576
ua-parser-js "^0.7.9"
15771577

1578+
fbjs@^0.8.9:
1579+
version "0.8.12"
1580+
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
1581+
dependencies:
1582+
core-js "^1.0.0"
1583+
isomorphic-fetch "^2.1.1"
1584+
loose-envify "^1.0.0"
1585+
object-assign "^4.1.0"
1586+
promise "^7.1.1"
1587+
setimmediate "^1.0.5"
1588+
ua-parser-js "^0.7.9"
1589+
15781590
filename-regex@^2.0.0:
15791591
version "2.0.0"
15801592
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775"
@@ -2012,7 +2024,7 @@ iferr@^0.1.5, iferr@~0.1.5:
20122024
version "0.1.5"
20132025
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
20142026

2015-
imurmurhash@*, imurmurhash@^0.1.4:
2027+
imurmurhash@^0.1.4:
20162028
version "0.1.4"
20172029
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
20182030

@@ -2480,10 +2492,6 @@ lodash._baseflatten@~4.1.0:
24802492
version "4.1.1"
24812493
resolved "https://registry.yarnpkg.com/lodash._baseflatten/-/lodash._baseflatten-4.1.1.tgz#5c87403b88f3687a88d26424faadf3aa054aab0d"
24822494

2483-
lodash._baseindexof@*:
2484-
version "3.1.0"
2485-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
2486-
24872495
lodash._baseuniq@~4.4.0:
24882496
version "4.4.0"
24892497
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.4.0.tgz#a445294347a2f5311f585fe3225644530b9b8fae"
@@ -2498,25 +2506,11 @@ lodash._baseuniq@~4.5.0:
24982506
lodash._createset "~4.0.0"
24992507
lodash._setcache "~4.1.0"
25002508

2501-
lodash._bindcallback@*:
2502-
version "3.0.1"
2503-
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
2504-
2505-
lodash._cacheindexof@*:
2506-
version "3.0.2"
2507-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
2508-
2509-
lodash._createcache@*:
2510-
version "3.1.2"
2511-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
2512-
dependencies:
2513-
lodash._getnative "^3.0.0"
2514-
25152509
lodash._createset@~4.0.0:
25162510
version "4.0.3"
25172511
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
25182512

2519-
lodash._getnative@*, lodash._getnative@^3.0.0:
2513+
lodash._getnative@^3.0.0:
25202514
version "3.9.1"
25212515
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
25222516

@@ -2590,10 +2584,6 @@ lodash.rest@^4.0.0:
25902584
version "4.0.5"
25912585
resolved "https://registry.yarnpkg.com/lodash.rest/-/lodash.rest-4.0.5.tgz#954ef75049262038c96d1fc98b28fdaf9f0772aa"
25922586

2593-
lodash.restparam@*:
2594-
version "3.6.1"
2595-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
2596-
25972587
lodash.union@~4.2.0:
25982588
version "4.2.1"
25992589
resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.2.1.tgz#6871017b9b1ff71952c1e2bb2e25b1046a7e2842"
@@ -3246,15 +3236,15 @@ on-finished@~2.3.0:
32463236
dependencies:
32473237
ee-first "1.1.1"
32483238

3249-
once@^1.3.0, once@^1.3.3, once@~1.4.0:
3250-
version "1.4.0"
3251-
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
3239+
once@^1.3.0, once@~1.3.3:
3240+
version "1.3.3"
3241+
resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20"
32523242
dependencies:
32533243
wrappy "1"
32543244

3255-
once@~1.3.3:
3256-
version "1.3.3"
3257-
resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20"
3245+
once@^1.3.3, once@~1.4.0:
3246+
version "1.4.0"
3247+
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
32583248
dependencies:
32593249
wrappy "1"
32603250

@@ -3463,6 +3453,12 @@ promzard@^0.3.0:
34633453
dependencies:
34643454
read "1"
34653455

3456+
prop-types@^15.5.7:
3457+
version "15.5.7"
3458+
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.7.tgz#231c4f29cdd82e355011d4889386ca9059544dd1"
3459+
dependencies:
3460+
fbjs "^0.8.9"
3461+
34663462
proto-list@~1.2.1:
34673463
version "1.2.4"
34683464
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
@@ -3632,39 +3628,30 @@ read@1, read@1.0.x, read@~1.0.1, read@~1.0.7:
36323628
dependencies:
36333629
mute-stream "~0.0.4"
36343630

3635-
"readable-stream@1 || 2", "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.0, readable-stream@^2.2.2:
3636-
version "2.2.2"
3637-
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
3631+
"readable-stream@1 || 2", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@~2.0.5:
3632+
version "2.0.6"
3633+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
36383634
dependencies:
3639-
buffer-shims "^1.0.0"
36403635
core-util-is "~1.0.0"
36413636
inherits "~2.0.1"
36423637
isarray "~1.0.0"
36433638
process-nextick-args "~1.0.6"
36443639
string_decoder "~0.10.x"
36453640
util-deprecate "~1.0.1"
36463641

3647-
readable-stream@~1.0.2:
3648-
version "1.0.34"
3649-
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
3650-
dependencies:
3651-
core-util-is "~1.0.0"
3652-
inherits "~2.0.1"
3653-
isarray "0.0.1"
3654-
string_decoder "~0.10.x"
3655-
3656-
readable-stream@~2.0.5:
3657-
version "2.0.6"
3658-
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
3642+
"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.2.2:
3643+
version "2.2.2"
3644+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
36593645
dependencies:
3646+
buffer-shims "^1.0.0"
36603647
core-util-is "~1.0.0"
36613648
inherits "~2.0.1"
36623649
isarray "~1.0.0"
36633650
process-nextick-args "~1.0.6"
36643651
string_decoder "~0.10.x"
36653652
util-deprecate "~1.0.1"
36663653

3667-
readable-stream@~2.1.4, readable-stream@~2.1.5:
3654+
readable-stream@^2.1.0, readable-stream@~2.1.4, readable-stream@~2.1.5:
36683655
version "2.1.5"
36693656
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
36703657
dependencies:
@@ -3676,7 +3663,16 @@ readable-stream@~2.1.4, readable-stream@~2.1.5:
36763663
string_decoder "~0.10.x"
36773664
util-deprecate "~1.0.1"
36783665

3679-
readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0:
3666+
readable-stream@~1.0.2:
3667+
version "1.0.34"
3668+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
3669+
dependencies:
3670+
core-util-is "~1.0.0"
3671+
inherits "~2.0.1"
3672+
isarray "0.0.1"
3673+
string_decoder "~0.10.x"
3674+
3675+
readdir-scoped-modules@^1.0.0:
36803676
version "1.0.2"
36813677
resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747"
36823678
dependencies:
@@ -3769,86 +3765,86 @@ repeating@^2.0.0:
37693765
dependencies:
37703766
is-finite "^1.0.0"
37713767

3772-
request@2, request@^2.47.0, request@^2.74.0, request@~2.74.0:
3773-
version "2.74.0"
3774-
resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab"
3768+
request@2, request@^2.47.0, request@~2.69.0:
3769+
version "2.69.0"
3770+
resolved "https://registry.yarnpkg.com/request/-/request-2.69.0.tgz#cf91d2e000752b1217155c005241911991a2346a"
37753771
dependencies:
37763772
aws-sign2 "~0.6.0"
37773773
aws4 "^1.2.1"
3778-
bl "~1.1.2"
3774+
bl "~1.0.0"
37793775
caseless "~0.11.0"
37803776
combined-stream "~1.0.5"
37813777
extend "~3.0.0"
37823778
forever-agent "~0.6.1"
3783-
form-data "~1.0.0-rc4"
3779+
form-data "~1.0.0-rc3"
37843780
har-validator "~2.0.6"
3785-
hawk "~3.1.3"
3781+
hawk "~3.1.0"
37863782
http-signature "~1.1.0"
37873783
is-typedarray "~1.0.0"
37883784
isstream "~0.1.2"
37893785
json-stringify-safe "~5.0.1"
37903786
mime-types "~2.1.7"
37913787
node-uuid "~1.4.7"
3792-
oauth-sign "~0.8.1"
3793-
qs "~6.2.0"
3788+
oauth-sign "~0.8.0"
3789+
qs "~6.0.2"
37943790
stringstream "~0.0.4"
3795-
tough-cookie "~2.3.0"
3791+
tough-cookie "~2.2.0"
37963792
tunnel-agent "~0.4.1"
37973793

37983794
request@2.9.x:
37993795
version "2.9.203"
38003796
resolved "https://registry.yarnpkg.com/request/-/request-2.9.203.tgz#6c1711a5407fb94a114219563e44145bcbf4723a"
38013797

3802-
request@^2.79.0:
3803-
version "2.79.0"
3804-
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
3798+
request@^2.74.0, request@~2.74.0:
3799+
version "2.74.0"
3800+
resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab"
38053801
dependencies:
38063802
aws-sign2 "~0.6.0"
38073803
aws4 "^1.2.1"
3804+
bl "~1.1.2"
38083805
caseless "~0.11.0"
38093806
combined-stream "~1.0.5"
38103807
extend "~3.0.0"
38113808
forever-agent "~0.6.1"
3812-
form-data "~2.1.1"
3809+
form-data "~1.0.0-rc4"
38133810
har-validator "~2.0.6"
38143811
hawk "~3.1.3"
38153812
http-signature "~1.1.0"
38163813
is-typedarray "~1.0.0"
38173814
isstream "~0.1.2"
38183815
json-stringify-safe "~5.0.1"
38193816
mime-types "~2.1.7"
3817+
node-uuid "~1.4.7"
38203818
oauth-sign "~0.8.1"
3821-
qs "~6.3.0"
3819+
qs "~6.2.0"
38223820
stringstream "~0.0.4"
38233821
tough-cookie "~2.3.0"
38243822
tunnel-agent "~0.4.1"
3825-
uuid "^3.0.0"
38263823

3827-
request@~2.69.0:
3828-
version "2.69.0"
3829-
resolved "https://registry.yarnpkg.com/request/-/request-2.69.0.tgz#cf91d2e000752b1217155c005241911991a2346a"
3824+
request@^2.79.0:
3825+
version "2.79.0"
3826+
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
38303827
dependencies:
38313828
aws-sign2 "~0.6.0"
38323829
aws4 "^1.2.1"
3833-
bl "~1.0.0"
38343830
caseless "~0.11.0"
38353831
combined-stream "~1.0.5"
38363832
extend "~3.0.0"
38373833
forever-agent "~0.6.1"
3838-
form-data "~1.0.0-rc3"
3834+
form-data "~2.1.1"
38393835
har-validator "~2.0.6"
3840-
hawk "~3.1.0"
3836+
hawk "~3.1.3"
38413837
http-signature "~1.1.0"
38423838
is-typedarray "~1.0.0"
38433839
isstream "~0.1.2"
38443840
json-stringify-safe "~5.0.1"
38453841
mime-types "~2.1.7"
3846-
node-uuid "~1.4.7"
3847-
oauth-sign "~0.8.0"
3848-
qs "~6.0.2"
3842+
oauth-sign "~0.8.1"
3843+
qs "~6.3.0"
38493844
stringstream "~0.0.4"
3850-
tough-cookie "~2.2.0"
3845+
tough-cookie "~2.3.0"
38513846
tunnel-agent "~0.4.1"
3847+
uuid "^3.0.0"
38523848

38533849
requires-port@1.x.x:
38543850
version "1.0.0"
@@ -4243,7 +4239,7 @@ stringstream@~0.0.4:
42434239
version "0.0.5"
42444240
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
42454241

4246-
strip-ansi@*, strip-ansi@^3.0.0, strip-ansi@^3.0.1, strip-ansi@~3.0.1:
4242+
strip-ansi@^3.0.0, strip-ansi@^3.0.1, strip-ansi@~3.0.1:
42474243
version "3.0.1"
42484244
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
42494245
dependencies:
@@ -4481,7 +4477,7 @@ uuid@^3.0.0:
44814477
version "3.0.1"
44824478
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"
44834479

4484-
validate-npm-package-license@*, validate-npm-package-license@^3.0.1, validate-npm-package-license@~3.0.1:
4480+
validate-npm-package-license@^3.0.1, validate-npm-package-license@~3.0.1:
44854481
version "3.0.1"
44864482
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc"
44874483
dependencies:

0 commit comments

Comments
 (0)
Please sign in to comment.