Rocket.Chat.ReactNative/storybook/stories/index.js

34 lines
1.0 KiB
JavaScript
Raw Normal View History

2017-08-17 19:31:27 +00:00
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
import React from 'react';
import { Provider } from 'react-redux';
import { createStore, combineReducers } from 'redux';
2017-08-17 19:31:27 +00:00
import { storiesOf } from '@storybook/react-native';
2019-03-29 19:36:07 +00:00
import RoomItem from './RoomItem';
import Avatar from './Avatar';
import Message from './Message';
2019-04-08 12:35:28 +00:00
// import RoomViewHeader from './RoomViewHeader';
2017-08-17 19:31:27 +00:00
2019-03-29 19:36:07 +00:00
const reducers = combineReducers({
settings: () => ({}),
login: () => ({
user: {
username: 'diego.mello'
}
}),
meteor: () => ({ connected: true })
});
const store = createStore(reducers);
2019-03-29 19:36:07 +00:00
storiesOf('Avatar', module)
.addDecorator(story => <Provider store={store}>{story()}</Provider>)
.add('avatar', () => Avatar);
storiesOf('RoomItem', module)
.addDecorator(story => <Provider store={store}>{story()}</Provider>)
.add('list', () => RoomItem);
storiesOf('Message', module)
.add('list', () => Message);
2019-04-08 12:35:28 +00:00
// FIXME: I couldn't make these pass on jest :(
// storiesOf('RoomViewHeader', module)
// .add('list', () => RoomViewHeader);