diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b2fd038f70..290f5ff229 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1407,7 +1407,7 @@ PODS: - Yoga - react-native-performance (5.1.2): - React-Core - - react-native-safe-area-context (5.5.2): + - react-native-safe-area-context (5.6.1): - React-Core - react-native-slider (4.5.6): - DoubleConversion @@ -2271,7 +2271,7 @@ SPEC CHECKSUMS: react-native-orientation-locker: dbd3f6ddbe9e62389cb0807dc2af63f6c36dec36 react-native-pager-view: 11662c698c8f11d39e05891316d2a144fa00adc4 react-native-performance: 125a96c145e29918b55b45ce25cbba54f1e24dcd - react-native-safe-area-context: 0f7bf11598f9a61b7ceac8dc3f59ef98697e99e1 + react-native-safe-area-context: 2243039f43d10cb1ea30ec5ac57fc6d1448413f4 react-native-slider: 1205801a8d29b28cacc14eef08cb120015cdafcb react-native-video: eb861d67a71dfef1bbf6086a811af5f338b13781 react-native-webrtc: e8f0ce746353adc2744a2b933645e1aeb41eaa74 diff --git a/package-lock.json b/package-lock.json index e464ad9ab5..4495bb9736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,7 +91,7 @@ "react-native-pager-view": "6.8.1", "react-native-paper": "5.10.3", "react-native-performance": "5.1.2", - "react-native-safe-area-context": "5.5.2", + "react-native-safe-area-context": "5.6.1", "react-native-screens": "4.11.1", "react-native-sound": "https://github.com/jitsi/react-native-sound.git#ea13c97b5c2a4ff5e0d9bacbd9ff5e4457fe2c3c", "react-native-splash-view": "0.0.18", @@ -22002,9 +22002,9 @@ } }, "node_modules/react-native-safe-area-context": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.5.2.tgz", - "integrity": "sha512-t4YVbHa9uAGf+pHMabGrb0uHrD5ogAusSu842oikJ3YKXcYp6iB4PTGl0EZNkUIR3pCnw/CXKn42OCfhsS0JIw==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.6.1.tgz", + "integrity": "sha512-/wJE58HLEAkATzhhX1xSr+fostLsK8Q97EfpfMDKo8jlOc1QKESSX/FQrhk7HhQH/2uSaox4Y86sNaI02kteiA==", "license": "MIT", "peerDependencies": { "react": "*", @@ -42378,9 +42378,9 @@ "integrity": "sha512-l5JOJphNzox9a9icL3T6O/gEqZuqWqcbejW04WPa10m0UanBdIYrNkPFl48B3ivWw3MabpjB6GiDYv7old9/fw==" }, "react-native-safe-area-context": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.5.2.tgz", - "integrity": "sha512-t4YVbHa9uAGf+pHMabGrb0uHrD5ogAusSu842oikJ3YKXcYp6iB4PTGl0EZNkUIR3pCnw/CXKn42OCfhsS0JIw==" + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.6.1.tgz", + "integrity": "sha512-/wJE58HLEAkATzhhX1xSr+fostLsK8Q97EfpfMDKo8jlOc1QKESSX/FQrhk7HhQH/2uSaox4Y86sNaI02kteiA==" }, "react-native-screens": { "version": "4.11.1", diff --git a/package.json b/package.json index 24c483e3c6..f73482204d 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "react-native-pager-view": "6.8.1", "react-native-paper": "5.10.3", "react-native-performance": "5.1.2", - "react-native-safe-area-context": "5.5.2", + "react-native-safe-area-context": "5.6.1", "react-native-screens": "4.11.1", "react-native-sound": "https://github.com/jitsi/react-native-sound.git#ea13c97b5c2a4ff5e0d9bacbd9ff5e4457fe2c3c", "react-native-splash-view": "0.0.18", diff --git a/react/features/base/modal/components/JitsiScreen.tsx b/react/features/base/modal/components/JitsiScreen.tsx index 59a5cf2c0f..312c322655 100644 --- a/react/features/base/modal/components/JitsiScreen.tsx +++ b/react/features/base/modal/components/JitsiScreen.tsx @@ -63,7 +63,7 @@ const JitsiScreen = ({ footerComponent, hasBottomTextInput = false, hasExtraHeaderHeight = false, - safeAreaInsets = [ 'left', 'right' ], + safeAreaInsets = [ 'bottom', 'left', 'right' ], style }: IProps) => { const renderContent = () => ( @@ -78,8 +78,8 @@ const JitsiScreen = ({ edges = { safeAreaInsets } style = { styles.safeArea }> { children } + { footerComponent?.() } - { footerComponent?.() } ); diff --git a/react/features/chat/components/native/Chat.tsx b/react/features/chat/components/native/Chat.tsx index 03a654be98..37389ed2a4 100644 --- a/react/features/chat/components/native/Chat.tsx +++ b/react/features/chat/components/native/Chat.tsx @@ -1,39 +1,29 @@ /* eslint-disable react/no-multi-comp */ import { Route, useIsFocused } from '@react-navigation/native'; import React, { Component, useEffect } from 'react'; -import { connect } from 'react-redux'; +import { connect, useSelector } from 'react-redux'; import { IReduxState } from '../../../app/types'; import { translate } from '../../../base/i18n/functions'; import JitsiScreen from '../../../base/modal/components/JitsiScreen'; +import { StyleType } from '../../../base/styles/functions.native'; import { TabBarLabelCounter } from '../../../mobile/navigation/components/TabBarLabelCounter'; -import { getUnreadPollCount } from '../../../polls/functions'; +import { pollsStyles } from '../../../polls/components/native/styles'; import { closeChat, sendMessage } from '../../actions.native'; -import { getUnreadFilesCount } from '../../functions'; +import { ChatTabs } from '../../constants'; import { IChatProps as AbstractProps } from '../../types'; import ChatInputBar from './ChatInputBar'; import MessageContainer from './MessageContainer'; import MessageRecipient from './MessageRecipient'; -import styles from './styles'; interface IProps extends AbstractProps { - /** - * The number of unread file messages. - */ - _unreadFilesCount: number; - /** * The number of unread messages. */ _unreadMessagesCount: number; - /** - * The number of unread polls. - */ - _unreadPollsCount: number; - /** * Default prop for navigating between screen components(React Navigation). */ @@ -62,6 +52,7 @@ class Chat extends Component { // Bind event handlers so they are only bound once per instance. this._onSendMessage = this._onSendMessage.bind(this); + this._renderFooter = this._renderFooter.bind(this); } /** @@ -76,14 +67,10 @@ class Chat extends Component { return ( - - } + footerComponent = { this._renderFooter } hasBottomTextInput = { true } hasExtraHeaderHeight = { true } - style = { styles.chatContainer }> + style = { pollsStyles.pollPaneContainer as StyleType }> {/* @ts-ignore */} @@ -91,6 +78,16 @@ class Chat extends Component { ); } + /** + * Renders the footer component. + * + * @private + * @returns {React$Element<*>} + */ + _renderFooter() { + return ; + } + /** * Sends a text message. * @@ -113,9 +110,7 @@ class Chat extends Component { * @private * @returns {{ * _messages: Array, - * _unreadMessagesCount: number, - * _unreadPollsCount: number, - * _unreadFilesCount: number + * _unreadMessagesCount: number * }} */ function _mapStateToProps(state: IReduxState, _ownProps: any) { @@ -123,34 +118,34 @@ function _mapStateToProps(state: IReduxState, _ownProps: any) { return { _messages: messages, - _unreadMessagesCount: unreadMessagesCount, - _unreadPollsCount: getUnreadPollCount(state), - _unreadFilesCount: getUnreadFilesCount(state) + _unreadMessagesCount: unreadMessagesCount }; } export default translate(connect(_mapStateToProps)((props: IProps) => { - const { _unreadMessagesCount, _unreadPollsCount, _unreadFilesCount, dispatch, navigation, t } = props; - const totalUnread = _unreadMessagesCount + _unreadPollsCount + _unreadFilesCount; - const unreadMessagesNr = totalUnread > 0; + const { _unreadMessagesCount, dispatch, navigation, t } = props; + + const isChatTabFocused = useSelector((state: IReduxState) => state['features/chat'].focusedTab === ChatTabs.CHAT); const isFocused = useIsFocused(); + const activeUnreadMessagesNr = !isChatTabFocused && _unreadMessagesCount > 0; + useEffect(() => { navigation?.setOptions({ tabBarLabel: () => ( + unreadCount = { _unreadMessagesCount } /> ) }); return () => { isFocused && dispatch(closeChat()); }; - }, [ isFocused, _unreadMessagesCount, _unreadPollsCount, _unreadFilesCount ]); + }, [ isFocused, _unreadMessagesCount ]); return ( diff --git a/react/features/chat/components/native/ChatInputBar.tsx b/react/features/chat/components/native/ChatInputBar.tsx index 6ab8dac9f8..08e0d22bdf 100644 --- a/react/features/chat/components/native/ChatInputBar.tsx +++ b/react/features/chat/components/native/ChatInputBar.tsx @@ -7,7 +7,6 @@ import { connect } from 'react-redux'; import { IReduxState } from '../../../app/types'; import { translate } from '../../../base/i18n/functions'; import { IconSend } from '../../../base/icons/svg'; -import { ASPECT_RATIO_WIDE } from '../../../base/responsive-ui/constants'; import IconButton from '../../../base/ui/components/native/IconButton'; import Input from '../../../base/ui/components/native/Input'; import { BUTTON_TYPES } from '../../../base/ui/constants.native'; @@ -85,14 +84,6 @@ class ChatInputBar extends Component { * @inheritdoc */ override render() { - let inputBarStyles; - - if (this.props.aspectRatio === ASPECT_RATIO_WIDE) { - inputBarStyles = styles.inputBarWide; - } else { - inputBarStyles = styles.inputBarNarrow; - } - if (this.props._isSendGroupChatDisabled && !this.props._privateMessageRecipientId) { return ( { { id = { this.props.t('chat.sendButton') } onPress = { this._onSubmit } src = { IconSend } + style = { styles.sendButton } type = { BUTTON_TYPES.PRIMARY } /> ); diff --git a/react/features/chat/components/native/styles.ts b/react/features/chat/components/native/styles.ts index cc58545721..20fed0d74c 100644 --- a/react/features/chat/components/native/styles.ts +++ b/react/features/chat/components/native/styles.ts @@ -14,12 +14,6 @@ const recipientContainer = { padding: BaseTheme.spacing[2] }; -const inputBar = { - alignItems: 'center', - flexDirection: 'row', - justifyContent: 'space-between' -}; - /** * The styles of the feature chat. * @@ -143,23 +137,23 @@ export default { * A special padding to avoid issues on some devices (such as Android devices with custom suggestions bar). */ extraBarPadding: { - paddingBottom: 30 + paddingBottom: BaseTheme.spacing[8] }, - inputBarNarrow: { - ...inputBar, - height: 112, - marginHorizontal: BaseTheme.spacing[3] + inputBar: { + alignSelf: 'stretch', + flexDirection: 'row', + width: '100%' }, - inputBarWide: { - ...inputBar, - height: 88, - marginHorizontal: BaseTheme.spacing[9] + sendButton: { + marginRight: BaseTheme.spacing[5], + marginLeft: BaseTheme.spacing[2] }, customInputContainer: { - width: '75%' + marginLeft: BaseTheme.spacing[5], + flex: 1 }, messageBubble: { @@ -215,11 +209,6 @@ export default { fontSize: 13 }, - chatContainer: { - backgroundColor: BaseTheme.palette.ui01, - flex: 1 - }, - tabContainer: { flexDirection: 'row', justifyContent: 'center' diff --git a/react/features/conference/components/native/carmode/styles.ts b/react/features/conference/components/native/carmode/styles.ts index 86b20ac752..62a67b9ee3 100644 --- a/react/features/conference/components/native/carmode/styles.ts +++ b/react/features/conference/components/native/carmode/styles.ts @@ -21,10 +21,9 @@ const titleBarSafeView = { export default { bottomContainer: { - display: 'flex', - flexDirection: 'column', alignItems: 'center', - bottom: BaseTheme.spacing[8] + display: 'flex', + flexDirection: 'column' }, /** @@ -101,7 +100,7 @@ export default { }, soundDeviceButton: { - marginBottom: BaseTheme.spacing[3], + marginVertical: BaseTheme.spacing[3], width: 240 }, @@ -162,7 +161,6 @@ export default { videoStoppedLabel: { ...BaseTheme.typography.bodyShortRegularLarge, color: BaseTheme.palette.text01, - marginBottom: BaseTheme.spacing[3], textAlign: 'center', width: '100%' }, diff --git a/react/features/gifs/components/native/styles.ts b/react/features/gifs/components/native/styles.ts index db919c4b92..3256d9197f 100644 --- a/react/features/gifs/components/native/styles.ts +++ b/react/features/gifs/components/native/styles.ts @@ -24,8 +24,6 @@ export default { flexDirection: 'row', height: 56, justifyContent: 'center', - marginBottom: BaseTheme.spacing[0], - paddingBottom: BaseTheme.spacing[4], width: '100%' }, diff --git a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.tsx b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.tsx index 4921f74893..410046e5ad 100644 --- a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.tsx +++ b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.tsx @@ -4,7 +4,6 @@ import { WithTranslation } from 'react-i18next'; import { ActivityIndicator, FlatList, - SafeAreaView, TouchableOpacity, View, ViewStyle @@ -513,7 +512,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog { */ _renderShareMeetingButton() { return ( - { src = { IconShare } style = { styles.shareIcon } /> - + ); } diff --git a/react/features/participants-pane/components/native/LobbyParticipantList.tsx b/react/features/participants-pane/components/native/LobbyParticipantList.tsx index 51a4ed51c7..7f500f4100 100644 --- a/react/features/participants-pane/components/native/LobbyParticipantList.tsx +++ b/react/features/participants-pane/components/native/LobbyParticipantList.tsx @@ -27,7 +27,7 @@ const LobbyParticipantList = () => { } return ( - <> + { title } @@ -50,7 +50,7 @@ const LobbyParticipantList = () => { participant = { p } />) ) } - + ); }; diff --git a/react/features/participants-pane/components/native/ParticipantItem.tsx b/react/features/participants-pane/components/native/ParticipantItem.tsx index 6389df7033..ca4ac92b6f 100644 --- a/react/features/participants-pane/components/native/ParticipantItem.tsx +++ b/react/features/participants-pane/components/native/ParticipantItem.tsx @@ -94,8 +94,6 @@ function ParticipantItem({ }: IProps) { const { t } = useTranslation(); - const participantNameContainerStyles - = isKnockingParticipant ? styles.lobbyParticipantNameContainer : styles.participantNameContainer; return ( } > @@ -106,12 +104,8 @@ function ParticipantItem({ displayName = { displayName } participantId = { participantID } size = { 32 } /> - }> - }> + + }> }> @@ -128,13 +122,11 @@ function ParticipantItem({ { !isKnockingParticipant - && <> - { raisedHand && } - }> - { VideoStateIcons[videoMediaState] } - { AudioStateIcons[audioMediaState] } - - + && }> + { raisedHand && } + { VideoStateIcons[videoMediaState] } + { AudioStateIcons[audioMediaState] } + } { !local && children } diff --git a/react/features/participants-pane/components/native/styles.ts b/react/features/participants-pane/components/native/styles.ts index 438b4071cf..feeeebd3ad 100644 --- a/react/features/participants-pane/components/native/styles.ts +++ b/react/features/participants-pane/components/native/styles.ts @@ -6,12 +6,8 @@ import BaseTheme from '../../../base/ui/components/BaseTheme.native'; const participantListDescription = { ...BaseTheme.typography.heading6, color: BaseTheme.palette.text01, - fontSize: 15, - fontWeight: 'bold', marginLeft: BaseTheme.spacing[2], - marginVertical: BaseTheme.spacing[2], - position: 'relative', - width: '70%' + paddingVertical: BaseTheme.spacing[2] }; /** @@ -52,13 +48,6 @@ const contextMenuItem = { marginLeft: BaseTheme.spacing[3] }; -const participantNameContainer = { - display: 'flex', - flexDirection: 'row', - overflow: 'hidden', - paddingLeft: BaseTheme.spacing[3] -}; - /** * The styles of the native components of the feature {@code participants}. */ @@ -91,8 +80,7 @@ export default { flexDirection: 'row', height: BaseTheme.spacing[9], paddingLeft: BaseTheme.spacing[3], - paddingRight: BaseTheme.spacing[3], - width: '100%' + paddingRight: BaseTheme.spacing[3] }, participantContent: { @@ -106,24 +94,11 @@ export default { width: '100%' }, - participantDetailsContainer: { - display: 'flex', - flexDirection: 'column', - width: '73%' - }, - - participantDetailsContainerRaisedHand: { - width: '65%' - }, - participantNameContainer: { - ...participantNameContainer, - width: '100%' - }, - - lobbyParticipantNameContainer: { - ...participantNameContainer, - width: '40%' + display: 'flex', + flexDirection: 'row', + overflow: 'hidden', + paddingLeft: BaseTheme.spacing[3], }, participantName: { @@ -139,19 +114,19 @@ export default { }, participantStatesContainer: { + alignItems: 'center', display: 'flex', flexDirection: 'row', - marginLeft: 'auto', - width: '15%' + marginLeft: 'auto' }, participantStateVideo: { - paddingRight: BaseTheme.spacing[3] + marginRight: BaseTheme.spacing[2] }, raisedHandIndicator: { backgroundColor: BaseTheme.palette.warning02, - borderRadius: BaseTheme.shape.borderRadius / 2, + borderRadius: BaseTheme.shape.borderRadius, height: BaseTheme.spacing[4], width: BaseTheme.spacing[4], marginLeft: 'auto', @@ -166,7 +141,7 @@ export default { buttonAdmit: { position: 'absolute', - right: 16 + right: BaseTheme.spacing[3] }, buttonReject: { @@ -201,20 +176,14 @@ export default { }, participantsPaneFooterContainer: { - alignItems: 'center', - bottom: 0, - height: 128, - left: 0, - paddingHorizontal: BaseTheme.spacing[4], - right: 0 + alignSelf: 'stretch', + marginHorizontal: BaseTheme.spacing[5] }, participantsPaneFooter: { display: 'flex', flexDirection: 'row', - justifyContent: 'flex-end', - paddingBottom: BaseTheme.spacing[3], - width: '100%' + marginLeft: 'auto' }, inviteButton: { diff --git a/react/features/polls/components/native/PollCreate.tsx b/react/features/polls/components/native/PollCreate.tsx index 59482b098a..25431ff220 100644 --- a/react/features/polls/components/native/PollCreate.tsx +++ b/react/features/polls/components/native/PollCreate.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { FlatList, Platform, TextInput, View, ViewStyle } from 'react-native'; +import { FlatList, SafeAreaView, TextInput, View, ViewStyle } from 'react-native'; import { Divider } from 'react-native-paper'; import { useDispatch } from 'react-redux'; @@ -97,9 +97,6 @@ const PollCreate = (props: AbstractProps) => { type = { TERTIARY } /> ); - const pollCreateButtonsContainerStyles = Platform.OS === 'android' - ? pollsStyles.pollCreateButtonsContainerAndroid : pollsStyles.pollCreateButtonsContainerIos; - /* eslint-disable react/jsx-no-bind */ const renderListItem = ({ index }: { index: number; }) => { @@ -160,7 +157,7 @@ const PollCreate = (props: AbstractProps) => { ), [ question ]); return ( - + { keyExtractor = { (item, index) => index.toString() } ref = { answerListRef } renderItem = { renderListItem } /> - +