mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Add exports for custom propTypes as shape specs rather than the complete shape
Allows easier composition of the shapes in case we need to extend them in components later
This commit is contained in:
parent
67f56768b8
commit
2706f04f3a
@ -3,10 +3,15 @@ import React from 'react';
|
||||
|
||||
const { number, object, shape, string } = React.PropTypes;
|
||||
|
||||
export default shape({
|
||||
const currentUserShapeSpec = {
|
||||
acl: object,
|
||||
email: string,
|
||||
id: number,
|
||||
profile: object,
|
||||
username: string
|
||||
});
|
||||
};
|
||||
|
||||
export default shape(currentUserShapeSpec);
|
||||
export {
|
||||
currentUserShapeSpec
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
export { default as currentUserShape } from './current_user_shape';
|
||||
export { default as whitelabelShape } from './whitelabel_shape';
|
||||
export currentUserShape from './current_user_shape';
|
||||
export whitelabelShape from './whitelabel_shape';
|
||||
|
||||
// Re-export PropTypes from react-router
|
||||
export { locationShape, routerShape } from 'react-router/es6/PropTypes';
|
||||
|
@ -3,9 +3,14 @@ import React from 'react';
|
||||
|
||||
const { shape, string } = React.PropTypes;
|
||||
|
||||
export default shape({
|
||||
const whitelabelShapeSpec = {
|
||||
name: string,
|
||||
subdomain: string,
|
||||
title: string,
|
||||
user: string
|
||||
});
|
||||
};
|
||||
|
||||
export default shape(whitelabelShapeSpec);
|
||||
export {
|
||||
whitelabelShapeSpec
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user