feat(conference) added React Navigation

Introduce navigation for all in-conference screens.
This commit is contained in:
Calinteodor
2021-10-20 22:29:21 +03:00
committed by GitHub
parent a5129ef291
commit 9df59b4a6f
54 changed files with 1712 additions and 605 deletions

View File

@@ -6,7 +6,8 @@ import { IconMessage, IconReply } from '../../base/icons';
import { getParticipantById } from '../../base/participants';
import { connect } from '../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
import { openChat } from '../actions';
import { navigate } from '../../conference/components/native/ConferenceNavigationContainerRef';
import { screen } from '../../conference/components/native/routes';
export type Props = AbstractButtonProps & {
@@ -30,6 +31,11 @@ export type Props = AbstractButtonProps & {
*/
dispatch: Function,
/**
* True if the polls feature is disabled.
*/
_isPollsDisabled: boolean,
/**
* The participant object retrieved from Redux.
*/
@@ -52,9 +58,16 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
* @returns {void}
*/
_handleClick() {
const { dispatch, _participant } = this.props;
dispatch(openChat(_participant));
this.props._isPollsDisabled
? navigate(screen.conference.chat, {
privateMessageRecipient: this.props._participant
})
: navigate(screen.conference.chatandpolls.main, {
screen: screen.conference.chatandpolls.tab.chat,
params: {
privateMessageRecipient: this.props._participant
}
});
}
/**
@@ -79,9 +92,11 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
*/
export function _mapStateToProps(state: Object, ownProps: Props): $Shape<Props> {
const enabled = getFeatureFlag(state, CHAT_ENABLED, true);
const { disablePolls } = state['features/base/config'];
const { visible = enabled } = ownProps;
return {
_isPollsDisabled: disablePolls,
_participant: getParticipantById(state, ownProps.participantID),
visible
};