mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 18:07:17 +01:00
0b25f54e86
* add global withFeatureFlags story decorator * add more examples for insight cards * Update UI snapshots for `chromium` (2) * use cached results for all dashboard placements * Update UI snapshots for `chromium` (2) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
23 lines
568 B
TypeScript
23 lines
568 B
TypeScript
import { useFeatureFlags } from '~/mocks/browser'
|
|
import type { DecoratorFn } from '@storybook/react'
|
|
|
|
/** Global story decorator that allows setting feature flags.
|
|
*
|
|
* ```ts
|
|
* export default {
|
|
* title: 'My story',
|
|
* component: MyComponent,
|
|
* parameters: {
|
|
* featureFlags: ['hogql'], // add flags here
|
|
* },
|
|
* } as ComponentMeta<typeof MyComponent>
|
|
* ```
|
|
*/
|
|
export const withFeatureFlags: DecoratorFn = (Story, { parameters }) => {
|
|
if (parameters.featureFlags) {
|
|
useFeatureFlags(parameters.featureFlags)
|
|
}
|
|
|
|
return <Story />
|
|
}
|