-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
755f8a9
commit 6413507
Showing
8 changed files
with
109 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ module.exports = { | |
'as', | ||
'border', | ||
'flexAling', | ||
'featureName', | ||
], | ||
}, | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/shared/lib/features/ToggleFeaturesComponent/ToggleFeaturesComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ReactElement } from 'react' | ||
|
||
import { getFeatureFlag } from '../setGetFeatures/setGetFeatures' | ||
|
||
import { FeatureFlags } from '@/shared/types/featureFlags' | ||
|
||
interface ToggleFeaturesComponentProps { | ||
featureName: keyof FeatureFlags | ||
on: ReactElement | ||
off: ReactElement | ||
} | ||
|
||
export const ToggleFeaturesComponent = (props: ToggleFeaturesComponentProps) => { | ||
const { featureName, on, off } = props | ||
|
||
if (getFeatureFlag(featureName)) { | ||
return on | ||
} | ||
|
||
return off | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export { ToggleFeaturesComponent } from './ToggleFeaturesComponent/ToggleFeaturesComponent' | ||
|
||
export { toggleFeatures } from './toggleFeatures/toggleFeatures' | ||
|
||
export { getFeatureFlag, setFeatureFlags } from './setGetFeatures/setGetFeatures' |