-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-native-storybook): add SafeAreaProvider and simplify SB imp…
…orts
- Loading branch information
1 parent
67823a7
commit 9a58d34
Showing
7 changed files
with
237 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 1 addition & 15 deletions
16
packages/react-native-storybook/src/getStorybook/utils/storybookImports.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
// storybookAdapter.js | ||
let addonsV7: any, SET_CURRENT_STORY_V7: any, addonsV8: any, SET_CURRENT_STORY_V8: any; | ||
let addonsV7: any, addonsV8: any; | ||
|
||
try { | ||
addonsV7 = require('@storybook/manager-api').addons; | ||
} catch (error) { | ||
// Ignore if module is not found | ||
} | ||
|
||
try { | ||
SET_CURRENT_STORY_V7 = require('@storybook/core-events').SET_CURRENT_STORY; | ||
} catch (error) { | ||
// Ignore if module is not found | ||
} | ||
|
||
try { | ||
addonsV8 = require('@storybook/core/manager-api').addons; | ||
} catch (error) { | ||
// Ignore if module is not found | ||
} | ||
|
||
try { | ||
SET_CURRENT_STORY_V8 = require('@storybook/core/core-events').SET_CURRENT_STORY; | ||
} catch (error) { | ||
// Ignore if module is not found | ||
} | ||
|
||
export const getAddons = (): any => addonsV8 ?? addonsV7; | ||
export const getSetCurrentStory = (): any => SET_CURRENT_STORY_V8 ?? SET_CURRENT_STORY_V7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.