Give descriptive key for slot elements and use it instead of talkPluginName

This commit is contained in:
Chi Vinh Le
2018-03-29 22:47:27 +02:00
parent 4a4c502fdd
commit 761e372016
9 changed files with 59 additions and 9247 deletions
@@ -14,10 +14,10 @@ import cn from 'classnames';
class Settings extends React.Component {
childFactory = el => {
const pluginName = el.type.talkPluginName;
const key = el.key;
const props = {
indicateOn: () => this.props.indicateOn(pluginName),
indicateOff: () => this.props.indicateOff(pluginName),
indicateOn: () => this.props.indicateOn(key),
indicateOff: () => this.props.indicateOff(key),
};
return React.cloneElement(el, props);
};