Skip to content

Instantly share code, notes, and snippets.

@vishalnarkhede
Created November 1, 2020 09:43
Show Gist options
  • Save vishalnarkhede/d4b5020667e3f1722d728e9d8a64f7fa to your computer and use it in GitHub Desktop.
Save vishalnarkhede/d4b5020667e3f1722d728e9d8a64f7fa to your computer and use it in GitHub Desktop.
// src/components/MessageSlack.js
import React from 'react';
import {MessageSimple} from 'stream-chat-react-native';
import {MessageFooter} from './MessageFooter';
import {MessageText} from './MessageText';
import {MessageAvatar} from './MessageAvatar';
import {MessageHeader} from './MessageHeader';
import {UrlPreview} from './UrlPreview';
import {Giphy} from './Giphy';
import {MessageActionSheet} from './MessageActionSheet';
import ReactNativeHaptic from 'react-native-haptic';
import {getSupportedReactions} from '../utils/supportedReactions';
export const MessageSlack = props => {
if (props.message.deleted_at) {
return null;
}
return (
<MessageSimple
{...props}
forceAlign="left"
ReactionList={null}
onLongPress={() => {
ReactNativeHaptic && ReactNativeHaptic.generate('impact');
props.showActionSheet();
}}
textBeforeAttachments
ActionSheet={MessageActionSheet}
MessageAvatar={MessageAvatar}
MessageHeader={MessageHeader}
MessageFooter={MessageFooter}
MessageText={MessageText}
UrlPreview={UrlPreview}
Giphy={Giphy}
supportedReactions={getSupportedReactions(false)}
/>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment