diff --git a/react/features/base/dialog/components/native/BottomSheet.js b/react/features/base/dialog/components/native/BottomSheet.js index 977b50161..48276e5c0 100644 --- a/react/features/base/dialog/components/native/BottomSheet.js +++ b/react/features/base/dialog/components/native/BottomSheet.js @@ -1,7 +1,7 @@ // @flow import React, { PureComponent, type Node } from 'react'; -import { SafeAreaView, View } from 'react-native'; +import { Platform, SafeAreaView, View } from 'react-native'; import { ColorSchemeRegistry } from '../../../color-scheme'; import { SlidingView } from '../../../react'; @@ -36,21 +36,6 @@ type Props = { * A component emulating Android's BottomSheet. */ class BottomSheet extends PureComponent { - /** - * Assembles a style for the BottomSheet container. - * - * @private - * @returns {StyleType} - */ - _getContainerStyle() { - const { _styles } = this.props; - - return { - ...styles.container, - backgroundColor: _styles.sheet.backgroundColor - }; - } - /** * Implements React's {@link Component#render()}. * @@ -65,15 +50,44 @@ class BottomSheet extends PureComponent { onHide = { this.props.onCancel } position = 'bottom' show = { true }> - - - { this.props.children } + + + + { this._getWrappedContent() } - + ); } + + /** + * Wraps the content when needed (iOS 11 and above), or just returns the original children. + * + * @returns {React$Element} + */ + _getWrappedContent() { + if (Platform.OS === 'ios') { + const majorVersionIOS = parseInt(Platform.Version, 10); + + if (majorVersionIOS > 10) { + return ( + + { this.props.children } + + ); + } + } + + return this.props.children; + } } /** diff --git a/react/features/base/dialog/components/native/styles.js b/react/features/base/dialog/components/native/styles.js index 0d31d8fb4..25645f915 100644 --- a/react/features/base/dialog/components/native/styles.js +++ b/react/features/base/dialog/components/native/styles.js @@ -27,17 +27,25 @@ export const PLACEHOLDER_COLOR = ColorPalette.lightGrey; * been implemented as per the Material Design guidelines: * {@link https://material.io/guidelines/components/bottom-sheets.html}. */ -export const bottomSheetStyles = createStyleSheet({ +export const bottomSheetStyles = { + sheetAreaCover: { + backgroundColor: ColorPalette.transparent, + flex: 1 + }, + /** * Style for the container of the sheet. */ - container: { - bottom: 0, - left: 0, - position: 'absolute', - right: 0 + sheetContainer: { + alignContent: 'stretch', + flex: 1, + flexDirection: 'column' + }, + + sheetItemContainer: { + paddingHorizontal: MD_ITEM_MARGIN_PADDING } -}); +}; export const brandedDialog = createStyleSheet({ @@ -137,10 +145,7 @@ ColorSchemeRegistry.register('BottomSheet', { * Bottom sheet's base style. */ sheet: { - backgroundColor: schemeColor('background'), - flex: 1, - paddingHorizontal: MD_ITEM_MARGIN_PADDING, - paddingVertical: 8 + backgroundColor: schemeColor('background') }, /**