Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 45 additions & 5 deletions app/containers/MessageBox/ReplyPreview.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import {
View, Text, StyleSheet, Image
} from 'react-native';
import PropTypes from 'prop-types';
import moment from 'moment';
import { connect } from 'react-redux';
import isEqual from 'lodash/isEqual';

import Markdown from '../markdown';
import { CustomIcon } from '../../lib/Icons';
import sharedStyles from '../../views/Styles';
Expand Down Expand Up @@ -32,13 +33,48 @@ const styles = StyleSheet.create({
},
time: {
fontSize: 12,
lineHeight: 16,
lineHeight: 20,
marginLeft: 6,
...sharedStyles.textRegular,
fontWeight: '300'
},
close: {
marginRight: 10
},
thumbnail: {
marginLeft: 'auto',
width: 38,
height: 38
},
text: {
flex: 1,
flexDirection: 'column',
paddingRight: 5
},
details: {
flexDirection: 'row'
},
buttonVideo: {
height: 38,
width: 38,
backgroundColor: '#1f2329',
alignItems: 'center',
justifyContent: 'center',
marginLeft: 'auto'
},
buttonAudio: {
height: 38,
width: 38,
backgroundColor: '#f7f8fa',
alignItems: 'center',
justifyContent: 'center',
marginLeft: 'auto'
},
playVideo: {
color: '#f7f8fa'
},
playAudio: {
color: '#1D74F5'
}
});

Expand All @@ -48,8 +84,8 @@ const ReplyPreview = React.memo(({
if (!replying) {
return null;
}

const time = moment(message.ts).format(Message_TimeFormat);
const description = (message.msg === '') ? message.attachments[0].description : message.msg;
return (
<View
style={[
Expand All @@ -63,7 +99,7 @@ const ReplyPreview = React.memo(({
<Text style={[styles.time, { color: themes[theme].auxiliaryText }]}>{time}</Text>
</View>
<Markdown
msg={message.msg}
msg={description}
baseUrl={baseUrl}
username={username}
getCustomEmoji={getCustomEmoji}
Expand All @@ -72,6 +108,10 @@ const ReplyPreview = React.memo(({
theme={theme}
/>
</View>
<Image
style={styles.thumbnail}
source={{ uri: baseUrl + message.attachments[0].image_url }}
/>
<CustomIcon name='close' color={themes[theme].auxiliaryText} size={20} style={styles.close} onPress={close} />
</View>
);
Expand Down
6 changes: 5 additions & 1 deletion app/containers/message/Reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { View, Text, StyleSheet } from 'react-native';
import PropTypes from 'prop-types';
import moment from 'moment';
import isEqual from 'deep-equal';

import Touchable from './Touchable';
import Markdown from '../markdown';
import openLink from '../../utils/openLink';
import sharedStyles from '../../views/Styles';
import { themes } from '../../constants/colors';
import MessageContext from './Context';
import Attachments from './Attachments';

const styles = StyleSheet.create({
button: {
Expand Down Expand Up @@ -177,6 +177,10 @@ const Reply = React.memo(({
theme={theme}
/>
<Fields attachment={attachment} theme={theme} />
<Attachments
attachments={attachment.attachments}
theme={theme}
/>
</View>
</Touchable>
<Markdown
Expand Down