mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 17:45:56 +08:00
Deconstruct plugin config
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user