0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/.storybook/app-context.ts
Marius Andra 715056ab69
refactor(frontend): several tiny refactors (#9126)
* thrown an explicit error if can't render react app (shown on the toolbar authorize scene)

* remove reverse logic connection

* upgrade kea, remove deprecated code

* don't permanently auto-connect this logic

* add few direct connections

* remove automatic mount

* fix few extra setState calls

* improve howto create stories

* refactor new dashboard form

* use new form component for flags

* new flag story

* refactor scene stories to use <App />

* add even more default mocks

* fix two bugs

* fix more test issues

* increase the quality of mocked data

* fix new dashboard redirect logic, simplify code even further

* fix test

* update docs
2022-03-21 13:45:10 +01:00

13 lines
474 B
TypeScript

import { AppContext } from '~/types'
import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'
export const getStorybookAppContext = (): AppContext => ({
anonymous: false,
current_team: MOCK_DEFAULT_TEAM,
current_user: undefined as any, // undefined triggers a fetch and lets us mock the data
default_event_name: '$pageview',
persisted_feature_flags: [],
preflight: null as any, // null triggers a fetch and lets us mock the data
switched_team: null,
})