removed the necessity of messageId or id
This commit is contained in:
parent
3072196cda
commit
fb7da4f70c
|
@ -54,7 +54,7 @@ const AttachedActions = ({ attachment, getCustomEmoji }: { attachment: IAttachme
|
|||
};
|
||||
|
||||
const Attachments: React.FC<IMessageAttachments> = React.memo(
|
||||
({ attachments, timeFormat, showAttachment, style, getCustomEmoji, isReply, id, author }: IMessageAttachments) => {
|
||||
({ attachments, timeFormat, showAttachment, style, getCustomEmoji, isReply, author }: IMessageAttachments) => {
|
||||
const { theme } = useTheme();
|
||||
|
||||
if (!attachments || attachments.length === 0) {
|
||||
|
@ -112,16 +112,7 @@ const Attachments: React.FC<IMessageAttachments> = React.memo(
|
|||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Reply
|
||||
key={index}
|
||||
index={index}
|
||||
attachment={file}
|
||||
timeFormat={timeFormat}
|
||||
getCustomEmoji={getCustomEmoji}
|
||||
messageId={id}
|
||||
/>
|
||||
);
|
||||
return <Reply key={index} index={index} attachment={file} timeFormat={timeFormat} getCustomEmoji={getCustomEmoji} />;
|
||||
});
|
||||
return <>{attachmentsElements}</>;
|
||||
},
|
||||
|
|
|
@ -3,7 +3,6 @@ import { StyleSheet, Text, View } from 'react-native';
|
|||
import moment from 'moment';
|
||||
import { dequal } from 'dequal';
|
||||
import FastImage from 'react-native-fast-image';
|
||||
import parse from 'url-parse';
|
||||
|
||||
import Touchable from './Touchable';
|
||||
import Markdown from '../markdown';
|
||||
|
@ -92,7 +91,6 @@ interface IMessageReply {
|
|||
timeFormat?: string;
|
||||
index: number;
|
||||
getCustomEmoji: TGetCustomEmoji;
|
||||
messageId: string;
|
||||
}
|
||||
|
||||
const Title = React.memo(
|
||||
|
@ -199,7 +197,7 @@ const Fields = React.memo(
|
|||
);
|
||||
|
||||
const Reply = React.memo(
|
||||
({ attachment, timeFormat, index, getCustomEmoji, messageId }: IMessageReply) => {
|
||||
({ attachment, timeFormat, index, getCustomEmoji }: IMessageReply) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { theme } = useTheme();
|
||||
const { baseUrl, user, jumpToMessage } = useContext(MessageContext);
|
||||
|
@ -226,12 +224,6 @@ const Reply = React.memo(
|
|||
openLink(url, theme);
|
||||
};
|
||||
|
||||
let attachmentId = '';
|
||||
if (attachment.message_link) {
|
||||
const parsedUrl = parse(attachment.message_link, true);
|
||||
attachmentId = parsedUrl.query.msg || messageId;
|
||||
}
|
||||
|
||||
let { borderColor } = themes[theme];
|
||||
if (attachment.color) {
|
||||
borderColor = attachment.color;
|
||||
|
@ -264,7 +256,6 @@ const Reply = React.memo(
|
|||
timeFormat={timeFormat}
|
||||
style={[{ color: themes[theme].auxiliaryTintColor, fontSize: 14, marginBottom: 8 }]}
|
||||
isReply
|
||||
id={attachmentId}
|
||||
/>
|
||||
<Fields attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||
{loading ? (
|
||||
|
|
|
@ -14,7 +14,6 @@ export interface IMessageAttachments {
|
|||
isReply?: boolean;
|
||||
showAttachment?: (file: IAttachment) => void;
|
||||
getCustomEmoji: TGetCustomEmoji;
|
||||
id: string;
|
||||
author?: IUserMessage;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue