diff --git a/app/components/file_attachment_list/file_attachment.js b/app/components/file_attachment_list/file_attachment.js index 4c3378713..737e0e8bc 100644 --- a/app/components/file_attachment_list/file_attachment.js +++ b/app/components/file_attachment_list/file_attachment.js @@ -66,13 +66,13 @@ export default class FileAttachment extends PureComponent { const {deviceWidth, file, onInfoPress, theme, navigator} = this.props; const style = getStyleSheet(theme); - let mime = file.mime_type; + let mime = file.mime_type || file.type; if (mime && mime.includes(';')) { mime = mime.split(';')[0]; } let fileAttachmentComponent; - if (file.has_preview_image || file.loading || file.mime_type === 'image/gif') { + if (file.has_preview_image || file.loading || mime === 'image/gif') { fileAttachmentComponent = ( + ); + } else { + textComponent = ( + + {this.props.content} + + ); + } + return ( - - {this.props.content} - + {textComponent} ); @@ -106,13 +127,26 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { }, code: { paddingHorizontal: 6, - paddingVertical: 4, + ...Platform.select({ + android: { + paddingVertical: 4, + }, + ios: { + top: -4, + }, + }), }, codeText: { color: changeOpacity(theme.centerChannelColor, 0.65), fontFamily: getCodeFont(), fontSize: 12, lineHeight: 18, + ...Platform.select({ + ios: { + margin: 0, + padding: 0, + }, + }), }, }; }); diff --git a/app/screens/text_preview/text_preview.js b/app/screens/text_preview/text_preview.js index 600e27ae3..5a662574d 100644 --- a/app/screens/text_preview/text_preview.js +++ b/app/screens/text_preview/text_preview.js @@ -4,9 +4,11 @@ import PropTypes from 'prop-types'; import React from 'react'; import { + Platform, ScrollView, StyleSheet, Text, + TextInput, View, } from 'react-native'; @@ -48,6 +50,27 @@ export default class TextPreview extends React.PureComponent { lineNumbersStyle = style.lineNumbers; } + let textComponent; + if (Platform.OS === 'ios') { + textComponent = ( + + ); + } else { + textComponent = ( + + {this.props.content} + + ); + } + return ( - - {this.props.content} - + {textComponent} ); @@ -110,13 +128,26 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { }, code: { paddingHorizontal: 6, - paddingVertical: 4, + ...Platform.select({ + android: { + paddingVertical: 4, + }, + ios: { + top: -4, + }, + }), }, codeText: { color: changeOpacity(theme.centerChannelColor, 0.65), fontFamily: getCodeFont(), fontSize: 12, lineHeight: 18, + ...Platform.select({ + ios: { + margin: 0, + padding: 0, + }, + }), }, }; });