Deconstruct plugin config

This commit is contained in:
Belen Curcio
2017-05-02 15:40:37 -03:00
parent b444316e1c
commit cc0a23c295
+3 -4
View File
@@ -4,11 +4,10 @@ import styles from './Slot.css';
import {connect} from 'react-redux';
import {getSlotElements} from 'coral-framework/helpers/plugins';
function Slot ({fill, inline = false, config: {plugin_config = {}}, ...rest}) {
const {debug} = plugin_config;
function Slot ({fill, inline = false, plugin_config: {debug, config}, ...rest}) {
return (
<div className={cn({[styles.inline]: inline, [styles.debug]: debug})}>
{getSlotElements(fill, rest)}
{getSlotElements(fill, {config, ...rest})}
</div>
);
}
@@ -17,7 +16,7 @@ Slot.propTypes = {
fill: React.PropTypes.string
};
const mapStateToProps = ({config}) => ({config});
const mapStateToProps = ({config: {plugin_config = {}}}) => ({plugin_config});
export default connect(mapStateToProps, null)(Slot);