Skip to content

Commit 64e4a48

Browse files
authored
Update the reconnecting RemoteUFD according to figma (#5216)
* Update the reconnecting RemoteUFD according to figma --------- Signed-off-by: Porter Nan <[email protected]>
1 parent 775335f commit 64e4a48

File tree

6 files changed

+51
-28
lines changed

6 files changed

+51
-28
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "prerelease",
3+
"area": "feature",
4+
"workstream": "",
5+
"comment": "Update the reconnecting RemoteUFD according to figma",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

packages/communication-react/review/beta/communication-react.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5351,6 +5351,7 @@ export interface VideoTileStrings {
53515351
moreOptionsParticipantIsSpeakingAriaLabel: string;
53525352
moreOptionsParticipantMutedStateMutedAriaLabel: string;
53535353
moreOptionsParticipantMutedStateUnmutedAriaLabel: string;
5354+
participantReconnecting?: string;
53545355
participantStateHold: string;
53555356
participantStateRinging: string;
53565357
}

packages/react-components/src/components/StreamMedia.tsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import { mergeStyles, Spinner, Text } from '@fluentui/react';
4+
import { mergeStyles, Spinner } from '@fluentui/react';
5+
/* @conditional-compile-remove(remote-ufd) */
6+
import { Stack } from '@fluentui/react';
57
import React, { useEffect, useRef, useState } from 'react';
68
import {
79
invertedVideoInPipStyle,
810
mediaContainer,
911
container,
1012
loadingSpinnerContainer,
11-
loadSpinnerStyles,
12-
reconnectingContainer,
13-
reconnectingText
13+
loadSpinnerStyles
1414
} from './styles/StreamMedia.styles';
15+
/* @conditional-compile-remove(remote-ufd) */
16+
import { reconnectingContainer, reconnectSpinnerStyles } from './styles/StreamMedia.styles';
17+
/* @conditional-compile-remove(remote-ufd) */
18+
import { useLocale } from '../localization';
1519
import { useTheme } from '../theming';
1620
import { BaseCustomStyles } from '../types';
1721

@@ -53,6 +57,8 @@ export interface StreamMediaProps {
5357
export const StreamMedia = (props: StreamMediaProps): JSX.Element => {
5458
const containerEl = useRef<HTMLDivElement>(null);
5559
const theme = useTheme();
60+
/* @conditional-compile-remove(remote-ufd) */
61+
const reconnectingText = useLocale().strings.videoTile.participantReconnecting || 'Reconnecting...';
5662

5763
const { isMirrored, videoStreamElement, styles, loadingState = 'none' } = props;
5864
const [pipEnabled, setPipEnabled] = useState(false);
@@ -99,13 +105,18 @@ export const StreamMedia = (props: StreamMediaProps): JSX.Element => {
99105
<Spinner data-ui-id="stream-media-loading-spinner" styles={loadSpinnerStyles} />
100106
</div>
101107
)}
102-
{loadingState === 'reconnecting' && (
103-
<div className={reconnectingContainer()}>
104-
<Text data-ui-id="stream-media-reconnecting" className={reconnectingText(theme)}>
105-
Reconnecting...
106-
</Text>
107-
</div>
108-
)}
108+
{
109+
/* @conditional-compile-remove(remote-ufd) */
110+
loadingState === 'reconnecting' && (
111+
<Stack className={reconnectingContainer()}>
112+
<Spinner
113+
data-ui-id="stream-media-loading-spinner"
114+
styles={reconnectSpinnerStyles()}
115+
label={reconnectingText}
116+
/>
117+
</Stack>
118+
)
119+
}
109120
</div>
110121
);
111122
};

packages/react-components/src/components/VideoTile.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export interface VideoTileStrings {
5050
participantStateRinging: string;
5151
/** String for displaying the Hold state of the remote participant */
5252
participantStateHold: string;
53+
/* @conditional-compile-remove(remote-ufd) */
54+
/** String for displaying the reconnecting state of the remote participant */
55+
participantReconnecting?: string;
5356
/** String for the announcement of the muted state of the participant when muted */
5457
moreOptionsParticipantMutedStateMutedAriaLabel: string;
5558
/** String for the announcement of the unmuted state of the participant when unmuted */

packages/react-components/src/components/styles/StreamMedia.styles.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
import { ISpinnerStyles, mergeStyles, Theme } from '@fluentui/react';
5-
import { isDarkThemed } from '../../theming/themeUtils';
65

76
/**
87
* @private
@@ -44,22 +43,6 @@ export const reconnectingContainer = (): string =>
4443
alignItems: 'center'
4544
});
4645

47-
/**
48-
* @private
49-
*/
50-
export const reconnectingText = (theme: Theme): string =>
51-
mergeStyles({
52-
// Position centrally on top of content. Parent must have position: relative.
53-
height: '3rem',
54-
lineHeight: '3rem',
55-
justifyContent: 'center',
56-
alignItems: 'center',
57-
// DarkTheme check is done cause the text color should be light in both dark and light themes
58-
// due to background overlay being dark in both themes.
59-
color: isDarkThemed(theme) ? theme.palette.themeDarker : theme.palette.neutralLighter,
60-
fontSize: theme.fonts.large.fontSize
61-
});
62-
6346
/**
6447
* @private
6548
*/
@@ -76,6 +59,21 @@ export const loadSpinnerStyles: ISpinnerStyles = {
7659
}
7760
};
7861

62+
/**
63+
* @private
64+
*/
65+
export const reconnectSpinnerStyles = (): ISpinnerStyles => ({
66+
...loadSpinnerStyles,
67+
label: {
68+
color: 'white'
69+
},
70+
circle: {
71+
...(loadSpinnerStyles.circle as object),
72+
maxHeight: '2rem',
73+
borderWidth: 'unset'
74+
}
75+
});
76+
7977
/**
8078
* @private
8179
*/

packages/react-components/src/localization/locales/en-US/strings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@
536536
},
537537
"videoTile": {
538538
"participantStateRinging": "Calling...",
539+
"participantReconnecting": "Reconnecting...",
539540
"participantStateHold": "On hold",
540541
"moreOptionsButtonAriaLabel": "More Options {displayName} {isMuted} {isHandRaised} {state} {isSpeaking}",
541542
"moreOptionsParticipantMutedStateMutedAriaLabel": "muted",

0 commit comments

Comments
 (0)