refactor into using config reducer

This commit is contained in:
okbel
2018-03-20 11:52:44 -03:00
parent 8a2fa2432f
commit d6fba2d515
6 changed files with 22 additions and 34 deletions
+6 -10
View File
@@ -69,7 +69,6 @@ class Slot extends React.Component {
defaultComponent: DefaultComponent,
queryData,
fill,
debug = {},
} = this.props;
const { plugins } = this.context;
let children = this.getChildren();
@@ -95,19 +94,18 @@ class Slot extends React.Component {
children = children.map(childFactory);
}
const debugProps =
debug.plugins || pluginsConfig.debug
? {
'data-slot-name': fill,
}
: {};
const debugProps = pluginsConfig.debug
? {
'data-slot-name': fill,
}
: {};
return (
<Component
className={cn(
{
[styles.inline]: inline,
[styles.debug]: debug.plugins || pluginsConfig.debug,
[styles.debug]: pluginsConfig.debug,
},
className,
`talk-slot-${kebabCase(fill)}`
@@ -125,7 +123,6 @@ Slot.defaultProps = {
};
Slot.propTypes = {
debug: PropTypes.object,
fill: PropTypes.string.isRequired,
inline: PropTypes.bool,
className: PropTypes.string,
@@ -161,7 +158,6 @@ Slot.propTypes = {
const mapStateToProps = state => ({
reduxState: state,
debug: state.debug,
});
export default connect(mapStateToProps, null)(Slot);