/* 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';
import { storiesOf } from '@storybook/react-native';
import RoomItem from './RoomItem';
import './List';
import './ServerItem';
import Message from './Message';
import UiKitMessage from './UiKitMessage';
import UiKitModal from './UiKitModal';
import Markdown from './Markdown';
import './HeaderButtons';
import './UnreadBadge';
import '../../app/views/ThreadMessagesView/Item.stories.js';
import Avatar from './Avatar';
// import RoomViewHeader from './RoomViewHeader';
import MessageContext from '../../app/containers/message/Context';
import { themes } from '../../app/constants/colors';
// MessageProvider
const baseUrl = 'https://open.rocket.chat';
const user = {
id: '',
username: 'diego.mello',
token: ''
};
// Change here to see themed storybook
const theme = 'light';
const reducers = combineReducers({
settings: () => ({}),
login: () => ({
user: {
username: 'diego.mello'
}
}),
server: () => ({
server: 'https://open.rocket.chat',
version: '3.7.0'
}),
share: () => ({
server: 'https://open.rocket.chat',
version: '3.7.0',
settings: {}
}),
meteor: () => ({ connected: true }),
activeUsers: () => ({ abc: { status: 'online', statusText: 'dog' } })
});
const store = createStore(reducers);
const messageDecorator = story => (
{},
onLongPress: () => {},
reactionInit: () => {},
onErrorPress: () => {},
replyBroadcast: () => {},
onReactionPress: () => {},
onDiscussionPress: () => {},
onReactionLongPress: () => {},
threadBadgeColor: themes.light.tunreadColor
}}
>
{story()}
);
storiesOf('RoomItem', module)
.addDecorator(story => {story()})
.add('list roomitem', () => );
storiesOf('Message', module)
.addDecorator(story => {story()})
.addDecorator(messageDecorator)
.add('list message', () => );
storiesOf('UiKitMessage', module)
.addDecorator(messageDecorator)
.add('list uikitmessage', () => );
storiesOf('UiKitModal', module)
.addDecorator(messageDecorator)
.add('list UiKitModal', () => );
storiesOf('Markdown', module)
.add('list Markdown', () => );
storiesOf('Avatar', module)
.add('list Avatar', () => );
// FIXME: I couldn't make these pass on jest :(
// storiesOf('RoomViewHeader', module)
// .add('list', () => );