Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
ref(notifications) Update icons (#13025)
Robert Pintilii306c979adb32
diff --git a/package-lock.json b/package-lock.jsonindex cdd2930838..078a58ed17 100644--- a/package-lock.json+++ b/package-lock.json@@ -12,7 +12,6 @@"dependencies": {"@amplitude/react-native": "2.7.0","@atlaskit/flag": "14.1.0",- "@atlaskit/icon": "21.2.0","@atlaskit/inline-dialog": "13.0.9","@atlaskit/inline-message": "11.0.8","@atlaskit/multi-select": "15.0.5",diff --git a/package.json b/package.jsonindex 8796097324..2d737b06e0 100644--- a/package.json+++ b/package.json@@ -17,7 +17,6 @@"dependencies": {"@amplitude/react-native": "2.7.0","@atlaskit/flag": "14.1.0",- "@atlaskit/icon": "21.2.0","@atlaskit/inline-dialog": "13.0.9","@atlaskit/inline-message": "11.0.8","@atlaskit/multi-select": "15.0.5",diff --git a/react/features/base/icons/svg/index.ts b/react/features/base/icons/svg/index.tsindex 27343ff867..3d24c0f335 100644--- a/react/features/base/icons/svg/index.ts+++ b/react/features/base/icons/svg/index.ts@@ -48,6 +48,7 @@ export { default as IconHangup } from './hangup.svg';export { default as IconHelp } from './help.svg';export { default as IconHighlight } from './highlight.svg';export { default as IconImage } from './image.svg';+export { default as IconInfo } from './info.svg';export { default as IconInfoCircle } from './info-circle.svg';export { default as IconMessage } from './message.svg';export { default as IconMeter } from './meter.svg';@@ -98,6 +99,7 @@ export { default as IconVideoOff } from './video-off.svg';export { default as IconVolumeOff } from './volume-off.svg';export { default as IconVolumeUp } from './volume-up.svg';export { default as IconWarning } from './warning.svg';+export { default as IconWarningCircle } from './warning-circle.svg';export { default as IconWhiteboard } from './whiteboard.svg';export { default as IconWhiteboardHide } from './whiteboard-hide.svg';export { default as IconWifi1Bar } from './wifi-1.svg';diff --git a/react/features/base/icons/svg/info.svg b/react/features/base/icons/svg/info.svgnew file mode 100755index 0000000000..6f2e3481f7--- /dev/null+++ b/react/features/base/icons/svg/info.svg@@ -0,0 +1,3 @@+<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.0003 18.3333C5.39795 18.3333 1.66699 14.6024 1.66699 10C1.66699 5.39763 5.39795 1.66667 10.0003 1.66667C14.6027 1.66667 18.3337 5.39763 18.3337 10C18.3337 14.6024 14.6027 18.3333 10.0003 18.3333ZM10.0003 16.6667C13.6822 16.6667 16.667 13.6819 16.667 10C16.667 6.31811 13.6822 3.33334 10.0003 3.33334C6.31843 3.33334 3.33366 6.31811 3.33366 10C3.33366 13.6819 6.31843 16.6667 10.0003 16.6667ZM9.16699 10C9.16699 9.53977 9.54009 9.16667 10.0003 9.16667C10.4606 9.16667 10.8337 9.53977 10.8337 10V13.3333C10.8337 13.7936 10.4606 14.1667 10.0003 14.1667C9.54009 14.1667 9.16699 13.7936 9.16699 13.3333V10ZM10.0003 5.83334C9.54009 5.83334 9.16699 6.20644 9.16699 6.66667C9.16699 7.12691 9.54009 7.50001 10.0003 7.50001C10.4606 7.50001 10.8337 7.12691 10.8337 6.66667C10.8337 6.20644 10.4606 5.83334 10.0003 5.83334Z" />+</svg>diff --git a/react/features/base/icons/svg/user.svg b/react/features/base/icons/svg/user.svgindex ab3292e391..64c7cf1d97 100644--- a/react/features/base/icons/svg/user.svg+++ b/react/features/base/icons/svg/user.svg@@ -1,4 +1,4 @@-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">- <path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 6.75C16.5 9.23528 14.4853 11.25 12 11.25C9.51472 11.25 7.5 9.23528 7.5 6.75C7.5 4.26472 9.51472 2.25 12 2.25C14.4853 2.25 16.5 4.26472 16.5 6.75ZM15 6.75C15 8.40685 13.6569 9.75 12 9.75C10.3431 9.75 9 8.40685 9 6.75C9 5.09315 10.3431 3.75 12 3.75C13.6569 3.75 15 5.09315 15 6.75Z" fill="white"/>- <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 17.25C19.5 19.7353 16.1421 21.75 12 21.75C7.85786 21.75 4.5 19.7353 4.5 17.25C4.5 14.7647 7.85786 12.75 12 12.75C16.1421 12.75 19.5 14.7647 19.5 17.25ZM18 17.25C18 17.7588 17.6485 18.4756 16.5316 19.1457C15.4445 19.798 13.8459 20.25 12 20.25C10.1541 20.25 8.55549 19.798 7.46844 19.1457C6.35154 18.4756 6 17.7588 6 17.25C6 16.7412 6.35154 16.0244 7.46844 15.3543C8.55549 14.702 10.1541 14.25 12 14.25C13.8459 14.25 15.4445 14.702 16.5316 15.3543C17.6485 16.0244 18 16.7412 18 17.25Z" fill="white"/>+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 6.75C16.5 9.23528 14.4853 11.25 12 11.25C9.51472 11.25 7.5 9.23528 7.5 6.75C7.5 4.26472 9.51472 2.25 12 2.25C14.4853 2.25 16.5 4.26472 16.5 6.75ZM15 6.75C15 8.40685 13.6569 9.75 12 9.75C10.3431 9.75 9 8.40685 9 6.75C9 5.09315 10.3431 3.75 12 3.75C13.6569 3.75 15 5.09315 15 6.75Z" />+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 17.25C19.5 19.7353 16.1421 21.75 12 21.75C7.85786 21.75 4.5 19.7353 4.5 17.25C4.5 14.7647 7.85786 12.75 12 12.75C16.1421 12.75 19.5 14.7647 19.5 17.25ZM18 17.25C18 17.7588 17.6485 18.4756 16.5316 19.1457C15.4445 19.798 13.8459 20.25 12 20.25C10.1541 20.25 8.55549 19.798 7.46844 19.1457C6.35154 18.4756 6 17.7588 6 17.25C6 16.7412 6.35154 16.0244 7.46844 15.3543C8.55549 14.702 10.1541 14.25 12 14.25C13.8459 14.25 15.4445 14.702 16.5316 15.3543C17.6485 16.0244 18 16.7412 18 17.25Z" /></svg>diff --git a/react/features/base/icons/svg/warning-circle.svg b/react/features/base/icons/svg/warning-circle.svgnew file mode 100755index 0000000000..91e6a974bc--- /dev/null+++ b/react/features/base/icons/svg/warning-circle.svg@@ -0,0 +1,3 @@+<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.66699 9.99999C1.66699 14.6024 5.39795 18.3333 10.0003 18.3333C14.6027 18.3333 18.3337 14.6024 18.3337 9.99999C18.3337 5.39762 14.6027 1.66666 10.0003 1.66666C5.39795 1.66666 1.66699 5.39762 1.66699 9.99999ZM16.667 10C16.667 13.6819 13.6822 16.6667 10.0003 16.6667C6.31843 16.6667 3.33366 13.6819 3.33366 10C3.33366 6.3181 6.31843 3.33334 10.0003 3.33334C13.6822 3.33334 16.667 6.3181 16.667 10ZM9.16699 5.83335C9.16699 5.37311 9.54009 5.00002 10.0003 5.00002C10.4606 5.00002 10.8337 5.37311 10.8337 5.83335V10C10.8337 10.4603 10.4606 10.8333 10.0003 10.8333C9.54009 10.8333 9.16699 10.4603 9.16699 10V5.83335ZM10.0003 12.5C9.54009 12.5 9.16699 12.8731 9.16699 13.3333C9.16699 13.7935 9.54009 14.1666 10.0003 14.1666C10.4606 14.1666 10.8337 13.7935 10.8337 13.3333C10.8337 12.8731 10.4606 12.5 10.0003 12.5Z" />+</svg>diff --git a/react/features/notifications/components/AbstractNotification.js b/react/features/notifications/components/AbstractNotification.tsxsimilarity index 81%rename from react/features/notifications/components/AbstractNotification.jsrename to react/features/notifications/components/AbstractNotification.tsxindex a367675f91..55ca69c942 100644--- a/react/features/notifications/components/AbstractNotification.js+++ b/react/features/notifications/components/AbstractNotification.tsx@@ -1,115 +1,109 @@-// @flow-import { Component } from 'react';+import { WithTranslation } from 'react-i18next';import { NOTIFICATION_TYPE } from '../constants';-export type Props = {+export interface IProps extends WithTranslation {/*** Display appearance for the component, passed directly to the* notification.*/- appearance: string,+ appearance: string;/*** Whether or not the title and description should be concatenated.*/- concatText?: boolean,+ concatText?: boolean;/*** Callback invoked when the custom button is clicked.*/- customActionHandler: Function[],+ customActionHandler: Function[];/*** The text to display as button in the notification for the custom action.*/- customActionNameKey: string[],+ customActionNameKey: string[];/*** The type of button.*/- customActionType: ?string[],+ customActionType?: string[];/*** The text to display in the body of the notification. If not passed* in, the passed in descriptionKey will be used.*/- defaultTitleKey: string,+ defaultTitleKey: string;/*** A description string that can be used in addition to the prop* descriptionKey.*/- description: string,+ description: string;/*** The translation arguments that may be necessary for the description.*/- descriptionArguments: Object,+ descriptionArguments: Object;/*** The translation key to use as the body of the notification.*/- descriptionKey: string,+ descriptionKey: string;/*** Whether the support link should be hidden in the case of an error* message.*/- hideErrorSupportLink: boolean,+ hideErrorSupportLink: boolean;/*** The type of icon to be displayed. If not passed in, the appearance* type will be used.*/- icon?: String,+ icon?: string;/*** Maximum lines of the description.*/- maxLines: ?number,+ maxLines?: number;/*** Callback invoked when the user clicks to dismiss the notification.*/- onDismissed: Function,-- /**- * Invoked to obtain translated strings.- */- t: Function,+ onDismissed: Function;/*** The text to display at the top of the notification. If not passed in,* the passed in titleKey will be used.*/- title: string,+ title: string;/*** The translation arguments that may be necessary for the title.*/- titleArguments: Object,+ titleArguments: Object;/*** The translation key to display as the title of the notification if* no title is provided.*/- titleKey: string,+ titleKey: string;/*** The unique identifier for the notification.*/- uid: string-};+ uid: string;+}/*** Abstract class for {@code Notification} component.** @augments Component*/-export default class AbstractNotification<P: Props> extends Component<P> {+export default class AbstractNotification<P extends IProps> extends Component<P> {/*** Default values for {@code Notification} component's properties.*@@ -132,8 +126,6 @@ export default class AbstractNotification<P: Props> extends Component<P> {this._onDismissed = this._onDismissed.bind(this);}- _getDescription: () => Array<string>;-/*** Returns the description array to be displayed.*@@ -158,8 +150,6 @@ export default class AbstractNotification<P: Props> extends Component<P> {return descriptionArray;}- _getDescriptionKey: () => string;-/*** Returns the description key that was used if any.*@@ -170,8 +160,6 @@ export default class AbstractNotification<P: Props> extends Component<P> {return this.props.descriptionKey;}- _onDismissed: () => void;-/*** Callback to dismiss the notification.*diff --git a/react/features/notifications/components/native/Notification.tsx b/react/features/notifications/components/native/Notification.tsxindex 6beb5df6f5..ddd703b217 100644--- a/react/features/notifications/components/native/Notification.tsx+++ b/react/features/notifications/components/native/Notification.tsx@@ -21,7 +21,7 @@ import { BUTTON_MODES, BUTTON_TYPES } from '../../../base/ui/constants.native';import { replaceNonUnicodeEmojis } from '../../../chat/functions';import { NOTIFICATION_ICON } from '../../constants';import AbstractNotification, {- type Props as AbstractNotificationProps+ type IProps as AbstractNotificationProps// @ts-ignore} from '../AbstractNotification';@@ -115,6 +115,7 @@ class Notification extends AbstractNotification<Props> {}} }style = { styles.btn }+ // @ts-ignoretype = { customActionType[index] } />));}diff --git a/react/features/notifications/components/web/Notification.js b/react/features/notifications/components/web/Notification.tsxsimilarity index 79%rename from react/features/notifications/components/web/Notification.jsrename to react/features/notifications/components/web/Notification.tsxindex bbf345c429..a570e79a19 100644--- a/react/features/notifications/components/web/Notification.js+++ b/react/features/notifications/components/web/Notification.tsx@@ -1,24 +1,13 @@-// @flow-import Flag from '@atlaskit/flag';-import EditorErrorIcon from '@atlaskit/icon/glyph/editor/error';-import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';-import EditorSuccessIcon from '@atlaskit/icon/glyph/editor/success';-import EditorWarningIcon from '@atlaskit/icon/glyph/editor/warning';-import PeopleIcon from '@atlaskit/icon/glyph/people';-import PersonIcon from '@atlaskit/icon/glyph/person';-import QuestionsIcon from '@atlaskit/icon/glyph/questions';import React, { isValidElement } from 'react';-import { translate } from '../../../base/i18n';+import { translate } from '../../../base/i18n/functions';+import Icon from '../../../base/icons/components/Icon';+import { IconCheck, IconInfo, IconMessage, IconUser, IconUsers, IconWarningCircle } from '../../../base/icons/svg';import Message from '../../../base/react/components/web/Message';import { colors } from '../../../base/ui/Tokens';import { NOTIFICATION_ICON, NOTIFICATION_TYPE } from '../../constants';-import AbstractNotification, {- type Props-} from '../AbstractNotification';--declare var interfaceConfig: Object;+import AbstractNotification, { IProps } from '../AbstractNotification';/*** Secondary colors for notification icons.@@ -37,7 +26,7 @@ const ICON_COLOR = {** @augments Component*/-class Notification extends AbstractNotification<Props> {+class Notification extends AbstractNotification<IProps> {/*** Implements React's {@link Component#render()}.*@@ -65,12 +54,6 @@ class Notification extends AbstractNotification<Props> {);}- _getDescription: () => Array<string>;-- _getDescriptionKey: () => string;-- _onDismissed: () => void;-/*** Creates a {@code ReactElement} for displaying the contents of the* notification.@@ -115,7 +98,7 @@ class Notification extends AbstractNotification<Props> {* @private* @returns {Object[]}*/- _mapAppearanceToButtons(hideErrorSupportLink) {+ _mapAppearanceToButtons(hideErrorSupportLink: boolean) {switch (this.props.appearance) {case NOTIFICATION_TYPE.ERROR: {const buttons = [@@ -167,33 +150,31 @@ class Notification extends AbstractNotification<Props> {* @returns {ReactElement}*/_getIcon() {- let Icon;+ let icon;switch (this.props.icon || this.props.appearance) {case NOTIFICATION_ICON.ERROR:- Icon = EditorErrorIcon;- break;case NOTIFICATION_ICON.WARNING:- Icon = EditorWarningIcon;+ icon = IconWarningCircle;break;case NOTIFICATION_ICON.SUCCESS:- Icon = EditorSuccessIcon;+ icon = IconCheck;break;case NOTIFICATION_ICON.MESSAGE:- Icon = QuestionsIcon;+ icon = IconMessage;break;case NOTIFICATION_ICON.PARTICIPANT:- Icon = PersonIcon;+ icon = IconUser;break;case NOTIFICATION_ICON.PARTICIPANTS:- Icon = PeopleIcon;+ icon = IconUsers;break;default:- Icon = EditorInfoIcon;+ icon = IconInfo;break;}- return Icon;+ return icon;}/**@@ -205,16 +186,15 @@ class Notification extends AbstractNotification<Props> {*/_mapAppearanceToIcon() {const { appearance, icon } = this.props;- const secIconColor = ICON_COLOR[appearance];- const iconSize = 'medium';- const Icon = this._getIcon();+ const iconColor = ICON_COLOR[appearance as keyof typeof ICON_COLOR];+ const iconSrc = this._getIcon();return (<div className = { icon }><div className = { `ribbon ${appearance}` } /><Icon- label = { appearance }- secondaryColor = { secIconColor }- size = { iconSize } />+ color = { iconColor }+ size = { 20 }+ src = { iconSrc } /></div>);}}diff --git a/react/features/notifications/components/web/NotificationsContainer.tsx b/react/features/notifications/components/web/NotificationsContainer.tsxindex a101cecbcd..181b3348e5 100644--- a/react/features/notifications/components/web/NotificationsContainer.tsx+++ b/react/features/notifications/components/web/NotificationsContainer.tsx@@ -13,7 +13,6 @@ import { connect } from '../../../base/redux/functions';import { hideNotification } from '../../actions';import { areThereNotifications } from '../../functions';-// @ts-ignoreimport Notification from './Notification';interface IProps extends WithTranslation {@@ -34,7 +33,7 @@ interface IProps extends WithTranslation {*/_notifications: Array<{props: Object;- uid: number;+ uid: string;}>;/**@@ -209,9 +208,9 @@ class NotificationsContainer extends Component<IProps> {in = { true }key = { uid }timeout = { 200 }>+ {/* @ts-ignore */}<Notification{ ...props }- id = { uid }onDismissed = { this._onDismissed }uid = { uid } /></CSSTransition>diff --git a/react/features/notifications/constants.ts b/react/features/notifications/constants.tsindex 0fddb4ce27..0d7a838fcf 100644--- a/react/features/notifications/constants.ts+++ b/react/features/notifications/constants.ts@@ -25,7 +25,6 @@ export const NOTIFICATION_TIMEOUT_TYPE = {*/export const NOTIFICATION_TYPE = {ERROR: 'error',- INFO: 'info',NORMAL: 'normal',SUCCESS: 'success',WARNING: 'warning'@@ -38,7 +37,6 @@ export const NOTIFICATION_TYPE = {*/export const NOTIFICATION_TYPE_PRIORITIES = {[NOTIFICATION_TYPE.ERROR]: 5,- [NOTIFICATION_TYPE.INFO]: 3,[NOTIFICATION_TYPE.NORMAL]: 3,[NOTIFICATION_TYPE.SUCCESS]: 3,[NOTIFICATION_TYPE.WARNING]: 4