import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import { themes } from '../../app/constants/colors';
import Avatar from '../../app/containers/Avatar/Avatar';
import Status from '../../app/containers/Status/Status';
import StoriesSeparator from './StoriesSeparator';
import sharedStyles from '../../app/views/Styles';
const styles = StyleSheet.create({
custom: {
padding: 16
}
});
const server = 'https://open.rocket.chat';
const Separator = ({ title, theme }) => <StoriesSeparator title={title} theme={theme} />;
Separator.propTypes = {
title: PropTypes.string,
theme: PropTypes.string
};
const AvatarStories = ({ theme }) => (
<ScrollView style={{ backgroundColor: themes[theme].backgroundColor }}>
<Separator title='Avatar by text' theme={theme} />
<Avatar
text='Avatar'
server={server}
size={56}
/>
<Separator title='Avatar by roomId' theme={theme} />
type='p'
rid='devWBbYr7inwupPqK'
<Separator title='Avatar by url' theme={theme} />
avatar='https://user-images.githubusercontent.com/29778115/89444446-14738480-d728-11ea-9412-75fd978d95fb.jpg'
<Separator title='Avatar by path' theme={theme} />
avatar='/avatar/diego.mello'
<Separator title='With ETag' theme={theme} />
type='d'
text='djorkaeff.alexandre'
avatarETag='5ag8KffJcZj9m5rCv'
<Separator title='Without ETag' theme={theme} />
<Separator title='Emoji' theme={theme} />
emoji='troll'
getCustomEmoji={() => ({ name: 'troll', extension: 'jpg' })}
<Separator title='Direct' theme={theme} />
text='diego.mello'
<Separator title='Channel' theme={theme} />
text='general'
type='c'
<Separator title='Touchable' theme={theme} />
onPress={() => console.log('Pressed!')}
<Separator title='Static' theme={theme} />
isStatic
<Separator title='Custom borderRadius' theme={theme} />
borderRadius={28}
<Separator title='Children' theme={theme} />
>
<View style={[sharedStyles.status, { backgroundColor: themes[theme].backgroundColor }]}>
<Status
size={20}
status='online'
</View>
</Avatar>
<Separator title='Wrong server' theme={theme} />
server='https://google.com'
<Separator title='Custom style' theme={theme} />
style={styles.custom}
</ScrollView>
);
AvatarStories.propTypes = {
export default AvatarStories;