|
@@ -1,6 +1,9 @@
|
1
|
1
|
import React from 'react'
|
2
|
2
|
import classnames from 'classnames'
|
3
|
3
|
import PropTypes from 'prop-types'
|
|
4
|
+import PopinFixedHeader from './PopinFixedHeader.jsx'
|
|
5
|
+import PopinFixedOption from './PopinFixedOption.jsx'
|
|
6
|
+import PopinFixedContent from './PopinFixedContent.jsx'
|
4
|
7
|
|
5
|
8
|
const PopinFixed = props => {
|
6
|
9
|
return (
|
|
@@ -17,6 +20,22 @@ PopinFixed.propTypes = {
|
17
|
20
|
visible: PropTypes.bool
|
18
|
21
|
}
|
19
|
22
|
|
|
23
|
+PopinFixed.propTypes = {
|
|
24
|
+ // from http://www.mattzabriskie.com/blog/react-validating-children
|
|
25
|
+ children: PropTypes.arrayOf((children, key, componentName /* , location, propFullName */) => {
|
|
26
|
+ if (
|
|
27
|
+ children.length > 3 ||
|
|
28
|
+ children[0].type !== PopinFixedHeader ||
|
|
29
|
+ children[1].type !== PopinFixedOption ||
|
|
30
|
+ children[2].type !== PopinFixedContent
|
|
31
|
+ ) {
|
|
32
|
+ return new Error(`PropType Error: childrens of ${componentName} must be: 1 PopinFixedHeader, 1 PopinFixedOption and 1 PopinFixedContent.`)
|
|
33
|
+ }
|
|
34
|
+ }).isRequired,
|
|
35
|
+ customClass: PropTypes.string,
|
|
36
|
+ visible: PropTypes.bool
|
|
37
|
+}
|
|
38
|
+
|
20
|
39
|
PopinFixed.defaultProps = {
|
21
|
40
|
customClass: '',
|
22
|
41
|
visible: true
|