1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Add .isRequired to App proptypes

This commit is contained in:
Brett Sun 2016-01-12 15:05:00 +01:00
parent 1dca764166
commit 315e5f0108
4 changed files with 22 additions and 14 deletions

View File

@ -18,11 +18,12 @@ import { mergeOptions } from '../utils/general_utils';
let AscribeApp = React.createClass({
propTypes: {
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]),
routes: React.PropTypes.arrayOf(React.PropTypes.object)
])
},
getInitialState() {

View File

@ -21,12 +21,13 @@ import { getCookie } from '../../../../utils/fetch_api_utils';
let PRApp = React.createClass({
propTypes: {
history: React.PropTypes.object.isRequired,
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]),
history: React.PropTypes.object,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
])
},
getInitialState() {
@ -54,7 +55,8 @@ let PRApp = React.createClass({
},
render() {
const { children, currentUser, history, routes, whitelabel } = this.props;
const { children, history, routes } = this.props;
const { currentUser, whitelabel } = this.state;
const subdomain = getSubdomain();
// Add the current user and whitelabel settings to all child routes

View File

@ -20,12 +20,13 @@ import { getSubdomain, mergeOptions } from '../../../../utils/general_utils';
let PrizeApp = React.createClass({
propTypes: {
history: React.PropTypes.object.isRequired,
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]),
history: React.PropTypes.object,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
])
},
getInitialState() {
@ -53,7 +54,8 @@ let PrizeApp = React.createClass({
},
render() {
const { children, currentUser, history, routes, whitelabel } = this.props;
const { children, history, routes } = this.props;
const { currentUser, whitelabel } = this.state;
const subdomain = getSubdomain();
// The second element of routes is always the active component object, where we can

View File

@ -19,12 +19,13 @@ import { getSubdomain, mergeOptions } from '../../../utils/general_utils';
let WalletApp = React.createClass({
propTypes: {
history: React.PropTypes.object.isRequired,
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]),
history: React.PropTypes.object,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
])
},
getInitialState() {
@ -38,6 +39,7 @@ let WalletApp = React.createClass({
UserStore.listen(this.onChange);
WhitelabelStore.listen(this.onChange);
console.log('fetch');
UserActions.fetchCurrentUser();
WhitelabelActions.fetchWhitelabel();
},
@ -52,7 +54,8 @@ let WalletApp = React.createClass({
},
render() {
const { children, currentUser, history, routes, whitelabel } = this.props;
const { children, history, routes } = this.props;
const { currentUser, whitelabel } = this.state;
const subdomain = getSubdomain();
// The second element of routes is always the active component object, where we can