Skip to content

Commit f76b857

Browse files
authored
RTT disclosure banner should be a private component (#5527)
* RTT disclosure banner * Change files --------- Signed-off-by: carocao-msft <[email protected]>
1 parent 050c4ab commit f76b857

File tree

14 files changed

+83
-140
lines changed

14 files changed

+83
-140
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "prerelease",
3+
"area": "feature",
4+
"workstream": "Real time text",
5+
"comment": "RTT disclosure banner should be a private component",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

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

+6-20
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,9 @@ export interface CallCompositeStrings {
980980
pinParticipantMenuItemAriaLabel: string;
981981
pinParticipantMenuLabel: string;
982982
privacyPolicy: string;
983+
realTimeTextBannerContent?: string;
984+
realTimeTextBannerLinkLabel?: string;
985+
realTimeTextBannerTitle?: string;
983986
realTimeTextInputBoxDefaultText?: string;
984987
realTimeTextLabel?: string;
985988
rejoinCallButtonLabel: string;
@@ -1891,6 +1894,9 @@ export type CaptionsBannerSelector = (state: CallClientState, props: CallingBase
18911894
// @public
18921895
export interface CaptionsBannerStrings {
18931896
captionsBannerSpinnerText?: string;
1897+
realTimeTextBannerContent?: string;
1898+
realTimeTextBannerLinkLabel?: string;
1899+
realTimeTextBannerTitle?: string;
18941900
realTimeTextInputBoxDefaultText?: string;
18951901
}
18961902

@@ -2585,7 +2591,6 @@ export interface ComponentStrings {
25852591
realTimeText: RealTimeTextStrings;
25862592
realTimeTextModal: RealTimeTextModalStrings;
25872593
richTextSendBox: RichTextSendBoxStrings;
2588-
rttDisclosureBanner: RTTDisclosureBannerStrings;
25892594
screenShareButton: ScreenShareButtonStrings;
25902595
sendBox: SendBoxStrings;
25912596
spokenLanguages: SpokenLanguageStrings;
@@ -4738,25 +4743,6 @@ export interface RichTextStrings {
47384743
richTextUnderlineTooltip: string;
47394744
}
47404745

4741-
// @beta
4742-
export const RTTDisclosureBanner: (props: RTTDisclosureBannerProps) => JSX.Element;
4743-
4744-
// @beta
4745-
export interface RTTDisclosureBannerProps {
4746-
onClickLink?: () => void;
4747-
strings?: RTTDisclosureBannerStrings;
4748-
}
4749-
4750-
// @beta
4751-
export interface RTTDisclosureBannerStrings {
4752-
// (undocumented)
4753-
bannerContent: string;
4754-
// (undocumented)
4755-
bannerLinkLabel?: string;
4756-
// (undocumented)
4757-
bannerTitle: string;
4758-
}
4759-
47604746
// @public
47614747
export const ScreenShareButton: (props: ScreenShareButtonProps) => JSX.Element;
47624748

packages/communication-react/src/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,6 @@ export type { MeetingConferencePhoneInfoModalStrings } from '../../react-compone
457457
export type { RealTimeTextModalStrings, RealTimeTextModalProps } from '../../react-components/src';
458458
/* @conditional-compile-remove(rtt) */
459459
export { RealTimeTextModal } from '../../react-components/src';
460-
461-
/* @conditional-compile-remove(rtt) */
462-
export type { RTTDisclosureBannerProps, RTTDisclosureBannerStrings } from '../../react-components/src';
463-
/* @conditional-compile-remove(rtt) */
464-
export { RTTDisclosureBanner } from '../../react-components/src';
465460
/* @conditional-compile-remove(rtt) */
466461
export type { RealTimeTextProps, RealTimeTextStrings } from '../../react-components/src/components/RealTimeText';
467462
/* @conditional-compile-remove(rtt) */

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

+28-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { useLocale } from '../localization';
1818
/* @conditional-compile-remove(rtt) */
1919
import { RealTimeText } from './RealTimeText';
2020
/* @conditional-compile-remove(rtt) */
21-
import { RTTDisclosureBanner } from './RTTDisclosureBanner';
21+
import { _RTTDisclosureBanner } from './RTTDisclosureBanner';
2222

2323
/**
2424
* @public
@@ -72,6 +72,21 @@ export interface CaptionsBannerStrings {
7272
* Default text for RTT input text box
7373
*/
7474
realTimeTextInputBoxDefaultText?: string;
75+
/* @conditional-compile-remove(rtt) */
76+
/**
77+
* Real time text disclosure banner title
78+
*/
79+
realTimeTextBannerTitle?: string;
80+
/* @conditional-compile-remove(rtt) */
81+
/**
82+
* Real time text disclosure banner content
83+
*/
84+
realTimeTextBannerContent?: string;
85+
/* @conditional-compile-remove(rtt) */
86+
/**
87+
* Real time text disclosure banner link label
88+
*/
89+
realTimeTextBannerLinkLabel?: string;
7590
}
7691

7792
/**
@@ -210,11 +225,22 @@ export const CaptionsBanner = (props: CaptionsBannerProps): JSX.Element => {
210225
}
211226
};
212227

228+
/* @conditional-compile-remove(rtt) */
229+
const realTimeTextDisclosureBannerStrings = {
230+
bannerTitle: strings.realTimeTextBannerTitle ?? '',
231+
bannerContent: strings.realTimeTextBannerContent ?? '',
232+
bannerLinkLabel: strings.realTimeTextBannerLinkLabel ?? ''
233+
};
234+
213235
return (
214236
<>
215237
{(startCaptionsInProgress || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (
216238
<FocusZone shouldFocusOnMount className={captionsContainerClassName} data-ui-id="captions-banner">
217-
{/* @conditional-compile-remove(rtt) */ isRealTimeTextOn && <RTTDisclosureBanner />}
239+
{
240+
/* @conditional-compile-remove(rtt) */ isRealTimeTextOn && (
241+
<_RTTDisclosureBanner strings={realTimeTextDisclosureBannerStrings} />
242+
)
243+
}
218244
{(isCaptionsOn || /* @conditional-compile-remove(rtt) */ isRealTimeTextOn) && (
219245
<ul
220246
ref={captionsScrollDivRef}

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

+11-14
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
/* @conditional-compile-remove(rtt) */
55
import React from 'react';
66
/* @conditional-compile-remove(rtt) */
7-
import { useLocale } from '../localization';
8-
/* @conditional-compile-remove(rtt) */
97
import { Notification } from './Notification';
108
/* @conditional-compile-remove(rtt) */
119
import { useTheme } from '@fluentui/react';
@@ -14,45 +12,44 @@ import { rttContainerStyles, rttIconStyles } from './styles/RTTDisclosureBanner.
1412

1513
/* @conditional-compile-remove(rtt) */
1614
/**
17-
* @beta
15+
* @private
1816
* strings for rtt modal
1917
*/
20-
export interface RTTDisclosureBannerStrings {
18+
export interface _RTTDisclosureBannerStrings {
2119
bannerTitle: string;
2220
bannerContent: string;
2321
bannerLinkLabel?: string;
2422
}
2523

2624
/* @conditional-compile-remove(rtt) */
2725
/**
28-
* @beta
26+
* @private
2927
* Props for RTT Banner
3028
*/
31-
export interface RTTDisclosureBannerProps {
29+
export interface _RTTDisclosureBannerProps {
3230
/**
3331
* Optional callback to supply users with further troubleshooting steps or more information for the Real Time Text feature.
3432
*/
3533
onClickLink?: () => void;
3634
/** RTT Banner strings */
37-
strings?: RTTDisclosureBannerStrings;
35+
strings?: _RTTDisclosureBannerStrings;
3836
}
3937

4038
/* @conditional-compile-remove(rtt) */
4139
/**
42-
* @beta
40+
* @private
4341
* Banner to disclose that RTT is enabled for all participants for the entire duration of the meeting.
4442
*/
45-
export const RTTDisclosureBanner = (props: RTTDisclosureBannerProps): JSX.Element => {
46-
const localeStrings = useLocale().strings.rttDisclosureBanner;
47-
const strings = { ...localeStrings, ...props.strings };
43+
export const _RTTDisclosureBanner = (props: _RTTDisclosureBannerProps): JSX.Element => {
44+
const strings = props.strings;
4845
const theme = useTheme();
4946

5047
return (
5148
<Notification
5249
notificationStrings={{
53-
title: strings.bannerTitle,
54-
message: strings.bannerContent,
55-
linkLabel: strings.bannerLinkLabel
50+
title: strings?.bannerTitle ?? '',
51+
message: strings?.bannerContent,
52+
linkLabel: strings?.bannerLinkLabel
5653
}}
5754
notificationIconProps={{
5855
iconName: 'RealTimeTextIcon',

packages/react-components/src/localization/LocalizationProvider.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ import { RichTextSendBoxStrings } from '../components/RichTextEditor/RichTextSen
5050
import { MeetingConferencePhoneInfoModalStrings } from '../components/MeetingConferencePhoneInfo';
5151
import { IncomingCallNotificationStrings } from '../components/IncomingCallNotification';
5252
/* @conditional-compile-remove(rtt) */
53-
import { RTTDisclosureBannerStrings } from '../components/RTTDisclosureBanner';
54-
/* @conditional-compile-remove(rtt) */
5553
import { RealTimeTextModalStrings } from '../components/RealTimeTextModal';
5654
/* @conditional-compile-remove(rtt) */
5755
import { RealTimeTextStrings } from '../components/RealTimeText';
@@ -192,9 +190,6 @@ export interface ComponentStrings {
192190
meetingConferencePhoneInfo: MeetingConferencePhoneInfoModalStrings;
193191
IncomingCallNotification: IncomingCallNotificationStrings;
194192
/* @conditional-compile-remove(rtt) */
195-
/** Strings for the RTT Disclosure Banner */
196-
rttDisclosureBanner: RTTDisclosureBannerStrings;
197-
/* @conditional-compile-remove(rtt) */
198193
/** Strings for the RealTimeTextModal */
199194
realTimeTextModal: RealTimeTextModalStrings;
200195
/* @conditional-compile-remove(rtt) */

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@
7979
},
8080
"captionsBanner": {
8181
"captionsBannerSpinnerText": "Starting captions...",
82-
"realTimeTextInputBoxDefaultText": "Type message in real time"
82+
"realTimeTextInputBoxDefaultText": "Type message in real time",
83+
"realTimeTextBannerTitle": "RTT",
84+
"realTimeTextBannerContent": "RTT (real-time text) is enabled for all participants for the entire duration of the meeting.",
85+
"realTimeTextBannerLinkLabel": "Learn more"
8386
},
8487
"mentionPopover": {
8588
"mentionPopoverHeader": "Suggestions"
@@ -826,10 +829,5 @@
826829
"incomingCallNotificationRejectButtonLabel": "Decline",
827830
"incomingCallNotificationAccceptWithVideoButtonLabel": "Accept with Video",
828831
"incomingCallNotificationDismissButtonAriaLabel": "Dismiss"
829-
},
830-
"rttDisclosureBanner": {
831-
"bannerTitle": "RTT",
832-
"bannerContent": "RTT (real-time text) is enabled for all participants for the entire duration of the meeting.",
833-
"bannerLinkLabel": "Learn more"
834832
}
835833
}

packages/react-composites/src/composites/CallComposite/Strings.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,21 @@ export interface CallCompositeStrings {
564564
* Default text for RTT input text box
565565
*/
566566
realTimeTextInputBoxDefaultText?: string;
567+
/* @conditional-compile-remove(rtt) */
568+
/**
569+
* Text to show in the real time text disclosure banner
570+
*/
571+
realTimeTextBannerContent?: string;
572+
/* @conditional-compile-remove(rtt) */
573+
/**
574+
* Title text of the real time text disclosure banner
575+
*/
576+
realTimeTextBannerTitle?: string;
577+
/* @conditional-compile-remove(rtt) */
578+
/**
579+
* Label for the link in the real time text disclosure banner
580+
*/
581+
realTimeTextBannerLinkLabel?: string;
567582
/**
568583
* transfer page text when showing the transferor who initiated the transfer
569584
*/

packages/react-composites/src/composites/common/CallingCaptionsBanner.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ export const CallingCaptionsBanner = (props: {
5858
const captionsBannerStrings: CaptionsBannerStrings = {
5959
captionsBannerSpinnerText: strings.captionsBannerSpinnerText,
6060
/* @conditional-compile-remove(rtt) */
61-
realTimeTextInputBoxDefaultText: strings.realTimeTextInputBoxDefaultText
61+
realTimeTextInputBoxDefaultText: strings.realTimeTextInputBoxDefaultText,
62+
/* @conditional-compile-remove(rtt) */
63+
realTimeTextBannerContent: strings.realTimeTextBannerContent,
64+
/* @conditional-compile-remove(rtt) */
65+
realTimeTextBannerTitle: strings.realTimeTextBannerTitle,
66+
/* @conditional-compile-remove(rtt) */
67+
realTimeTextBannerLinkLabel: strings.realTimeTextBannerLinkLabel
6268
};
6369

6470
const onRenderAvatar = useCallback(

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

+3
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@
219219
},
220220
"captionsBannerSpinnerText": "Starting captions...",
221221
"realTimeTextInputBoxDefaultText": "Type message in real-time",
222+
"realTimeTextBannerTitle": "RTT",
223+
"realTimeTextBannerContent": "RTT (real-time text) is enabled for all participants for the entire duration of the meeting.",
224+
"realTimeTextBannerLinkLabel": "Learn more",
222225
"transferPageTransferorText": "Transferring...",
223226
"transferPageTransferTargetText": "Connecting...",
224227
"transferPageUnknownTransferorDisplayName": "Unknown",

packages/storybook8/stories/INTERNAL/RTTDisclosureBanner/Docs.mdx

-11
This file was deleted.

packages/storybook8/stories/INTERNAL/RTTDisclosureBanner/RTTDisclosureBanner.story.tsx

-30
This file was deleted.

packages/storybook8/stories/INTERNAL/RTTDisclosureBanner/index.stories.tsx

-21
This file was deleted.

packages/storybook8/stories/INTERNAL/RTTDisclosureBanner/snippets/RTTDisclosureBanner.snippet.tsx

-25
This file was deleted.

0 commit comments

Comments
 (0)