/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import { StyleSheet } from 'react-native';
import { storiesOf } from '@storybook/react-native';
import Avatar from '../../app/containers/Avatar/Avatar';
import Status from '../../app/containers/Status/Status';
import sharedStyles from '../../app/views/Styles';
const styles = StyleSheet.create({
custom: {
padding: 16
}
});
const server = 'https://open.rocket.chat';
const _theme = 'light';
const stories = storiesOf('Avatar', module);
stories.add('Avatar by text', () => (
<Avatar
text='Avatar'
server={server}
size={56}
/>
));
stories.add('Avatar by roomId', () => (
type='p'
rid='devWBbYr7inwupPqK'
stories.add('Avatar by url', () => (
avatar='https://user-images.githubusercontent.com/29778115/89444446-14738480-d728-11ea-9412-75fd978d95fb.jpg'
stories.add('Avatar by path', () => (
avatar='/avatar/diego.mello'
stories.add('With ETag', () => (
type='d'
text='djorkaeff.alexandre'
avatarETag='5ag8KffJcZj9m5rCv'
stories.add('Without ETag', () => (
stories.add('Emoji', () => (
emoji='troll'
getCustomEmoji={() => ({ name: 'troll', extension: 'jpg' })}
stories.add('Direct', () => (
text='diego.mello'
stories.add('Channel', () => (
text='general'
type='c'
stories.add('Touchable', () => (
onPress={() => console.log('Pressed!')}
stories.add('Static', () => (
isStatic
stories.add('Custom borderRadius', () => (
borderRadius={28}
stories.add('Children', () => (
>
<Status
size={24}
style={[sharedStyles.status, styles.status]}
theme={_theme}
</Avatar>
stories.add('Wrong server', () => (
server='https://google.com'
stories.add('Custom style', () => (
style={styles.custom}