verdnatura-chat/storybook/stories/Message.js

755 lines
17 KiB
JavaScript
Raw Normal View History

import React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
2019-04-08 12:35:28 +00:00
// import moment from 'moment';
import MessageComponent from '../../app/containers/message/Message';
import StoriesSeparator from './StoriesSeparator';
import messagesStatus from '../../app/constants/messagesStatus';
import MessageSeparator from '../../app/views/RoomView/Separator';
const styles = StyleSheet.create({
separator: {
2019-03-27 20:06:57 +00:00
marginTop: 30,
marginBottom: 0
}
});
const user = {
id: 'y8bd77ptZswPj3EW8',
username: 'diego.mello',
token: '79q6lH40W4ZRGLOshDiDiVlQaCc4f_lU9HNdHLAzuHz'
};
const author = {
_id: 'userid',
username: 'diego.mello'
};
const baseUrl = 'https://open.rocket.chat';
const date = new Date(2017, 10, 10, 10);
2019-04-17 17:01:03 +00:00
const longText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
const getCustomEmoji = (content) => {
const customEmoji = {
marioparty: { name: content, extension: 'gif' },
react_rocket: { name: content, extension: 'png' },
nyan_rocket: { name: content, extension: 'png' }
}[content];
return customEmoji;
};
const Message = props => (
<MessageComponent
baseUrl={baseUrl}
user={user}
author={author}
ts={date}
timeFormat='LT'
isHeader
getCustomEmoji={getCustomEmoji}
{...props}
/>
);
// eslint-disable-next-line react/prop-types
const Separator = ({ title }) => <StoriesSeparator title={title} style={styles.separator} />;
export default (
2019-03-27 20:06:57 +00:00
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ marginVertical: 30 }}>
<Separator title='Simple' />
2019-03-27 20:06:57 +00:00
<Message msg='Message' />
<Separator title='Long message' />
2019-04-17 17:01:03 +00:00
<Message msg={longText} />
2019-03-27 20:06:57 +00:00
<Separator title='Grouped messages' />
<Message msg='...' />
<Message
msg='Different user'
author={{
...author,
2019-04-17 17:01:03 +00:00
username: longText
}}
/>
<Message msg='This is the third message' isHeader={false} />
<Message msg='This is the second message' isHeader={false} />
<Message msg='This is the first message' />
<Separator title='Without header' />
<Message msg='Message' isHeader={false} />
<Separator title='With alias' />
2019-03-27 20:06:57 +00:00
<Message msg='Message' alias='Diego Mello' />
2019-03-29 19:36:07 +00:00
<Message
msg='Message'
author={{
...author,
2019-04-17 17:01:03 +00:00
username: longText
2019-03-29 19:36:07 +00:00
}}
alias='Diego Mello'
/>
<Separator title='Edited' />
2019-03-27 20:06:57 +00:00
<Message msg='Message' edited />
2019-03-27 20:06:57 +00:00
<Separator title='Static avatar' />
<Message
msg='Message'
avatar='https://pbs.twimg.com/profile_images/1016397063649660929/14EIApTi_400x400.jpg'
/>
2019-03-27 20:06:57 +00:00
<Separator title='Full name' />
<Message
msg='Message'
author={{
...author,
username: 'diego.mello',
name: 'Diego Mello'
}}
useRealName
/>
<Separator title='Mentions' />
<Message
msg='@rocket.cat @diego.mello @all @here #general'
mentions={[{
username: 'rocket.cat'
}, {
username: 'diego.mello'
}, {
username: 'all'
}, {
username: 'here'
}]}
channels={[{
name: 'general'
}]}
/>
<Separator title='Emojis' />
2019-03-27 20:06:57 +00:00
<Message msg='👊🤙👏' />
[RELEASE] Merge beta into master (#1055) * Bump version to 1.16.0 (#1014) * [IMPROVEMENT] Share credentials with Rocket.Chat.iOS (#982) * :sparkles: Create user table * :sparkles: Introduce user table * :fire: Remove unused table * :heavy_plus_sign: Add userdefaults to storage data * :green_heart: Fix android build * :sparkles: Get credentials from iOS native client * :fire: Remove unused code * :rewind: Revert sign xcode * :bug: Fix first login-logout * :art: Use constants to UserDefaults Keys * :bug: Fix clear server-user-info on logout * :bug: Fix filter null value * :ambulance: Remove user object in logout * :sparkles: Fix get servers from native-client * :ambulance: Fix error on change server * [FIX] Don't run UserDefaults credentials on Android (#1015) * :bug: Fix native credentials (android) * Fix migration loop * [IMPROVEMENT] Hide frequently used emoji tab when empty (#792) * [IMPROVEMENT] Bigger emoji in emoji only messages (#793) * issue #725: bigger emoji in emoji only message * issue-725/add storybook for Message/Emoji * issue-725: update storybook/Message jest snapshot * comment storybook import * allow spaces and line breaks in emoji only message * merge develop * revert unnecessary spacing * [FIX] Empty message if contains only a link (#787) * Fix empty message if contains only a link * :bug: Fix empty space * [IMPROVEMENT] Refactor empty space regex on quote (#1017) * :art: Improve regex to empty space on quote * :art: Improve on regex to empty space on quote * [NEW] Custom fields on signup (#1013) * added custom feilds on registration * added flag as leftIcon and removed lable * added try and catch * typo * [CHORE] Renew provisioning profiles (#1020) * [NEW] Auto-translate (#1012) * Update realm * View original and translate working * Read AutoTranslate_Enabled setting * RocketChat.canAutoTranslate() * AutoTranslateView * Save language * Auto-translate switch * Translate message * [IMPROVEMENT] Use haptics rather than vibration (#1016) * Install expo-haptics * Use expo-haptics rather than RN's Vibration module * [IMPROVEMENT] Use Rest API for file upload (#1005) * removed rn-fetch-blob and use native XMLHttpRequest instead * removed unnessary changes * fix android bug * fix android bug * added tmid support * fix bug * fixed isssue with cacel model * fix problems with audio * done requested changes * fix bug with android * [CHORE] [CI] [TESTS] update detox to make ci pass (#1026) * feat: update detox to 12.11.3 to make CI pass * ci: comment all jobs but leave e2e-test job * commit to rerun IC e2e-test job * ci: uncomment all CI jobs * [NEW] Room swipe actions: mark as read/unread, hide, fav (#976) * added unread and fav feature * changed the layout * fix jest * done requested changes * added requested changes * [FIX] Android build (#1027) * [FIX] Android build * CircleCI error * [FIX] iOS share credentials build (#1028) * [FIX] iOS share credentials build * Use `hasMigration` as a string * [CI] Restore cache on CI (#1029) * feat: add fastlane save\restore cache config; comment not needed jobs; * install fastlane using 'bundle install' * install fastlane using 'sudo bundle install' * uncomment ios build commands * run set up google services in ios folder * add working_directory: ios to ios-build steps * remove 'cd ios' from Fastlane build step * add save\restore cache for npm modules * group save_cache steps * cache fastlane in ios-testflight job * uncomment previously commented jobs\steps * fix: add missing colon * use key for caching: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} * add names for save\restore steps * ci: add `default` step with `working_directory: ~/repo` to ios-build job * return back caching npm: `node-v1-{{ checksum "package.json" }}-{{ arch }}` * fix: add missing curly braces * save\restore cache in e2e-test job; remove {{arch}} from cache names * add names to restore_cache steps in android-build job * add names to save_cache steps in android-build job * add names to all save\restore steps; change checksum package.json to yarn.lock * change `npm` to `NPM` in steps naming * remove {{ checksum circle ci }} from android-build job and fix naming of steps * [FIX] Rooms swipes (#1034) * Regression: on press style feedback * Action button styles * Fix animations * Styles changed * Update subscription without having to wait for socket * Calculate width on RoomsListView instead * [FIX] Decrease bigger emoji size to 30 (#1031) * [FIX] Append server URL on avatar if necessary (#1038) * Comment removeClippedSubviews * Comment width animation * Remove redux from RoomItem * Fix wrong re-render comparison * Remove listener * Raise minDeltaX * memo actions * Spring with native driver * Refactor functions * Fix props issues * Remove RoomItem.height * Long swipe * Refactor animations * this.rowTranslation -> this.transX * Moved state to this * Bump version to 1.16.1 (#1045) * [FIX] Set UserDefaults AppGroup on notification tap (#1047) * [FIX] Auto-translate messages as they arrive * Fix favorite button
2019-07-15 17:24:48 +00:00
<Separator title='Single Emoji' />
<Message msg='👏' />
<Separator title='Custom Emojis' />
2019-03-27 20:06:57 +00:00
<Message msg=':react_rocket: :nyan_rocket: :marioparty:' />
[RELEASE] Merge beta into master (#1055) * Bump version to 1.16.0 (#1014) * [IMPROVEMENT] Share credentials with Rocket.Chat.iOS (#982) * :sparkles: Create user table * :sparkles: Introduce user table * :fire: Remove unused table * :heavy_plus_sign: Add userdefaults to storage data * :green_heart: Fix android build * :sparkles: Get credentials from iOS native client * :fire: Remove unused code * :rewind: Revert sign xcode * :bug: Fix first login-logout * :art: Use constants to UserDefaults Keys * :bug: Fix clear server-user-info on logout * :bug: Fix filter null value * :ambulance: Remove user object in logout * :sparkles: Fix get servers from native-client * :ambulance: Fix error on change server * [FIX] Don't run UserDefaults credentials on Android (#1015) * :bug: Fix native credentials (android) * Fix migration loop * [IMPROVEMENT] Hide frequently used emoji tab when empty (#792) * [IMPROVEMENT] Bigger emoji in emoji only messages (#793) * issue #725: bigger emoji in emoji only message * issue-725/add storybook for Message/Emoji * issue-725: update storybook/Message jest snapshot * comment storybook import * allow spaces and line breaks in emoji only message * merge develop * revert unnecessary spacing * [FIX] Empty message if contains only a link (#787) * Fix empty message if contains only a link * :bug: Fix empty space * [IMPROVEMENT] Refactor empty space regex on quote (#1017) * :art: Improve regex to empty space on quote * :art: Improve on regex to empty space on quote * [NEW] Custom fields on signup (#1013) * added custom feilds on registration * added flag as leftIcon and removed lable * added try and catch * typo * [CHORE] Renew provisioning profiles (#1020) * [NEW] Auto-translate (#1012) * Update realm * View original and translate working * Read AutoTranslate_Enabled setting * RocketChat.canAutoTranslate() * AutoTranslateView * Save language * Auto-translate switch * Translate message * [IMPROVEMENT] Use haptics rather than vibration (#1016) * Install expo-haptics * Use expo-haptics rather than RN's Vibration module * [IMPROVEMENT] Use Rest API for file upload (#1005) * removed rn-fetch-blob and use native XMLHttpRequest instead * removed unnessary changes * fix android bug * fix android bug * added tmid support * fix bug * fixed isssue with cacel model * fix problems with audio * done requested changes * fix bug with android * [CHORE] [CI] [TESTS] update detox to make ci pass (#1026) * feat: update detox to 12.11.3 to make CI pass * ci: comment all jobs but leave e2e-test job * commit to rerun IC e2e-test job * ci: uncomment all CI jobs * [NEW] Room swipe actions: mark as read/unread, hide, fav (#976) * added unread and fav feature * changed the layout * fix jest * done requested changes * added requested changes * [FIX] Android build (#1027) * [FIX] Android build * CircleCI error * [FIX] iOS share credentials build (#1028) * [FIX] iOS share credentials build * Use `hasMigration` as a string * [CI] Restore cache on CI (#1029) * feat: add fastlane save\restore cache config; comment not needed jobs; * install fastlane using 'bundle install' * install fastlane using 'sudo bundle install' * uncomment ios build commands * run set up google services in ios folder * add working_directory: ios to ios-build steps * remove 'cd ios' from Fastlane build step * add save\restore cache for npm modules * group save_cache steps * cache fastlane in ios-testflight job * uncomment previously commented jobs\steps * fix: add missing colon * use key for caching: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }} * add names for save\restore steps * ci: add `default` step with `working_directory: ~/repo` to ios-build job * return back caching npm: `node-v1-{{ checksum "package.json" }}-{{ arch }}` * fix: add missing curly braces * save\restore cache in e2e-test job; remove {{arch}} from cache names * add names to restore_cache steps in android-build job * add names to save_cache steps in android-build job * add names to all save\restore steps; change checksum package.json to yarn.lock * change `npm` to `NPM` in steps naming * remove {{ checksum circle ci }} from android-build job and fix naming of steps * [FIX] Rooms swipes (#1034) * Regression: on press style feedback * Action button styles * Fix animations * Styles changed * Update subscription without having to wait for socket * Calculate width on RoomsListView instead * [FIX] Decrease bigger emoji size to 30 (#1031) * [FIX] Append server URL on avatar if necessary (#1038) * Comment removeClippedSubviews * Comment width animation * Remove redux from RoomItem * Fix wrong re-render comparison * Remove listener * Raise minDeltaX * memo actions * Spring with native driver * Refactor functions * Fix props issues * Remove RoomItem.height * Long swipe * Refactor animations * this.rowTranslation -> this.transX * Moved state to this * Bump version to 1.16.1 (#1045) * [FIX] Set UserDefaults AppGroup on notification tap (#1047) * [FIX] Auto-translate messages as they arrive * Fix favorite button
2019-07-15 17:24:48 +00:00
<Separator title='Single Custom Emojis' />
<Message msg=':react_rocket:' />
<Separator title='Normal Emoji + Custom Emojis' />
<Message msg='🤙:react_rocket:' />
<Separator title='Four emoji' />
<Message msg='🤙:react_rocket:🤙🤙' />
<Separator title='Time format' />
2019-03-27 20:06:57 +00:00
<Message msg='Testing' timeFormat='DD MMMM YYYY' />
2019-03-27 20:06:57 +00:00
<Separator title='Reactions' />
<Message
msg='Reactions'
reactions={[{
emoji: ':joy:',
usernames: [{ value: 'username' }, { value: 'rocket.cat' }, { value: 'diego.mello' }]
}, {
emoji: ':marioparty:',
usernames: [{ value: 'username' }, { value: 'rocket.cat' }, { value: 'diego.mello' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }, { value: 'user1' }]
}, {
emoji: ':thinking:',
usernames: [{ value: 'username' }]
}]}
onReactionPress={() => {}}
/>
2019-03-27 20:06:57 +00:00
<Separator title='Multiple reactions' />
<Message
msg='Multiple Reactions'
reactions={[{
emoji: ':marioparty:',
usernames: [{ value: 'username' }]
}, {
emoji: ':react_rocket:',
usernames: [{ value: 'username' }]
}, {
emoji: ':nyan_rocket:',
usernames: [{ value: 'username' }]
}, {
emoji: ':heart:',
usernames: [{ value: 'username' }]
}, {
emoji: ':dog:',
usernames: [{ value: 'username' }]
}, {
emoji: ':grinning:',
usernames: [{ value: 'username' }]
}, {
emoji: ':grimacing:',
usernames: [{ value: 'username' }]
}, {
emoji: ':grin:',
usernames: [{ value: 'username' }]
}]}
onReactionPress={() => {}}
/>
2019-03-27 20:06:57 +00:00
<Separator title='Intercalated users' />
<Message
msg='Fourth message'
author={{
...author,
username: 'rocket.cat'
}}
/>
<Message msg='Third message' />
<Message
msg='Second message'
author={{
...author,
username: 'rocket.cat'
}}
/>
<Message msg='First message' />
2019-03-27 20:06:57 +00:00
<Separator title='Date and Unread separators' />
<Message
msg='Fourth message'
author={{
...author,
username: 'rocket.cat'
}}
/>
<MessageSeparator ts={date} unread />
<Message msg='Third message' />
<MessageSeparator unread />
<Message
msg='Second message'
author={{
...author,
username: 'rocket.cat'
}}
isHeader={false}
/>
<Message
msg='Second message'
author={{
...author,
username: 'rocket.cat'
}}
/>
<MessageSeparator ts={date} />
<Message msg='First message' />
2019-03-27 20:06:57 +00:00
<Separator title='With image' />
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description',
image_url: '/file-upload/2ZrxuwcGeTrsoh376/Clipboard%20-%20September%205,%202018%204:10%20PM'
}]}
/>
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
image_url: '/file-upload/sxLXBzjwuqxMnebyP/Clipboard%20-%2029%20de%20Agosto%20de%202018%20%C3%A0s%2018:10'
}]}
/>
2019-03-27 20:06:57 +00:00
<Separator title='With video' />
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
video_url: '/file-upload/cqnKqb6kdajky5Rxj/WhatsApp%20Video%202018-08-22%20at%2019.09.55.mp4'
}]}
/>
<Message
attachments={[{
title: 'This is a title',
video_url: '/file-upload/cqnKqb6kdajky5Rxj/WhatsApp%20Video%202018-08-22%20at%2019.09.55.mp4'
}]}
/>
2019-03-27 20:06:57 +00:00
<Separator title='With audio' />
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
/>
<Message msg='First message' isHeader={false} />
2019-03-29 19:36:07 +00:00
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
isHeader={false}
2019-03-29 19:36:07 +00:00
/>
<Message
attachments={[{
title: 'This is a title',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
isHeader={false}
2019-03-29 19:36:07 +00:00
/>
<Message
attachments={[{
title: 'This is a title',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
isHeader={false}
2019-03-29 19:36:07 +00:00
/>
2019-03-27 20:06:57 +00:00
<Separator title='Message with reply' />
<Message
msg="I'm fine!"
attachments={[{
2019-03-29 19:36:07 +00:00
author_name: 'I\'m a very long long title and I\'ll break',
ts: date,
timeFormat: 'LT',
text: 'How are you?'
}]}
/>
<Message
msg="I'm fine!"
attachments={[{
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'How are you? :nyan_rocket:'
}]}
/>
<Separator title='Message with read receipt' />
<Message
msg="I'm fine!"
isReadReceiptEnabled
unread
/>
<Message
msg="I'm fine!"
isReadReceiptEnabled
unread
isHeader={false}
/>
<Message
msg="I'm fine!"
isReadReceiptEnabled
read
/>
<Message
msg="I'm fine!"
isReadReceiptEnabled
read
isHeader={false}
/>
2019-04-17 17:01:03 +00:00
<Separator title='Message with thread' />
<Message
msg='How are you?'
tcount={1}
tlm={date}
/>
<Message
msg='How are you?'
tcount={9999}
tlm={date}
/>
2019-04-17 17:01:03 +00:00
<Message
msg="I'm fine!"
tmid='1'
tmsg='How are you?'
isThreadReply
2019-04-17 17:01:03 +00:00
/>
<Message
msg="I'm fine!"
tmid='1'
tmsg='Thread with emoji :) :joy:'
isThreadReply
2019-04-17 17:01:03 +00:00
/>
<Message
msg="I'm fine!"
tmid='1'
tmsg='Markdown: [link](http://www.google.com/) ```block code```'
isThreadReply
/>
2019-04-17 17:01:03 +00:00
<Message
msg="I'm fine!"
tmid='1'
tmsg={longText}
isThreadReply
2019-04-17 17:01:03 +00:00
/>
<Message
msg={longText}
tmid='1'
tmsg='How are you?'
isThreadReply
2019-04-17 17:01:03 +00:00
/>
<Message
msg={longText}
tmid='1'
tmsg={longText}
isThreadReply
2019-04-17 17:01:03 +00:00
/>
<Message
tmid='1'
tmsg='Thread with attachment'
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
isThreadReply
/>
<Separator title='Sequential thread messages following thread button' />
<Message
msg='How are you?'
tcount={1}
tlm={date}
/>
<Message
msg="I'm fine!"
tmid='1'
isThreadSequential
/>
<Message
msg={longText}
tmid='1'
isThreadSequential
/>
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
tmid='1'
isThreadSequential
/>
<Separator title='Sequential thread messages following thread reply' />
<Message
msg="I'm fine!"
tmid='1'
tmsg='How are you?'
isThreadReply
/>
<Message
msg='Cool!'
tmid='1'
isThreadSequential
/>
<Message
msg={longText}
tmid='1'
isThreadSequential
/>
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
tmid='1'
isThreadSequential
2019-04-17 17:01:03 +00:00
/>
2019-04-17 17:01:03 +00:00
{/* <Message
msg='How are you?'
tcount={9999}
tlm={moment().subtract(1, 'hour')}
/>
<Message
msg='How are you?'
tcount={9999}
tlm={moment().subtract(1, 'day')}
/>
<Message
msg='How are you?'
tcount={9999}
tlm={moment().subtract(5, 'day')}
/>
<Message
msg='How are you?'
tcount={9999}
tlm={moment().subtract(30, 'day')}
/> */}
<Separator title='Discussion' />
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={null}
dlm={null}
msg='This is a discussion'
/>
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={1}
dlm={date}
msg='This is a discussion'
/>
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={10}
dlm={date}
msg={longText}
/>
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={1000}
dlm={date}
msg='This is a discussion'
/>
{/* <Message
type='discussion-created'
drid='aisduhasidhs'
dcount={1000}
dlm={moment().subtract(1, 'hour')}
msg='This is a discussion'
/>
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={1000}
dlm={moment().subtract(1, 'day')}
msg='This is a discussion'
/>
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={1000}
dlm={moment().subtract(5, 'day')}
msg='This is a discussion'
/>
<Message
type='discussion-created'
drid='aisduhasidhs'
dcount={1000}
dlm={moment().subtract(30, 'day')}
msg='This is a discussion'
/> */}
2019-03-27 20:06:57 +00:00
<Separator title='URL' />
<Message
urls={[{
url: 'https://rocket.chat',
image: 'https://rocket.chat/images/blog/post.jpg',
title: 'Rocket.Chat - Free, Open Source, Enterprise Team Chat',
description: 'Rocket.Chat is the leading open source team chat software solution. Free, unlimited and completely customizable with on-premises and SaaS cloud hosting.'
}, {
url: 'https://google.com',
title: 'Google',
description: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.'
}]}
/>
<Message
urls={[{
url: 'https://google.com',
title: 'Google',
description: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.'
}]}
msg='Message :nyan_rocket:'
/>
<Message
urls={[{
url: 'https://google.com',
title: 'Google',
description: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.'
}]}
isHeader={false}
/>
2019-03-27 20:06:57 +00:00
<Separator title='Custom fields' />
<Message
msg='Message'
attachments={[{
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'Custom fields',
fields: [{
title: 'Field 1',
value: 'Value 1'
}, {
title: 'Field 2',
value: 'Value 2'
}, {
title: 'Field 3',
value: 'Value 3'
}, {
title: 'Field 4',
value: 'Value 4'
}, {
title: 'Field 5',
value: 'Value 5'
}]
}]}
/>
2019-03-27 20:06:57 +00:00
<Separator title='Two short custom fields' />
<Message
msg='Message'
attachments={[{
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'Custom fields',
fields: [{
title: 'Field 1',
value: 'Value 1',
short: true
}, {
title: 'Field 2',
value: 'Value 2',
short: true
}]
}, {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'Custom fields 2',
fields: [{
title: 'Field 1',
value: 'Value 1',
short: true
}, {
title: 'Field 2',
value: 'Value 2',
short: true
}]
}]}
/>
<Separator title='Broadcast' />
2019-03-27 20:06:57 +00:00
<Message msg='Broadcasted message' broadcast replyBroadcast={() => alert('broadcast!')} />
<Separator title='Archived' />
2019-03-27 20:06:57 +00:00
<Message msg='This message is inside an archived room' archived />
2019-03-27 20:06:57 +00:00
<Separator title='Error' />
<Message hasError msg='This message has error' status={messagesStatus.ERROR} onErrorPress={() => alert('Error pressed')} />
<Message hasError msg='This message has error too' status={messagesStatus.ERROR} onErrorPress={() => alert('Error pressed')} isHeader={false} />
<Separator title='Temp' />
<Message msg='Temp message' status={messagesStatus.TEMP} isTemp />
<Separator title='Editing' />
2019-03-27 20:06:57 +00:00
<Message msg='Message being edited' editing />
<Separator title='Removed' />
<Message type='rm' isInfo />
<Separator title='Joined' />
<Message type='uj' isInfo />
<Separator title='Room name changed' />
<Message msg='New name' type='r' isInfo />
2019-03-27 20:06:57 +00:00
<Separator title='Message pinned' />
<Message
msg='New name'
type='message_pinned'
isInfo
attachments={[{
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'First message'
}]}
/>
<Separator title='Has left the channel' />
<Message type='ul' isInfo />
<Separator title='User removed' />
<Message msg='rocket.cat' type='ru' isInfo />
<Separator title='User added' />
<Message msg='rocket.cat' type='au' isInfo />
<Separator title='User muted' />
<Message msg='rocket.cat' type='user-muted' isInfo />
<Separator title='User unmuted' />
<Message msg='rocket.cat' type='user-unmuted' isInfo />
2019-03-27 20:06:57 +00:00
<Separator title='Role added' />
<Message
msg='rocket.cat'
role='admin' // eslint-disable-line
type='subscription-role-added'
isInfo
/>
2019-03-27 20:06:57 +00:00
<Separator title='Role removed' />
<Message
msg='rocket.cat'
role='admin' // eslint-disable-line
type='subscription-role-removed'
isInfo
/>
<Separator title='Changed description' />
<Message msg='new description' type='room_changed_description' isInfo />
<Separator title='Changed announcement' />
<Message msg='new announcement' type='room_changed_announcement' isInfo />
<Separator title='Changed topic' />
<Message msg='new topic' type='room_changed_topic' isInfo />
<Separator title='Changed type' />
<Message msg='public' type='room_changed_privacy' isInfo />
<Separator title='Custom style' />
2019-03-27 20:06:57 +00:00
<Message msg='Message' style={[styles.normalize, { backgroundColor: '#ddd' }]} />
<Separator title='Markdown emphasis' />
2019-03-27 20:06:57 +00:00
<Message msg='Italic with *asterisks* or _underscores_. Bold with **asterisks** or __underscores__. ~~Strikethrough~~' />
2019-03-27 20:06:57 +00:00
<Separator title='Markdown headers' />
<Message
msg='# H1
## H2
### H3
#### H4
##### H5
###### H6'
/>
<Separator title='Markdown links' />
2019-03-27 20:06:57 +00:00
<Message msg='Support <http://google.com|Google> [I`m an inline-style link](https://www.google.com) https://google.com' />
<Separator title='Markdown image' />
2019-03-27 20:06:57 +00:00
<Message msg='![alt text](https://play.google.com/intl/en_us/badges/images/badge_new.png)' />
2019-03-27 20:06:57 +00:00
<Separator title='Markdown code' />
<Message
msg='Inline `code` has `back-ticks around` it.
```
Code block
```'
/>
<Separator title='Markdown quote' />
2019-03-27 20:06:57 +00:00
<Message msg='> Quote' />
2019-03-27 20:06:57 +00:00
<Separator title='Markdown table' />
<Message
msg='First Header | Second Header
------------ | -------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column'
/>
</ScrollView>
);