-
+ {cloneElement(appBar, { title, open, logout })}
-
-
-
+ {cloneElement(sidebar, {
+ children: cloneElement(menu, {
+ logout,
+ hasDashboard: !!dashboard,
+ }),
+ })}
{hasError
- ?
+ ? cloneElement(error, {
+ error: errorMessage,
+ errorInfo,
+ title,
+ })
: children}
-
+ {cloneElement(notification)}
);
@@ -138,28 +140,28 @@ class Layout extends Component {
}
Layout.propTypes = {
- appBar: ComponentPropType,
+ appBar: PropTypes.element,
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
classes: PropTypes.object,
className: PropTypes.string,
customRoutes: PropTypes.array,
- dashboard: ComponentPropType,
- error: ComponentPropType,
+ dashboard: PropTypes.element,
+ error: PropTypes.element,
history: PropTypes.object.isRequired,
- logout: ComponentPropType,
- menu: ComponentPropType,
- notification: ComponentPropType,
+ logout: PropTypes.element,
+ menu: PropTypes.element,
+ notification: PropTypes.element,
open: PropTypes.bool,
- sidebar: ComponentPropType,
+ sidebar: PropTypes.element,
title: PropTypes.node.isRequired,
};
Layout.defaultProps = {
- appBar: DefaultAppBar,
- error: DefaultError,
- menu: DefaultMenu,
- notification: DefaultNotification,
- sidebar: DefaultSidebar,
+ appBar: