mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 01:59:08 +00:00
chore: update prettier tab width for consistency (#175)
This commit is contained in:
parent
a931f8c69c
commit
f24d2fcc99
247 changed files with 7224 additions and 7375 deletions
|
@ -1,20 +1,20 @@
|
|||
import {
|
||||
FeatureFlag,
|
||||
FeatureFlagsContext,
|
||||
FeatureFlag,
|
||||
FeatureFlagsContext,
|
||||
} from '@roleypoly/misc-utils/featureFlags/react';
|
||||
import * as React from 'react';
|
||||
|
||||
export type FeatureGateProps = {
|
||||
featureFlag: FeatureFlag;
|
||||
children: () => React.ReactNode;
|
||||
featureFlag: FeatureFlag;
|
||||
children: () => React.ReactNode;
|
||||
};
|
||||
|
||||
export const FeatureGate = (props: FeatureGateProps) => {
|
||||
const featureContext = React.useContext(FeatureFlagsContext);
|
||||
const featureContext = React.useContext(FeatureFlagsContext);
|
||||
|
||||
if (featureContext.has(props.featureFlag)) {
|
||||
return props.children();
|
||||
} else {
|
||||
return <></>;
|
||||
}
|
||||
if (featureContext.has(props.featureFlag)) {
|
||||
return props.children();
|
||||
} else {
|
||||
return <></>;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue