Change name of TabList prop
parent
dbb729e556
commit
df76b8a394
|
@ -17,13 +17,13 @@ export const ValuesSection = React.createClass({
|
|||
|
||||
render() {
|
||||
const {rule, query} = this.props;
|
||||
const forcedActiveIndex = TABS.indexOf(_.startCase(rule.trigger));
|
||||
const initialIndex = TABS.indexOf(_.startCase(rule.trigger));
|
||||
|
||||
return (
|
||||
<div className="kapacitor-rule-section">
|
||||
<h3 className="rule-section-heading">Values</h3>
|
||||
<div className="rule-section-body">
|
||||
<Tabs forceActiveIndex={forcedActiveIndex} onSelect={this.handleChooseTrigger}>
|
||||
<Tabs initialIndex={initialIndex} onSelect={this.handleChooseTrigger}>
|
||||
<TabList isKapacitorTabs="true">
|
||||
{TABS.map(tab => <Tab key={tab}>{tab}</Tab>)}
|
||||
</TabList>
|
||||
|
|
|
@ -90,7 +90,7 @@ export const Tabs = React.createClass({
|
|||
onSelect: func,
|
||||
tabContentsClass: string,
|
||||
tabsClass: string,
|
||||
forceActiveIndex: number,
|
||||
initialIndex: number,
|
||||
},
|
||||
|
||||
getDefaultProps() {
|
||||
|
@ -101,10 +101,10 @@ export const Tabs = React.createClass({
|
|||
},
|
||||
|
||||
getInitialState() {
|
||||
// forceActiveIndex allows the user to enable a Tab and TabPanel
|
||||
// initialIndex allows the user to enable a Tab and TabPanel
|
||||
// other than 0 on initial render.
|
||||
return {
|
||||
activeIndex: this.props.forceActiveIndex ? this.props.forceActiveIndex : 0,
|
||||
activeIndex: this.props.initialIndex || 0,
|
||||
};
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue