import React from 'react'; import { Text, TextStyle, View, ViewStyle } from 'react-native'; import { connect } from 'react-redux'; import { IReduxState } from '../../../app/types'; import { getConferenceName } from '../../../base/conference/functions'; import { translate } from '../../../base/i18n/functions'; import JitsiScreen from '../../../base/modal/components/JitsiScreen'; import LoadingIndicator from '../../../base/react/components/native/LoadingIndicator'; import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants'; import BaseTheme from '../../../base/ui/components/BaseTheme.native'; import Button from '../../../base/ui/components/native/Button'; import Input from '../../../base/ui/components/native/Input'; import { BUTTON_TYPES } from '../../../base/ui/constants.native'; import BrandingImageBackground from '../../../dynamic-branding/components/native/BrandingImageBackground'; import LargeVideo from '../../../large-video/components/LargeVideo.native'; import { navigate } from '../../../mobile/navigation/components/lobby/LobbyNavigationContainerRef'; import { screen } from '../../../mobile/navigation/routes'; import { preJoinStyles } from '../../../prejoin/components/native/styles'; import AudioMuteButton from '../../../toolbox/components/native/AudioMuteButton'; import VideoMuteButton from '../../../toolbox/components/native/VideoMuteButton'; import AbstractLobbyScreen, { IProps as AbstractProps, _mapStateToProps as abstractMapStateToProps } from '../AbstractLobbyScreen'; import styles from './styles'; import AsyncStorage from '@react-native-async-storage/async-storage'; interface IProps extends AbstractProps { /** * The current aspect ratio of the screen. */ _aspectRatio: Symbol; /** * The room name. */ _roomName: string; } interface IState { meetingTitle: string | null; lobyTitle: string | null; lobyDescription: string | null; } /** * Implements a waiting screen that represents the participant being in the lobby. */ class LobbyScreen extends AbstractLobbyScreen { /** * Implements {@code PureComponent#render}. * * @inheritdoc */ constructor(props: IProps) { super(props); this.state = { meetingTitle: null, lobyTitle: null, lobyDescription: null }; } async componentDidMount() { const meetingTitle = await AsyncStorage.getItem("meetingTitle"); const lobyTitle = await AsyncStorage.getItem("lobyTitle"); const lobyDescription = await AsyncStorage.getItem("lobyDescription"); console.log("--meetingTitle, lobyTitle, lobyDescription--", meetingTitle, lobyTitle, lobyDescription) this.setState({ meetingTitle, lobyTitle, lobyDescription }); } render() { const { _aspectRatio, _roomName } = this.props; const { meetingTitle } = this.state; let contentWrapperStyles; let contentContainerStyles; let largeVideoContainerStyles; if (_aspectRatio === ASPECT_RATIO_NARROW) { contentWrapperStyles = preJoinStyles.contentWrapper; largeVideoContainerStyles = preJoinStyles.largeVideoContainer; contentContainerStyles = styles.contentContainer; } else { contentWrapperStyles = preJoinStyles.contentWrapperWide; largeVideoContainerStyles = preJoinStyles.largeVideoContainerWide; contentContainerStyles = preJoinStyles.contentContainerWide; } return ( {meetingTitle || _roomName} {this._renderToolbarButtons()} {this._renderContent()} ); } /** * Navigates to the lobby chat screen. * * @private * @returns {void} */ _onNavigateToLobbyChat() { navigate(screen.lobby.chat); } /** * Renders the joining (waiting) fragment of the screen. * * @inheritdoc */ _renderJoining() { const { lobyTitle, lobyDescription } = this.state; return ( {lobyTitle ? ( {lobyTitle} ) : ( {this.props.t("lobby.joiningTitle")} )} {lobyDescription ? ( {lobyDescription} ) : ( {this.props.t("lobby.joiningMessage")} )} {this._renderStandardButtons()} ); } /** * Renders the participant form to let the knocking participant enter its details. * * @inheritdoc */ _renderParticipantForm() { const { t } = this.props; const { displayName } = this.state; return ( ); } /** * Renders the participant info fragment when we have all the required details of the user. * * @inheritdoc */ _renderParticipantInfo() { return this._renderParticipantForm(); } /** * Renders the password form to let the participant join by using a password instead of knocking. * * @inheritdoc */ _renderPasswordForm() { const { _passwordJoinFailed, t } = this.props; return ( ); } /** * Renders the password join button (set). * * @inheritdoc */ _renderPasswordJoinButtons() { return (