From b444316e1cb1fc8466e898421e415bf41a155d98 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 2 May 2017 15:31:58 -0300 Subject: [PATCH] Adding debug plugins --- client/coral-framework/components/Slot.css | 4 ++++ client/coral-framework/components/Slot.js | 11 +++++++++-- views/article.ejs | 5 ++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/client/coral-framework/components/Slot.css b/client/coral-framework/components/Slot.css index 6048da181..6a95d79ad 100644 --- a/client/coral-framework/components/Slot.css +++ b/client/coral-framework/components/Slot.css @@ -1,3 +1,7 @@ .inline { display: inline-block; } + +.debug { + background-color: coral; +} \ No newline at end of file diff --git a/client/coral-framework/components/Slot.js b/client/coral-framework/components/Slot.js index 8e2dd9502..b08484353 100644 --- a/client/coral-framework/components/Slot.js +++ b/client/coral-framework/components/Slot.js @@ -1,11 +1,13 @@ import React from 'react'; import cn from 'classnames'; import styles from './Slot.css'; +import {connect} from 'react-redux'; import {getSlotElements} from 'coral-framework/helpers/plugins'; -export default function Slot ({fill, inline = false, ...rest}) { +function Slot ({fill, inline = false, config: {plugin_config = {}}, ...rest}) { + const {debug} = plugin_config; return ( -
+
{getSlotElements(fill, rest)}
); @@ -14,3 +16,8 @@ export default function Slot ({fill, inline = false, ...rest}) { Slot.propTypes = { fill: React.PropTypes.string }; + +const mapStateToProps = ({config}) => ({config}); + +export default connect(mapStateToProps, null)(Slot); + diff --git a/views/article.ejs b/views/article.ejs index 463076db0..bc29467f1 100644 --- a/views/article.ejs +++ b/views/article.ejs @@ -29,7 +29,10 @@ talk: '/', asset_url: '<%= asset_url ? asset_url : '' %>', asset_id: '<%= asset_id ? asset_id : '' %>', - hola: 'asd' + plugin_config: { + test: 'data', + debug: false + } }) ">