Created
June 20, 2019 16:14
-
-
Save mattpocock/7dde8a79e401cc34f39ed0a1be498755 to your computer and use it in GitHub Desktop.
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
import React, { useState } from 'react'; | |
import { | |
getStorybookUI, | |
configure, | |
addDecorator, | |
} from '@storybook/react-native'; | |
import ThemeProvider from '../theme/ThemeProvider'; | |
import './stories/Split.stories.tsx'; | |
import { themesAsObject } from '../test-utils/testAllThemes'; | |
import { View } from 'react-native'; | |
const ThemeProviderWithButtons = ({ children }) => { | |
const [themeKey, setThemeKey] = useState('banijay'); | |
const theme = themesAsObject[themeKey]; | |
return <ThemeProvider customTheme={theme}>{children}</ThemeProvider>; | |
}; | |
addDecorator(storyFn => { | |
return ( | |
<> | |
<View style={{ height: 20 }}></View> | |
<ThemeProvider>{storyFn()}</ThemeProvider> | |
</> | |
); | |
}); | |
// import stories | |
configure(() => {}, module); | |
// Refer to https://github.com/storybookjs/storybook/tree/master/app/react-native#start-command-parameters | |
// To find allowed options for getStorybookUI | |
const StorybookUIRoot = getStorybookUI({}); | |
export default StorybookUIRoot; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment