diff --git a/react/features/base/react/types.ts b/react/features/base/react/types.ts index d8870b89ee3..1525926ea1f 100644 --- a/react/features/base/react/types.ts +++ b/react/features/base/react/types.ts @@ -5,6 +5,7 @@ export interface IIconButtonProps { accessibilityLabel?: string; color?: string; disabled?: boolean; + id?: string; onPress?: (e?: GestureResponderEvent) => void; size?: number | string; src: Function; diff --git a/react/features/base/ui/components/native/Button.tsx b/react/features/base/ui/components/native/Button.tsx index 1291b21d397..f9e056c20dd 100644 --- a/react/features/base/ui/components/native/Button.tsx +++ b/react/features/base/ui/components/native/Button.tsx @@ -1,7 +1,8 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import { TouchableHighlight } from 'react-native'; +import { StyleProp, TouchableHighlight } from 'react-native'; import { Button as NativePaperButton, Text } from 'react-native-paper'; +import { IconSource } from 'react-native-paper/lib/typescript/components/Icon'; import { BUTTON_MODES, BUTTON_TYPES } from '../../constants.native'; import BaseTheme from '../BaseTheme.native'; @@ -13,6 +14,7 @@ import styles from './buttonStyles'; export interface IProps extends IButtonProps { color?: string | undefined; contentStyle?: Object | undefined; + id?: string; labelStyle?: Object | undefined; mode?: any; style?: Object | undefined; @@ -24,6 +26,7 @@ const Button: React.FC = ({ contentStyle, disabled, icon, + id, labelKey, labelStyle, mode = BUTTON_MODES.CONTAINED, @@ -74,16 +77,17 @@ const Button: React.FC = ({ + ] as StyleProp }> { t(labelKey ?? '') } + ] as StyleProp }>{ t(labelKey ?? '') } ); } @@ -96,21 +100,20 @@ const Button: React.FC = ({ contentStyle = { [ styles.buttonContent, contentStyle - ] } + ] as StyleProp } disabled = { disabled } - - // @ts-ignore - icon = { icon } + icon = { icon as IconSource | undefined } + id = { id } labelStyle = { [ buttonLabelStyles, labelStyle - ] } + ] as StyleProp } mode = { mode } onPress = { onPress } style = { [ buttonStyles, style - ] } /> + ] as StyleProp } /> ); }; diff --git a/react/features/base/ui/components/native/IconButton.tsx b/react/features/base/ui/components/native/IconButton.tsx index c374a26895c..2e616803243 100644 --- a/react/features/base/ui/components/native/IconButton.tsx +++ b/react/features/base/ui/components/native/IconButton.tsx @@ -12,6 +12,7 @@ const IconButton: React.FC = ({ accessibilityLabel, color: iconColor, disabled, + id, onPress, size, src, @@ -52,6 +53,7 @@ const IconButton: React.FC = ({ ( } thumbColor = { thumbColor } trackColor = { trackColor } value = { checked } /> diff --git a/react/features/chat/components/native/ChatInputBar.tsx b/react/features/chat/components/native/ChatInputBar.tsx index b0fcf1f4225..df726fcf0a3 100644 --- a/react/features/chat/components/native/ChatInputBar.tsx +++ b/react/features/chat/components/native/ChatInputBar.tsx @@ -84,6 +84,7 @@ class ChatInputBar extends Component { return ( { { value = { this.state.message } /> diff --git a/react/features/chat/components/native/ChatMessage.tsx b/react/features/chat/components/native/ChatMessage.tsx index 9df888b85be..f1592eea49d 100644 --- a/react/features/chat/components/native/ChatMessage.tsx +++ b/react/features/chat/components/native/ChatMessage.tsx @@ -76,7 +76,9 @@ class ChatMessage extends Component { const messageText = getMessageText(this.props.message); return ( - + { this._renderAvatar() } diff --git a/react/features/chat/components/native/GifMessage.tsx b/react/features/chat/components/native/GifMessage.tsx index fc14948f9bf..7d77ee3da99 100644 --- a/react/features/chat/components/native/GifMessage.tsx +++ b/react/features/chat/components/native/GifMessage.tsx @@ -17,6 +17,7 @@ const GifMessage = ({ message }: IProps) => { const url = message.substring(GIF_PREFIX.length, message.length - 1); return ( { const { t } = this.props; return ( - + { t('chat.noMessagesMessage') } diff --git a/react/features/chat/components/native/MessageRecipient.tsx b/react/features/chat/components/native/MessageRecipient.tsx index 63457682f41..fc48025ae24 100644 --- a/react/features/chat/components/native/MessageRecipient.tsx +++ b/react/features/chat/components/native/MessageRecipient.tsx @@ -102,7 +102,9 @@ class MessageRecipient extends AbstractMessageRecipient { if (isLobbyChatActive) { return ( - + { t('chat.lobbyChatMessageTo', { recipient: lobbyMessageRecipient?.name @@ -123,13 +125,16 @@ class MessageRecipient extends AbstractMessageRecipient { } return ( - + { t('chat.messageTo', { recipient: privateMessageRecipient.name }) } { +const HeaderNavigationButton = ({ color, id, disabled, label, onPress, src, style, twoActions }: IProps) => { let btnStyle; let labelStyle; @@ -70,6 +75,7 @@ const HeaderNavigationButton = ({ color, disabled, label, onPress, src, style, t src ? ( void) { - return ( - - ); -} diff --git a/react/features/mobile/navigation/functions.tsx b/react/features/mobile/navigation/functions.tsx index d080e763bcf..48bafc4a332 100644 --- a/react/features/mobile/navigation/functions.tsx +++ b/react/features/mobile/navigation/functions.tsx @@ -11,7 +11,7 @@ import { getFeatureFlag } from '../../base/flags/functions'; import { IconCloseLarge } from '../../base/icons/svg'; import { toState } from '../../base/redux/functions'; import { cancelKnocking } from '../../lobby/actions.native'; -import { isPrejoinEnabledInConfig } from '../../prejoin/functions'; +import { isPrejoinEnabledInConfig } from '../../prejoin/functions.native'; import HeaderNavigationButton from './components/HeaderNavigationButton'; @@ -28,6 +28,7 @@ export function screenHeaderCloseButton(goBack: (e?: GestureResponderEvent | Rea if (Platform.OS === 'ios') { return ( ); @@ -35,6 +36,7 @@ export function screenHeaderCloseButton(goBack: (e?: GestureResponderEvent | Rea return ( ); @@ -71,6 +73,7 @@ export function lobbyScreenHeaderCloseButton() { if (Platform.OS === 'ios') { return ( ); @@ -78,27 +81,8 @@ export function lobbyScreenHeaderCloseButton() { return ( ); } - -/** - * Returns true if we should auto-knock in case prejoin is enabled for the room. - * - * @param {Function|Object} stateful - The redux state or {@link getState} - * function. - * @returns {boolean} - */ -export function shouldEnableAutoKnock(stateful: IStateful) { - const state = toState(stateful); - const { displayName } = state['features/base/settings']; - - if (isPrejoinPageEnabled(state)) { - if (displayName) { - return true; - } - } else { - return false; - } -} diff --git a/react/features/polls/components/native/PollAnswer.tsx b/react/features/polls/components/native/PollAnswer.tsx index 53e0709a089..5411fdaa29a 100644 --- a/react/features/polls/components/native/PollAnswer.tsx +++ b/react/features/polls/components/native/PollAnswer.tsx @@ -50,7 +50,9 @@ const PollAnswer = (props: AbstractProps) => { src = { IconCloseLarge } /> } - + { poll.answers.map((answer, index: number) => ( { setCheckbox(index, state) } /> { answer.name } @@ -72,6 +75,7 @@ const PollAnswer = (props: AbstractProps) => { ?