[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 ( return (
<> <>
{commandsPreviewAndMentions} {commandsPreviewAndMentions}
<View style={[styles.composer, { borderTopColor: themes[theme].separatorColor }]}> <View style={[styles.composer, { borderTopColor: themes[theme].borderColor }]}>
{replyPreview} {replyPreview}
<View <View
style={[ style={[

View File

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