2019-03-29 19:36:07 +00:00
|
|
|
import React from 'react';
|
2019-07-04 16:15:30 +00:00
|
|
|
import { ScrollView, Dimensions } from 'react-native';
|
2019-03-29 19:36:07 +00:00
|
|
|
// import moment from 'moment';
|
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
import { themes } from '../../app/constants/colors';
|
2020-07-31 17:06:22 +00:00
|
|
|
import RoomItemComponent from '../../app/presentation/RoomItem/RoomItem';
|
2020-10-30 13:59:44 +00:00
|
|
|
import { longText } from '../utils';
|
2019-03-29 19:36:07 +00:00
|
|
|
import StoriesSeparator from './StoriesSeparator';
|
|
|
|
|
|
|
|
const baseUrl = 'https://open.rocket.chat';
|
2019-07-04 16:15:30 +00:00
|
|
|
const { width } = Dimensions.get('window');
|
2019-12-04 16:39:53 +00:00
|
|
|
let _theme = 'light';
|
2020-07-31 17:06:22 +00:00
|
|
|
const lastMessage = {
|
|
|
|
u: {
|
|
|
|
username: 'diego.mello'
|
|
|
|
},
|
|
|
|
msg: longText
|
|
|
|
};
|
|
|
|
const updatedAt = {
|
|
|
|
date: '10:00',
|
|
|
|
roomUpdatedAt: new Date('2020-01-01')
|
|
|
|
};
|
2019-03-29 19:36:07 +00:00
|
|
|
|
|
|
|
const RoomItem = props => (
|
|
|
|
<RoomItemComponent
|
2020-07-31 17:06:22 +00:00
|
|
|
rid='abc'
|
2019-03-29 19:36:07 +00:00
|
|
|
type='d'
|
|
|
|
name='rocket.cat'
|
2020-07-31 17:06:22 +00:00
|
|
|
avatar='rocket.cat'
|
2019-03-29 19:36:07 +00:00
|
|
|
baseUrl={baseUrl}
|
2019-07-04 16:15:30 +00:00
|
|
|
width={width}
|
2019-12-04 16:39:53 +00:00
|
|
|
theme={_theme}
|
2020-07-31 17:06:22 +00:00
|
|
|
{...updatedAt}
|
2019-03-29 19:36:07 +00:00
|
|
|
{...props}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
// eslint-disable-next-line react/prop-types
|
|
|
|
const Separator = ({ title }) => <StoriesSeparator title={title} theme={_theme} />;
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
// eslint-disable-next-line react/prop-types
|
|
|
|
export default ({ theme }) => {
|
|
|
|
_theme = theme;
|
|
|
|
return (
|
|
|
|
<ScrollView style={{ backgroundColor: themes[theme].auxiliaryBackground }}>
|
|
|
|
<Separator title='Basic' />
|
|
|
|
<RoomItem />
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
<Separator title='User' />
|
2020-07-31 17:06:22 +00:00
|
|
|
<RoomItem name='diego.mello' avatar='diego.mello' />
|
2019-12-04 16:39:53 +00:00
|
|
|
<RoomItem
|
2020-07-31 17:06:22 +00:00
|
|
|
name={longText}
|
2019-12-04 16:39:53 +00:00
|
|
|
/>
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
<Separator title='Type' />
|
|
|
|
<RoomItem type='d' />
|
|
|
|
<RoomItem type='c' />
|
|
|
|
<RoomItem type='p' />
|
|
|
|
<RoomItem type='l' />
|
2020-07-31 17:06:22 +00:00
|
|
|
<RoomItem type='discussion' />
|
|
|
|
<RoomItem type='d' isGroupChat />
|
2019-12-04 16:39:53 +00:00
|
|
|
<RoomItem type='&' />
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2020-07-31 17:06:22 +00:00
|
|
|
<Separator title='User status' />
|
|
|
|
<RoomItem status='online' />
|
|
|
|
<RoomItem status='away' />
|
|
|
|
<RoomItem status='busy' />
|
|
|
|
<RoomItem status='offline' />
|
|
|
|
<RoomItem status='wrong' />
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
<Separator title='Alerts' />
|
|
|
|
<RoomItem alert />
|
2020-07-31 17:06:22 +00:00
|
|
|
<RoomItem alert name='unread' unread={1} />
|
|
|
|
<RoomItem alert name='unread' unread={1000} />
|
|
|
|
<RoomItem alert name='user mentions' unread={1} userMentions={1} />
|
|
|
|
<RoomItem alert name='user mentions' unread={1000} userMentions={1} />
|
|
|
|
<RoomItem alert name='group mentions' unread={1} groupMentions={1} />
|
|
|
|
<RoomItem alert name='group mentions' unread={1000} groupMentions={1} />
|
|
|
|
<RoomItem name='user mentions > group mentions' alert unread={1000} userMentions={1} groupMentions={1} />
|
2019-12-04 16:39:53 +00:00
|
|
|
|
|
|
|
<Separator title='Last Message' />
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
lastMessage={{
|
|
|
|
u: {
|
|
|
|
username: 'rocket.chat'
|
|
|
|
},
|
|
|
|
msg: '2'
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
lastMessage={{
|
|
|
|
u: {
|
|
|
|
username: 'diego.mello'
|
|
|
|
},
|
|
|
|
msg: '1'
|
|
|
|
}}
|
2020-07-31 17:06:22 +00:00
|
|
|
username='diego.mello'
|
2019-12-04 16:39:53 +00:00
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
2020-07-31 17:06:22 +00:00
|
|
|
lastMessage={lastMessage}
|
2019-12-04 16:39:53 +00:00
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
unread={1}
|
2020-07-31 17:06:22 +00:00
|
|
|
lastMessage={lastMessage}
|
2019-12-04 16:39:53 +00:00
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
unread={1000}
|
2020-07-31 17:06:22 +00:00
|
|
|
lastMessage={lastMessage}
|
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
unread={1000}
|
|
|
|
lastMessage={lastMessage}
|
2019-12-04 16:39:53 +00:00
|
|
|
/>
|
|
|
|
</ScrollView>
|
|
|
|
);
|
|
|
|
};
|