mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-15 17:19:10 +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,19 +1,19 @@
|
|||
import * as React from 'react';
|
||||
|
||||
export enum FeatureFlag {
|
||||
AllowListsBlockLists = 'AllowListsBlockLists',
|
||||
AllowListsBlockLists = 'AllowListsBlockLists',
|
||||
}
|
||||
|
||||
export class FeatureFlagProvider {
|
||||
activeFlags: FeatureFlag[] = [];
|
||||
activeFlags: FeatureFlag[] = [];
|
||||
|
||||
constructor(flags: FeatureFlag[] = []) {
|
||||
this.activeFlags = flags;
|
||||
}
|
||||
constructor(flags: FeatureFlag[] = []) {
|
||||
this.activeFlags = flags;
|
||||
}
|
||||
|
||||
has(flag: FeatureFlag) {
|
||||
return this.activeFlags.includes(flag);
|
||||
}
|
||||
has(flag: FeatureFlag) {
|
||||
return this.activeFlags.includes(flag);
|
||||
}
|
||||
}
|
||||
|
||||
export const FeatureFlagsContext = React.createContext(new FeatureFlagProvider());
|
||||
|
|
|
@ -2,11 +2,11 @@ import * as React from 'react';
|
|||
import { FeatureFlag, FeatureFlagProvider, FeatureFlagsContext } from './FeatureFlags';
|
||||
|
||||
export const FeatureFlagDecorator = (flags: FeatureFlag[]) => (
|
||||
storyFn: () => React.ReactNode
|
||||
storyFn: () => React.ReactNode
|
||||
) => {
|
||||
return (
|
||||
<FeatureFlagsContext.Provider value={new FeatureFlagProvider(flags)}>
|
||||
{storyFn()}
|
||||
</FeatureFlagsContext.Provider>
|
||||
);
|
||||
return (
|
||||
<FeatureFlagsContext.Provider value={new FeatureFlagProvider(flags)}>
|
||||
{storyFn()}
|
||||
</FeatureFlagsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue