/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions, react/prop-types */ import React from 'react'; import { storiesOf } from '@storybook/react-native'; import { ScrollView } from 'react-native'; import { combineReducers, createStore } from 'redux'; import { Provider } from 'react-redux'; import * as List from '../../containers/List'; import { themes } from '../../constants/colors'; import { ThemeContext } from '../../theme'; import Item from './Item'; const author = { _id: 'userid', username: 'rocket.cat', name: 'Rocket Cat' }; const baseUrl = 'https://open.rocket.chat'; const date = new Date(2020, 10, 10, 10); const longText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; const defaultItem = { msg: 'Message content', tcount: 1, replies: [1], ts: date, tlm: date, u: author, attachments: [] }; const BaseItem = ({ item, ...props }) => ( alert('pressed')} {...props} /> ); const listDecorator = story => ( {story()} ); const reducers = combineReducers({ login: () => ({ user: { id: 'abc', username: 'rocket.cat', name: 'Rocket Cat' } }), server: () => ({ server: 'https://open.rocket.chat', version: '3.7.0' }), share: () => ({ server: 'https://open.rocket.chat', version: '3.7.0' }), settings: () => ({ blockUnauthenticatedAccess: false }) }); const store = createStore(reducers); const stories = storiesOf('Thread Messages.Item', module) .addDecorator(listDecorator) .addDecorator(story => {story()}); stories.add('content', () => ( <> )); stories.add('badge', () => ( <> )); const ThemeStory = ({ theme }) => ( ); stories.add('themes', () => ( <> ));