Created
February 20, 2017 15:09
-
-
Save Undistraction/028c2ec6b4eff6008e5122a689394f8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// proptypes.js | |
import React from 'react'; | |
export const stepData = React.PropTypes.arrayOf( | |
React.PropTypes.shape({ | |
title: React.PropTypes.string.isRequired, | |
date: React.PropTypes.string.isRequired, | |
filename: React.PropTypes.string.isRequired, | |
colourAnalytics: React.PropTypes.arrayOf( | |
React.PropTypes.shape( | |
{ | |
name: React.PropTypes.string.isRequired, | |
value: React.PropTypes.arrayOf( | |
React.PropTypes.string, | |
), | |
}, | |
), | |
), | |
}), | |
); | |
export const filterFilters = React.PropTypes.arrayOf( | |
React.PropTypes.string.isRequired, | |
); | |
export const filter = React.PropTypes.shape( | |
{ | |
date: React.PropTypes.string, | |
filters: filterFilters, | |
}, | |
); | |
export const step = React.PropTypes.shape( | |
{ | |
data: stepData, | |
date: React.PropTypes.number.isRequired, | |
filters: filter, | |
}, | |
); | |
// ExampleComponent.js | |
import * as PropTypes from '../proptypes'; | |
ExampleComponent.propTypes = { | |
step: PropTypes.step, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment