diff --git a/react/features/base/label/components/AbstractCircularLabel.js b/react/features/base/label/components/AbstractCircularLabel.js index 632d37b84..21fcd171d 100644 --- a/react/features/base/label/components/AbstractCircularLabel.js +++ b/react/features/base/label/components/AbstractCircularLabel.js @@ -4,10 +4,15 @@ import { Component } from 'react'; export type Props = { + /** + * An SVG icon to be rendered as the content of the label. + */ + icon: Component, + /** * String or component that will be rendered as the label itself. */ - label: string | React$Node + label: string }; /** diff --git a/react/features/base/label/components/CircularLabel.native.js b/react/features/base/label/components/CircularLabel.native.js index 6b6c5cd28..5e13b040f 100644 --- a/react/features/base/label/components/CircularLabel.native.js +++ b/react/features/base/label/components/CircularLabel.native.js @@ -2,6 +2,7 @@ import React from 'react'; import { Animated, Text } from 'react-native'; +import Icon from '../../icons/components/Icon'; import { combineStyles, type StyleType } from '../../styles'; import AbstractCircularLabel, { @@ -90,7 +91,7 @@ export default class CircularLabel extends AbstractCircularLabel { * @inheritdoc */ render() { - const { status, label, style } = this.props; + const { icon, label, status, style } = this.props; let extraStyle = null; @@ -105,15 +106,24 @@ export default class CircularLabel extends AbstractCircularLabel { break; } + const labelComponent = icon + ? ( + + ) : ( + + { label } + + ); + return ( - - { label } - + { labelComponent } ); } diff --git a/react/features/base/label/components/CircularLabel.web.js b/react/features/base/label/components/CircularLabel.web.js index 0c8cb2639..71981dd6d 100644 --- a/react/features/base/label/components/CircularLabel.web.js +++ b/react/features/base/label/components/CircularLabel.web.js @@ -2,6 +2,8 @@ import React from 'react'; +import Icon from '../../icons/components/Icon'; + import AbstractCircularLabel, { type Props as AbstractProps } from './AbstractCircularLabel'; @@ -44,15 +46,22 @@ export default class CircularLabel extends AbstractCircularLabel { render() { const { className, + icon, id, label } = this.props; + const labelComponent = icon + ? ( + + ) : label; + return (
- { label } + { labelComponent }
); } diff --git a/react/features/base/label/components/styles.js b/react/features/base/label/components/styles.js index 74e47766f..7236e848f 100644 --- a/react/features/base/label/components/styles.js +++ b/react/features/base/label/components/styles.js @@ -1,6 +1,6 @@ // @flow -import { BoxModel, ColorPalette, createStyleSheet } from '../../styles'; +import { BoxModel, ColorPalette } from '../../styles'; /** * The default color of the {@code Label} and {@code ExpandedLabel}. @@ -22,7 +22,7 @@ export const LABEL_SIZE = 36; /** * The styles of the native base/label feature. */ -export default createStyleSheet({ +export default { expandedLabelArrow: { backgroundColor: ColorPalette.blue, @@ -64,12 +64,16 @@ export default createStyleSheet({ width: LABEL_SIZE }, + indicatorIcon: { + fontSize: 24 + }, + indicatorText: { color: ColorPalette.white, - fontSize: 12 + fontSize: 10 }, labelOff: { opacity: 0.3 } -}); +}; diff --git a/react/features/e2ee/components/E2EELabel.js b/react/features/e2ee/components/E2EELabel.js index 82d216b3d..4139f78e6 100644 --- a/react/features/e2ee/components/E2EELabel.js +++ b/react/features/e2ee/components/E2EELabel.js @@ -4,7 +4,7 @@ import Tooltip from '@atlaskit/tooltip'; import React, { Component } from 'react'; import { translate } from '../../base/i18n'; -import { Icon, IconE2EE } from '../../base/icons'; +import { IconE2EE } from '../../base/icons'; import { CircularLabel } from '../../base/label'; import { connect } from '../../base/redux'; @@ -29,16 +29,13 @@ class E2EELabel extends Component { return null; } - // eslint-disable-next-line react/jsx-max-props-per-line - const icon = ; - return ( + icon = { IconE2EE } /> ); }