2019-03-29 19:36:07 +00:00
|
|
|
import React from 'react';
|
2022-08-19 19:53:40 +00:00
|
|
|
import { Dimensions } from 'react-native';
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
import { longText } from '../../../.storybook/utils';
|
|
|
|
import { DisplayMode } from '../../lib/constants';
|
|
|
|
import RoomItemComponent from './RoomItem';
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2019-07-04 16:15:30 +00:00
|
|
|
const { width } = Dimensions.get('window');
|
2021-04-19 16:57:19 +00:00
|
|
|
const _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
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
const RoomItem = (props: any) => (
|
2019-03-29 19:36:07 +00:00
|
|
|
<RoomItemComponent
|
|
|
|
type='d'
|
|
|
|
name='rocket.cat'
|
2020-07-31 17:06:22 +00:00
|
|
|
avatar='rocket.cat'
|
2019-07-04 16:15:30 +00:00
|
|
|
width={width}
|
2019-12-04 16:39:53 +00:00
|
|
|
theme={_theme}
|
2021-10-06 20:30:10 +00:00
|
|
|
showAvatar
|
2022-01-11 14:47:23 +00:00
|
|
|
displayMode={DisplayMode.Expanded}
|
2020-07-31 17:06:22 +00:00
|
|
|
{...updatedAt}
|
2019-03-29 19:36:07 +00:00
|
|
|
{...props}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export default {
|
|
|
|
title: 'RoomItem'
|
|
|
|
};
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const Basic = () => <RoomItem />;
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const Touch = () => <RoomItem onPress={() => alert('on press')} onLongPress={() => alert('on long press')} />;
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const User = () => (
|
2021-04-19 16:57:19 +00:00
|
|
|
<>
|
|
|
|
<RoomItem name='diego.mello' avatar='diego.mello' />
|
2021-09-13 20:41:05 +00:00
|
|
|
<RoomItem name={longText} />
|
2021-04-19 16:57:19 +00:00
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2019-03-29 19:36:07 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const Type = () => (
|
2021-04-19 16:57:19 +00:00
|
|
|
<>
|
|
|
|
<RoomItem type='d' />
|
|
|
|
<RoomItem type='c' />
|
|
|
|
<RoomItem type='p' />
|
|
|
|
<RoomItem type='l' />
|
|
|
|
<RoomItem type='discussion' />
|
|
|
|
<RoomItem type='d' isGroupChat />
|
|
|
|
<RoomItem type='&' />
|
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2019-12-04 16:39:53 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const UserStatus = () => (
|
2021-04-19 16:57:19 +00:00
|
|
|
<>
|
|
|
|
<RoomItem status='online' />
|
|
|
|
<RoomItem status='away' />
|
|
|
|
<RoomItem status='busy' />
|
|
|
|
<RoomItem status='offline' />
|
|
|
|
<RoomItem status='loading' />
|
2023-02-14 13:47:56 +00:00
|
|
|
<RoomItem status='disabled' />
|
2021-04-19 16:57:19 +00:00
|
|
|
<RoomItem status='wrong' />
|
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2021-04-19 16:57:19 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const Alerts = () => (
|
2021-04-19 16:57:19 +00:00
|
|
|
<>
|
|
|
|
<RoomItem alert />
|
|
|
|
<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} />
|
|
|
|
<RoomItem alert name='thread unread' tunread={[1]} />
|
|
|
|
<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]} />
|
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2021-04-19 16:57:19 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const Tag = () => (
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
<>
|
|
|
|
<RoomItem autoJoin />
|
|
|
|
<RoomItem showLastMessage autoJoin />
|
|
|
|
<RoomItem name={longText} autoJoin />
|
|
|
|
<RoomItem name={longText} autoJoin showLastMessage />
|
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const LastMessage = () => (
|
2021-04-19 16:57:19 +00:00
|
|
|
<>
|
2021-09-13 20:41:05 +00:00
|
|
|
<RoomItem showLastMessage />
|
2021-04-19 16:57:19 +00:00
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
lastMessage={{
|
|
|
|
u: {
|
|
|
|
username: 'rocket.chat'
|
|
|
|
},
|
|
|
|
msg: '2'
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
lastMessage={{
|
|
|
|
u: {
|
|
|
|
username: 'diego.mello'
|
|
|
|
},
|
|
|
|
msg: '1'
|
|
|
|
}}
|
|
|
|
username='diego.mello'
|
|
|
|
/>
|
2021-09-13 20:41:05 +00:00
|
|
|
<RoomItem showLastMessage lastMessage={lastMessage} />
|
|
|
|
<RoomItem showLastMessage alert unread={1} lastMessage={lastMessage} />
|
|
|
|
<RoomItem showLastMessage alert unread={1000} lastMessage={lastMessage} />
|
|
|
|
<RoomItem showLastMessage alert tunread={[1]} lastMessage={lastMessage} />
|
2021-04-19 16:57:19 +00:00
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2021-10-06 20:30:10 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const CondensedRoomItem = () => (
|
2021-10-06 20:30:10 +00:00
|
|
|
<>
|
2022-01-11 14:47:23 +00:00
|
|
|
<RoomItem showLastMessage alert tunread={[1]} lastMessage={lastMessage} displayMode={DisplayMode.Condensed} />
|
|
|
|
<RoomItem showLastMessage alert name='unread' unread={1000} displayMode={DisplayMode.Condensed} />
|
2021-10-06 20:30:10 +00:00
|
|
|
|
2022-01-11 14:47:23 +00:00
|
|
|
<RoomItem type='c' displayMode={DisplayMode.Condensed} autoJoin />
|
2021-10-06 20:30:10 +00:00
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2021-10-06 20:30:10 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const CondensedRoomItemWithoutAvatar = () => (
|
2021-10-06 20:30:10 +00:00
|
|
|
<>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
tunread={[1]}
|
|
|
|
lastMessage={lastMessage}
|
2022-01-11 14:47:23 +00:00
|
|
|
displayMode={DisplayMode.Condensed}
|
2021-10-06 20:30:10 +00:00
|
|
|
showAvatar={false}
|
|
|
|
/>
|
2022-01-11 14:47:23 +00:00
|
|
|
<RoomItem type='p' displayMode={DisplayMode.Condensed} showAvatar={false} />
|
|
|
|
<RoomItem name={longText} autoJoin displayMode={DisplayMode.Condensed} showAvatar={false} />
|
2021-10-06 20:30:10 +00:00
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2021-10-06 20:30:10 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const ExpandedRoomItemWithoutAvatar = () => (
|
2021-10-06 20:30:10 +00:00
|
|
|
<>
|
|
|
|
<RoomItem
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
tunread={[1]}
|
|
|
|
lastMessage={lastMessage}
|
2022-01-11 14:47:23 +00:00
|
|
|
displayMode={DisplayMode.Expanded}
|
2021-10-06 20:30:10 +00:00
|
|
|
showAvatar={false}
|
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
status='online'
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
tunread={[1]}
|
|
|
|
lastMessage={lastMessage}
|
2022-01-11 14:47:23 +00:00
|
|
|
displayMode={DisplayMode.Expanded}
|
2021-10-06 20:30:10 +00:00
|
|
|
showAvatar={false}
|
|
|
|
/>
|
|
|
|
<RoomItem
|
|
|
|
status='online'
|
|
|
|
showLastMessage
|
|
|
|
alert
|
|
|
|
lastMessage={lastMessage}
|
2022-01-11 14:47:23 +00:00
|
|
|
displayMode={DisplayMode.Expanded}
|
2021-10-06 20:30:10 +00:00
|
|
|
showAvatar={false}
|
|
|
|
/>
|
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2022-04-15 02:27:36 +00:00
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export const OmnichannelIcon = () => (
|
2022-04-15 02:27:36 +00:00
|
|
|
<>
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'widget' }} status='online' />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'widget' }} status='away' />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'widget' }} status='loading' />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'widget' }} />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'email' }} status='online' />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'email' }} />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'sms' }} status='online' />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'sms' }} />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'other' }} status='online' />
|
|
|
|
<RoomItem type='l' sourceType={{ type: 'other' }} />
|
|
|
|
</>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|