Skip to content

Commit

Permalink
Revert moving index.[ios|android].js.
Browse files Browse the repository at this point in the history
Reverting from 3e2673b -- this broke RN-storybook for `getstorybook` users.

See #1200
  • Loading branch information
tmeasday committed Jun 6, 2017
1 parent 77b68a5 commit 2a98396
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/ReactNativeVanilla/storybook/stories/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { Text } from 'react-native';

import { storiesOf } from '@storybook/react-native';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import Button from './Button';
import CenterView from './CenterView';
import Welcome from './Welcome';

storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);

storiesOf('Button', module)
.addDecorator(getStory => <CenterView>{getStory()}</CenterView>)
.add('with text', () => (
<Button onPress={action('clicked-text')}>
<Text>Hello Button</Text>
</Button>
))
.add('with some emoji', () => (
<Button onPress={action('clicked-emoji')}>
<Text>😀 😎 👍 💯</Text>
</Button>
));
11 changes: 11 additions & 0 deletions lib/cli/generators/REACT_NATIVE/template/storybook/index.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native';

// import stories
configure(() => {
require('./stories');
}, module);

const StorybookUI = getStorybookUI({ port: 7007, host: 'localhost' });
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUI);
export default StorybookUI;

0 comments on commit 2a98396

Please sign in to comment.