From 78d8176cc8ac8ef259c5e377c37ce7c937d991c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 14 Jun 2022 12:20:16 +0200 Subject: [PATCH] fix(rn,bottom-sheet) fix styling after refactor I somehow missed all other usages of the ColorSchemeRegistry. --- .../components/AudioRoutePickerDialog.js | 21 +++++++------------ .../components/RecentListItemMenu.native.js | 17 +++++---------- .../native/ConnectionStatusComponent.js | 13 +++--------- .../components/native/LocalVideoMenu.js | 17 +++++---------- .../components/native/RemoteVideoMenu.js | 15 ++++--------- .../components/native/SharedVideoMenu.js | 15 ++++--------- 6 files changed, 28 insertions(+), 70 deletions(-) diff --git a/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js b/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js index 45c46f2b0..3d0b01f91 100644 --- a/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js +++ b/react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js @@ -4,8 +4,8 @@ import _ from 'lodash'; import React, { Component } from 'react'; import { NativeModules, Text, TouchableHighlight, View } from 'react-native'; -import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { hideDialog, BottomSheet } from '../../../base/dialog'; +import { bottomSheetStyles } from '../../../base/dialog/components/native/styles'; import { translate } from '../../../base/i18n'; import { Icon, @@ -16,7 +16,7 @@ import { IconDeviceSpeaker } from '../../../base/icons'; import { connect } from '../../../base/redux'; -import { ColorPalette, type StyleType } from '../../../base/styles'; +import { ColorPalette } from '../../../base/styles'; import styles from './styles'; @@ -85,11 +85,6 @@ type RawDevice = { */ type Props = { - /** - * Style of the bottom sheet feature. - */ - _bottomSheetStyles: StyleType, - /** * Object describing available devices. */ @@ -276,7 +271,6 @@ class AudioRoutePickerDialog extends Component { * @returns {ReactElement} */ _renderDevice(device: Device) { - const { _bottomSheetStyles } = this.props; const { icon, selected, text } = device; const selectedStyle = selected ? styles.selectedText : {}; @@ -288,8 +282,8 @@ class AudioRoutePickerDialog extends Component { - + style = { [ styles.deviceIcon, bottomSheetStyles.buttons.iconStyle, selectedStyle ] } /> + { text } @@ -304,14 +298,14 @@ class AudioRoutePickerDialog extends Component { * @returns {ReactElement} */ _renderNoDevices() { - const { _bottomSheetStyles, t } = this.props; + const { t } = this.props; return ( - + style = { [ styles.deviceIcon, bottomSheetStyles.buttons.iconStyle ] } /> + { t('audioDevices.none') } @@ -350,7 +344,6 @@ class AudioRoutePickerDialog extends Component { */ function _mapStateToProps(state) { return { - _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'), _devices: state['features/mobile/audio-mode'].devices }; } diff --git a/react/features/recent-list/components/RecentListItemMenu.native.js b/react/features/recent-list/components/RecentListItemMenu.native.js index 54982c3ae..6d1d65c2d 100644 --- a/react/features/recent-list/components/RecentListItemMenu.native.js +++ b/react/features/recent-list/components/RecentListItemMenu.native.js @@ -3,11 +3,10 @@ import React, { PureComponent } from 'react'; import { Text, View } from 'react-native'; -import { ColorSchemeRegistry } from '../../base/color-scheme'; import { BottomSheet, hideDialog, isDialogOpen } from '../../base/dialog'; +import { bottomSheetStyles } from '../../base/dialog/components/native/styles'; import { type Item } from '../../base/react/Types'; import { connect } from '../../base/redux'; -import { StyleType } from '../../base/styles'; import DeleteItemButton from './DeleteItemButton.native'; import ShowDialInInfoButton from './ShowDialInInfoButton.native'; @@ -25,11 +24,6 @@ type Props = { */ item: Item, - /** - * The color-schemed stylesheet of the BottomSheet. - */ - _bottomSheetStyles: StyleType, - /** * True if the menu is currently open, false otherwise. */ @@ -61,12 +55,12 @@ class RecentListItemMenu extends PureComponent { * @inheritdoc */ render() { - const { _bottomSheetStyles, item } = this.props; + const { item } = this.props; const buttonProps = { afterClick: this._onCancel, itemId: item.id, showLabel: true, - styles: _bottomSheetStyles.buttons + styles: bottomSheetStyles.buttons }; return ( @@ -105,12 +99,12 @@ class RecentListItemMenu extends PureComponent { * @returns {React$Element} */ _renderMenuHeader() { - const { _bottomSheetStyles, item } = this.props; + const { item } = this.props; return ( { */ function _mapStateToProps(state) { return { - _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'), _isOpen: isDialogOpen(state, RecentListItemMenu_) }; } diff --git a/react/features/video-menu/components/native/ConnectionStatusComponent.js b/react/features/video-menu/components/native/ConnectionStatusComponent.js index 15f81f881..dd4dc1c8c 100644 --- a/react/features/video-menu/components/native/ConnectionStatusComponent.js +++ b/react/features/video-menu/components/native/ConnectionStatusComponent.js @@ -6,15 +6,14 @@ import { withTheme } from 'react-native-paper'; import { Avatar } from '../../../base/avatar'; -import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { getSourceNameSignalingFeatureFlag } from '../../../base/config'; import { BottomSheet, isDialogOpen, hideDialog } from '../../../base/dialog'; +import { bottomSheetStyles } from '../../../base/dialog/components/native/styles'; import { translate } from '../../../base/i18n'; import { IconArrowDownLarge, IconArrowUpLarge } from '../../../base/icons'; import { getParticipantDisplayName } from '../../../base/participants'; import { BaseIndicator } from '../../../base/react'; import { connect } from '../../../base/redux'; -import { StyleType } from '../../../base/styles'; import { getSourceNameByParticipantId } from '../../../base/tracks'; import statsEmitter from '../../../connection-indicator/statsEmitter'; @@ -43,11 +42,6 @@ export type Props = { */ participantID: string, - /** - * The color-schemed stylesheet of the BottomSheet. - */ - _bottomSheetStyles: StyleType, - /** * True if the menu is currently open, false otherwise. */ @@ -442,12 +436,12 @@ class ConnectionStatusComponent extends Component { * @returns {React$Element} */ _renderMenuHeader() { - const { _bottomSheetStyles, participantID } = this.props; + const { participantID } = this.props; return ( { * @inheritdoc */ render() { - const { _participant, _bottomSheetStyles } = this.props; + const { _participant } = this.props; const buttonProps = { afterClick: this._onCancel, showLabel: true, participantID: _participant.id, - styles: _bottomSheetStyles.buttons + styles: bottomSheetStyles.buttons }; return ( @@ -128,12 +122,12 @@ class LocalVideoMenu extends PureComponent { * @returns {React$Element} */ _renderMenuHeader() { - const { _bottomSheetStyles, _participant } = this.props; + const { _participant } = this.props; return ( { afterClick: this._onCancel, showLabel: true, participantID: participantId, - styles: this.props._bottomSheetStyles.buttons + styles: bottomSheetStyles.buttons }; return ( @@ -207,12 +201,12 @@ class RemoteVideoMenu extends PureComponent { * @returns {React$Element} */ _renderMenuHeader() { - const { _bottomSheetStyles, participantId } = this.props; + const { participantId } = this.props; return ( { afterClick: this._onCancel, showLabel: true, participantID: participantId, - styles: this.props._bottomSheetStyles.buttons + styles: bottomSheetStyles.buttons }; return ( @@ -131,12 +125,12 @@ class SharedVideoMenu extends PureComponent { * @returns {React$Element} */ _renderMenuHeader() { - const { _bottomSheetStyles, participantId } = this.props; + const { participantId } = this.props; return (