[FIX] MessageBox not being shown on ShareView when Preview is a video (#2283)

* Wrap video preview with ScrollView so Messagebox is shown properly

* Fix border color
This commit is contained in:
Diego Mello 2020-07-14 13:43:15 -03:00 committed by GitHub
parent 8a24eb0722
commit bbe15b7e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 14 deletions

View File

@ -908,7 +908,7 @@ class MessageBox extends Component {
return (
<>
{commandsPreviewAndMentions}
<View style={[styles.composer, { borderTopColor: themes[theme].separatorColor }]}>
<View style={[styles.composer, { borderTopColor: themes[theme].borderColor }]}>
{replyPreview}
<View
style={[

View File

@ -10,12 +10,13 @@ import { ImageViewer, types } from '../../presentation/ImageViewer';
import { themes } from '../../constants/colors';
import { useDimensions, useOrientation } from '../../dimensions';
import { getHeaderHeight } from '../../containers/Header';
import { isIOS } from '../../utils/deviceInfo';
import { THUMBS_HEIGHT } from './constants';
import sharedStyles from '../Styles';
import { allowPreview } from './utils';
import I18n from '../../i18n';
const MESSAGEBOX_HEIGHT = 56;
const styles = StyleSheet.create({
fileContainer: {
alignItems: 'center',
@ -58,13 +59,13 @@ const Preview = React.memo(({
const { isLandscape } = useOrientation();
const insets = useSafeAreaInsets();
const headerHeight = getHeaderHeight(isLandscape);
const messageboxHeight = isIOS ? 56 : 0;
const thumbsHeight = (length > 1) ? THUMBS_HEIGHT : 0;
const calculatedHeight = height - insets.top - insets.bottom - messageboxHeight - thumbsHeight - headerHeight;
const calculatedHeight = height - insets.top - insets.bottom - MESSAGEBOX_HEIGHT - thumbsHeight - headerHeight;
if (item?.canUpload) {
if (type?.match(/video/)) {
return (
<ScrollView style={{ height: calculatedHeight }}>
<Video
source={{ uri: item.path }}
rate={1.0}
@ -75,6 +76,7 @@ const Preview = React.memo(({
style={{ width, height: calculatedHeight }}
useNativeControls
/>
</ScrollView>
);
}