chore: update codestyle due to prettier/rule updates

This commit is contained in:
41666 2021-06-30 08:02:25 -04:00
parent f632bfa6e5
commit 10e095656f
16 changed files with 298 additions and 292 deletions

View file

@ -1,12 +1,11 @@
import * as React from 'react';
import { FeatureFlag, FeatureFlagProvider, FeatureFlagsContext } from './FeatureFlags';
export const FeatureFlagDecorator = (flags: FeatureFlag[]) => (
storyFn: () => React.ReactNode
) => {
return (
<FeatureFlagsContext.Provider value={new FeatureFlagProvider(flags)}>
{storyFn()}
</FeatureFlagsContext.Provider>
);
};
export const FeatureFlagDecorator =
(flags: FeatureFlag[]) => (storyFn: () => React.ReactNode) => {
return (
<FeatureFlagsContext.Provider value={new FeatureFlagProvider(flags)}>
{storyFn()}
</FeatureFlagsContext.Provider>
);
};

View file

@ -1,10 +1,13 @@
import * as React from 'react';
export const withContext = <T, K extends T>(
Context: React.Context<T>,
Component: React.ComponentType<K>
): React.FunctionComponent<K> => (props) => (
<Context.Consumer>
{(context) => <Component {...props} {...context} />}
</Context.Consumer>
);
export const withContext =
<T, K extends T>(
Context: React.Context<T>,
Component: React.ComponentType<K>
): React.FunctionComponent<K> =>
(props) =>
(
<Context.Consumer>
{(context) => <Component {...props} {...context} />}
</Context.Consumer>
);