mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Add .isRequired
to App proptypes
This commit is contained in:
parent
1dca764166
commit
315e5f0108
@ -18,11 +18,12 @@ import { mergeOptions } from '../utils/general_utils';
|
|||||||
|
|
||||||
let AscribeApp = React.createClass({
|
let AscribeApp = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
|
||||||
|
|
||||||
children: React.PropTypes.oneOfType([
|
children: React.PropTypes.oneOfType([
|
||||||
React.PropTypes.arrayOf(React.PropTypes.element),
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
React.PropTypes.element
|
React.PropTypes.element
|
||||||
]),
|
])
|
||||||
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
|
@ -21,12 +21,13 @@ import { getCookie } from '../../../../utils/fetch_api_utils';
|
|||||||
|
|
||||||
let PRApp = React.createClass({
|
let PRApp = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
history: React.PropTypes.object.isRequired,
|
||||||
|
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
|
||||||
|
|
||||||
children: React.PropTypes.oneOfType([
|
children: React.PropTypes.oneOfType([
|
||||||
React.PropTypes.arrayOf(React.PropTypes.element),
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
React.PropTypes.element
|
React.PropTypes.element
|
||||||
]),
|
])
|
||||||
history: React.PropTypes.object,
|
|
||||||
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -54,7 +55,8 @@ let PRApp = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { children, currentUser, history, routes, whitelabel } = this.props;
|
const { children, history, routes } = this.props;
|
||||||
|
const { currentUser, whitelabel } = this.state;
|
||||||
const subdomain = getSubdomain();
|
const subdomain = getSubdomain();
|
||||||
|
|
||||||
// Add the current user and whitelabel settings to all child routes
|
// Add the current user and whitelabel settings to all child routes
|
||||||
|
@ -20,12 +20,13 @@ import { getSubdomain, mergeOptions } from '../../../../utils/general_utils';
|
|||||||
|
|
||||||
let PrizeApp = React.createClass({
|
let PrizeApp = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
history: React.PropTypes.object.isRequired,
|
||||||
|
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
|
||||||
|
|
||||||
children: React.PropTypes.oneOfType([
|
children: React.PropTypes.oneOfType([
|
||||||
React.PropTypes.arrayOf(React.PropTypes.element),
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
React.PropTypes.element
|
React.PropTypes.element
|
||||||
]),
|
])
|
||||||
history: React.PropTypes.object,
|
|
||||||
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -53,7 +54,8 @@ let PrizeApp = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { children, currentUser, history, routes, whitelabel } = this.props;
|
const { children, history, routes } = this.props;
|
||||||
|
const { currentUser, whitelabel } = this.state;
|
||||||
const subdomain = getSubdomain();
|
const subdomain = getSubdomain();
|
||||||
|
|
||||||
// The second element of routes is always the active component object, where we can
|
// The second element of routes is always the active component object, where we can
|
||||||
|
@ -19,12 +19,13 @@ import { getSubdomain, mergeOptions } from '../../../utils/general_utils';
|
|||||||
|
|
||||||
let WalletApp = React.createClass({
|
let WalletApp = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
history: React.PropTypes.object.isRequired,
|
||||||
|
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
|
||||||
|
|
||||||
children: React.PropTypes.oneOfType([
|
children: React.PropTypes.oneOfType([
|
||||||
React.PropTypes.arrayOf(React.PropTypes.element),
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
React.PropTypes.element
|
React.PropTypes.element
|
||||||
]),
|
])
|
||||||
history: React.PropTypes.object,
|
|
||||||
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -38,6 +39,7 @@ let WalletApp = React.createClass({
|
|||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
WhitelabelStore.listen(this.onChange);
|
WhitelabelStore.listen(this.onChange);
|
||||||
|
|
||||||
|
console.log('fetch');
|
||||||
UserActions.fetchCurrentUser();
|
UserActions.fetchCurrentUser();
|
||||||
WhitelabelActions.fetchWhitelabel();
|
WhitelabelActions.fetchWhitelabel();
|
||||||
},
|
},
|
||||||
@ -52,7 +54,8 @@ let WalletApp = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { children, currentUser, history, routes, whitelabel } = this.props;
|
const { children, history, routes } = this.props;
|
||||||
|
const { currentUser, whitelabel } = this.state;
|
||||||
const subdomain = getSubdomain();
|
const subdomain = getSubdomain();
|
||||||
|
|
||||||
// The second element of routes is always the active component object, where we can
|
// The second element of routes is always the active component object, where we can
|
||||||
|
Loading…
Reference in New Issue
Block a user