diff --git a/src/common/ZulipStatusBar.js b/src/common/ZulipStatusBar.js index 564a26a9d89..de0f3f4e88d 100644 --- a/src/common/ZulipStatusBar.js +++ b/src/common/ZulipStatusBar.js @@ -56,7 +56,7 @@ class ZulipStatusBar extends PureComponent { render() { const { theme, hidden, safeAreaInsets, orientation } = this.props; const backgroundColor = this.props.backgroundColor ?? this.props.narrowTitleBackgroundColor; - const style = { height: hidden ? 0 : safeAreaInsets.top, backgroundColor }; + const style = { height: safeAreaInsets.top, backgroundColor }; const statusBarColor = getStatusBarColor(backgroundColor, theme); return ( orientation === 'PORTRAIT' && ( diff --git a/src/lightbox/Lightbox.js b/src/lightbox/Lightbox.js index c5d3132ded6..d50b48d666b 100644 --- a/src/lightbox/Lightbox.js +++ b/src/lightbox/Lightbox.js @@ -5,10 +5,10 @@ import { View, Dimensions, Easing } from 'react-native'; import PhotoView from 'react-native-photo-view'; import { connectActionSheet } from '@expo/react-native-action-sheet'; -import type { Auth, Dispatch, Message } from '../types'; +import type { Auth, Dispatch, Message, Dimensions as ZulipDimensions } from '../types'; import { connect } from '../react-redux'; import type { ShowActionSheetWithOptions } from '../message/messageActionSheet'; -import { getAuth } from '../selectors'; +import { getAuth, getSession } from '../selectors'; import { getResource } from '../utils/url'; import { SlideAnimationView } from '../common'; import LightboxHeader from './LightboxHeader'; @@ -36,12 +36,18 @@ const styles = createStyleSheet({ }, }); -type Props = $ReadOnly<{| +type SelectorProps = $ReadOnly<{| auth: Auth, - dispatch: Dispatch, + safeAreaInsets: ZulipDimensions, +|}>; + +type Props = $ReadOnly<{| src: string, message: Message, showActionSheetWithOptions: ShowActionSheetWithOptions, + + dispatch: Dispatch, + ...SelectorProps, |}>; type State = {| @@ -90,7 +96,7 @@ class Lightbox extends PureComponent { }); render() { - const { src, message, auth } = this.props; + const { src, message, auth, safeAreaInsets } = this.props; const footerMessage = message.type === 'stream' ? `Shared in #${message.display_recipient}` : 'Shared with you'; const resource = getResource(src, auth); @@ -108,7 +114,7 @@ class Lightbox extends PureComponent { @@ -136,5 +142,6 @@ class Lightbox extends PureComponent { export default connectActionSheet( connect(state => ({ auth: getAuth(state), + safeAreaInsets: getSession(state).safeAreaInsets, }))(Lightbox), );