diff options
author | svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com> | 2018-03-19 12:15:19 +0200 |
---|---|---|
committer | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2018-03-20 07:51:05 +0000 |
commit | 091edfdac90f66d91caff1b93131f99ba74f9aeb (patch) | |
tree | a6a24fc4a295b7f804aeb2a2211e58b38bbf922a /openecomp-ui/src/sdc-app/features/featureToggle.js | |
parent | fefa3e408f77289594e47edc878d1bee61fca90b (diff) |
ui support for archive items
Issue-ID: SDC-1088
Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/features/featureToggle.js')
-rw-r--r-- | openecomp-ui/src/sdc-app/features/featureToggle.js | 9 |
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 = { |