mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
[RN] Add chat functionality
Co-authored-by: DimaG <dgeorgiev06@gmail.com>
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
82f714b608
commit
8a241ba2b7
@@ -5,12 +5,13 @@ import { View } from 'react-native';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { Container } from '../../../base/react';
|
||||
import { InviteButton } from '../../../invite';
|
||||
import { ChatButton } from '../../../chat';
|
||||
|
||||
import AudioMuteButton from '../AudioMuteButton';
|
||||
import HangupButton from '../HangupButton';
|
||||
import OverflowMenuButton from './OverflowMenuButton';
|
||||
import styles, {
|
||||
chatButtonOverride,
|
||||
hangupButtonStyles,
|
||||
toolbarButtonStyles,
|
||||
toolbarToggledButtonStyles
|
||||
@@ -141,6 +142,35 @@ class Toolbox extends Component<Props, State> {
|
||||
return 2 * Math.round(buttonSize / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the toggled style of the chat button. This cannot be done by
|
||||
* simple style inheritance due to the size calculation done in this
|
||||
* component.
|
||||
*
|
||||
* @param {Object} baseStyle - The base style that was originally
|
||||
* calculated.
|
||||
* @returns {Object | Array}
|
||||
*/
|
||||
_getChatButtonToggledStyle(baseStyle) {
|
||||
if (Array.isArray(baseStyle.style)) {
|
||||
return {
|
||||
...baseStyle,
|
||||
style: [
|
||||
...baseStyle.style,
|
||||
chatButtonOverride.toggled
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...baseStyle,
|
||||
style: [
|
||||
baseStyle.style,
|
||||
chatButtonOverride.toggled
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
_onLayout: (Object) => void;
|
||||
|
||||
/**
|
||||
@@ -200,7 +230,11 @@ class Toolbox extends Component<Props, State> {
|
||||
<View
|
||||
pointerEvents = 'box-none'
|
||||
style = { styles.toolbar }>
|
||||
<InviteButton styles = { buttonStyles } />
|
||||
<ChatButton
|
||||
styles = { buttonStyles }
|
||||
toggledStyles = {
|
||||
this._getChatButtonToggledStyle(toggledButtonStyles)
|
||||
} />
|
||||
<AudioMuteButton
|
||||
styles = { buttonStyles }
|
||||
toggledStyles = { toggledButtonStyles } />
|
||||
|
||||
Reference in New Issue
Block a user