summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/features/featureToggle.js
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/features/featureToggle.js')
-rw-r--r--openecomp-ui/src/sdc-app/features/featureToggle.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/openecomp-ui/src/sdc-app/features/featureToggle.js b/openecomp-ui/src/sdc-app/features/featureToggle.js
index ffdd19aabf..5e0df1448f 100644
--- a/openecomp-ui/src/sdc-app/features/featureToggle.js
+++ b/openecomp-ui/src/sdc-app/features/featureToggle.js
@@ -37,8 +37,13 @@ import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
-export const FeatureComponent = ({features = [], featureName, InnerComponent}) => {
- return !!features.find(el => el.name === featureName && el.active) ? <InnerComponent/> : null;
+export const FeatureComponent = (props) => {
+ const {features = [], featureName, InnerComponent, ...otherProps} = props;
+ const AComp = InnerComponent.AComp ? InnerComponent.AComp : InnerComponent;
+
+ return !!features.find(el => el.name === featureName && el.active) ?
+ <AComp {...otherProps}/>
+ : InnerComponent.BComp ? <InnerComponent.BComp {...otherProps}/> : null;
};
FeatureComponent.propTypes = {