-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6448 from storybooks/react-native/typescript
Migrate app/react-native to typescript
- Loading branch information
Showing
30 changed files
with
457 additions
and
428 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Preview from './preview'; | ||
|
||
const preview = new Preview(); | ||
|
||
export const storiesOf = preview.api().storiesOf.bind(preview); | ||
export const setAddon = preview.api().setAddon.bind(preview); | ||
export const addDecorator = preview.api().addDecorator.bind(preview); | ||
export const addParameters = preview.api().addParameters.bind(preview); | ||
export const clearDecorators = preview.api().clearDecorators.bind(preview); | ||
export const configure = preview.configure; | ||
export const getStorybook = preview.api().getStorybook.bind(preview); | ||
export const getStorybookUI = preview.getStorybookUI; | ||
export const raw = preview.api().raw.bind(preview); |
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
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
37 changes: 0 additions & 37 deletions
37
app/react-native/src/preview/components/OnDeviceUI/addons/wrapper.js
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
app/react-native/src/preview/components/OnDeviceUI/addons/wrapper.tsx
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { PureComponent } from 'react'; | ||
import { View, ScrollView } from 'react-native'; | ||
import { Collection } from '@storybook/addons'; | ||
import style from '../style'; | ||
|
||
export interface Props { | ||
panels: Collection; | ||
addonSelected: string; | ||
} | ||
|
||
export default class Wrapper extends PureComponent<Props> { | ||
static defaultProps = { | ||
addonSelected: '', | ||
}; | ||
|
||
render() { | ||
const { panels, addonSelected } = this.props; | ||
|
||
const addonKeys = Object.keys(panels); | ||
|
||
return addonKeys.map(id => { | ||
const selected = addonSelected === id; | ||
|
||
return ( | ||
<View key={id} style={selected ? style.flex : style.invisible}> | ||
<ScrollView style={style.flex}> | ||
{panels[id].render({ active: selected, key: id })} | ||
</ScrollView> | ||
</View> | ||
); | ||
}); | ||
} | ||
} |
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.