feat(prejoin/native): fixed screen header hooks warning (#13845)

* feat(prejoin/native): fixed screen header hooks warning
pull/13851/head jitsi-meet_8964
Calinteodor 1 year ago committed by GitHub
parent 2aca0ce110
commit d04515c35a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      react/features/prejoin/components/native/Prejoin.tsx
  2. 31
      react/features/prejoin/components/native/UnsafeRoomWarning.tsx

@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useLayoutEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
BackHandler, BackHandler,
Platform,
StyleProp, StyleProp,
Text, Text,
TextStyle, TextStyle,
@ -18,6 +19,7 @@ import { getConferenceName } from '../../../base/conference/functions';
import { connect } from '../../../base/connection/actions.native'; import { connect } from '../../../base/connection/actions.native';
import { PREJOIN_PAGE_HIDE_DISPLAY_NAME } from '../../../base/flags/constants'; import { PREJOIN_PAGE_HIDE_DISPLAY_NAME } from '../../../base/flags/constants';
import { getFeatureFlag } from '../../../base/flags/functions'; import { getFeatureFlag } from '../../../base/flags/functions';
import { IconCloseLarge } from '../../../base/icons/svg';
import JitsiScreen from '../../../base/modal/components/JitsiScreen'; import JitsiScreen from '../../../base/modal/components/JitsiScreen';
import { getLocalParticipant } from '../../../base/participants/functions'; import { getLocalParticipant } from '../../../base/participants/functions';
import { getFieldValue } from '../../../base/react/functions'; import { getFieldValue } from '../../../base/react/functions';
@ -28,7 +30,7 @@ import Input from '../../../base/ui/components/native/Input';
import { BUTTON_TYPES } from '../../../base/ui/constants.native'; import { BUTTON_TYPES } from '../../../base/ui/constants.native';
import BrandingImageBackground from '../../../dynamic-branding/components/native/BrandingImageBackground'; import BrandingImageBackground from '../../../dynamic-branding/components/native/BrandingImageBackground';
import LargeVideo from '../../../large-video/components/LargeVideo.native'; import LargeVideo from '../../../large-video/components/LargeVideo.native';
import { screenHeaderCloseButton } from '../../../mobile/navigation/functions'; import HeaderNavigationButton from '../../../mobile/navigation/components/HeaderNavigationButton';
import { navigateRoot } from '../../../mobile/navigation/rootNavigationContainerRef'; import { navigateRoot } from '../../../mobile/navigation/rootNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes'; import { screen } from '../../../mobile/navigation/routes';
import AudioMuteButton from '../../../toolbox/components/native/AudioMuteButton'; import AudioMuteButton from '../../../toolbox/components/native/AudioMuteButton';
@ -92,9 +94,25 @@ const Prejoin: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProps) => {
}, []); }, []);
const headerLeft = () => {
if (Platform.OS === 'ios') {
return (
<HeaderNavigationButton
label = { t('dialog.close') }
onPress = { goBack } />
);
}
return (
<HeaderNavigationButton
onPress = { goBack }
src = { IconCloseLarge } />
);
};
useLayoutEffect(() => { useLayoutEffect(() => {
navigation.setOptions({ navigation.setOptions({
headerLeft: () => screenHeaderCloseButton(goBack), headerLeft,
headerTitle: t('prejoin.joinMeeting') headerTitle: t('prejoin.joinMeeting')
}); });
}, [ navigation ]); }, [ navigation ]);

@ -1,19 +1,26 @@
import React, { useCallback, useLayoutEffect } from 'react'; import React, { useCallback, useLayoutEffect } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { StyleProp, Text, TextStyle, View, ViewStyle } from 'react-native'; import {
Platform,
StyleProp,
Text,
TextStyle,
View,
ViewStyle
} from 'react-native';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { appNavigate } from '../../../app/actions.native'; import { appNavigate } from '../../../app/actions.native';
import { IReduxState } from '../../../app/types'; import { IReduxState } from '../../../app/types';
import { getConferenceName } from '../../../base/conference/functions'; import { getConferenceName } from '../../../base/conference/functions';
import Icon from '../../../base/icons/components/Icon'; import Icon from '../../../base/icons/components/Icon';
import { IconWarning } from '../../../base/icons/svg'; import { IconCloseLarge, IconWarning } from '../../../base/icons/svg';
import JitsiScreen from '../../../base/modal/components/JitsiScreen'; import JitsiScreen from '../../../base/modal/components/JitsiScreen';
import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants'; import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
import Button from '../../../base/ui/components/native/Button'; import Button from '../../../base/ui/components/native/Button';
import { BUTTON_TYPES } from '../../../base/ui/constants.native'; import { BUTTON_TYPES } from '../../../base/ui/constants.native';
import getUnsafeRoomText from '../../../base/util/getUnsafeRoomText.native'; import getUnsafeRoomText from '../../../base/util/getUnsafeRoomText.native';
import { screenHeaderCloseButton } from '../../../mobile/navigation/functions'; import HeaderNavigationButton from '../../../mobile/navigation/components/HeaderNavigationButton';
import { navigateRoot } from '../../../mobile/navigation/rootNavigationContainerRef'; import { navigateRoot } from '../../../mobile/navigation/rootNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes'; import { screen } from '../../../mobile/navigation/routes';
import { IPrejoinProps } from '../../types'; import { IPrejoinProps } from '../../types';
@ -42,9 +49,25 @@ const UnsafeRoomWarning: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProp
return true; return true;
}, [ dispatch ]); }, [ dispatch ]);
const headerLeft = () => {
if (Platform.OS === 'ios') {
return (
<HeaderNavigationButton
label = { t('dialog.close') }
onPress = { goBack } />
);
}
return (
<HeaderNavigationButton
onPress = { goBack }
src = { IconCloseLarge } />
);
};
useLayoutEffect(() => { useLayoutEffect(() => {
navigation.setOptions({ navigation.setOptions({
headerLeft: () => screenHeaderCloseButton(goBack), headerLeft,
headerTitle: t('prejoin.joinMeeting') headerTitle: t('prejoin.joinMeeting')
}); });
}, [ navigation ]); }, [ navigation ]);

Loading…
Cancel
Save