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 = {
|
2020-12-04 19:25:51 +00:00
|
|
|
date: '10:00'
|
2020-07-31 17:06:22 +00:00
|
|
|
};
|
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' />
|
2021-03-31 17:47:17 +00:00
|
|
|
<RoomItem status='loading' />
|
2020-07-31 17:06:22 +00:00
|
|
|
<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='group mentions' unread={1} groupMentions={1} />
|
2020-10-30 16:15:58 +00:00
|
|
|
<RoomItem alert name='thread unread' tunread={[1]} />
|
2020-10-30 17:35:07 +00:00
|
|
|
<RoomItem alert name='thread unread user' tunread={[1]} tunreadUser={[1]} />
|
|
|
|
<RoomItem alert name='thread unread group' tunread={[1]} tunreadGroup={[1]} />
|
|
|
|
<RoomItem name='user mentions priority 1' alert unread={1} userMentions={1} groupMentions={1} tunread={[1]} />
|
|
|
|
<RoomItem name='group mentions priority 2' alert unread={1} groupMentions={1} tunread={[1]} />
|
|
|
|
<RoomItem name='thread unread priority 3' alert unread={1} tunread={[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
|
2020-10-30 17:35:07 +00:00
|
|
|
tunread={[1]}
|
2020-07-31 17:06:22 +00:00
|
|
|
lastMessage={lastMessage}
|
2019-12-04 16:39:53 +00:00
|
|
|
/>
|
|
|
|
</ScrollView>
|
|
|
|
);
|
|
|
|
};
|