agora-appbuilder-core 4.0.0-beta.60 → 4.0.0-beta.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/src/atoms/ParticipantsCount.tsx +12 -2
- package/template/src/components/Controls.tsx +2 -2
- package/template/src/components/RTMConfigure.tsx +3 -1
- package/template/src/components/chat-messages/useChatMessages.tsx +26 -19
- package/template/src/components/livestream/LiveStreamContext.tsx +53 -40
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +11 -3
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +11 -3
- package/template/src/components/virtual-background/VBButton.tsx +1 -1
- package/template/src/language/default-labels/videoCallScreenLabels.ts +32 -9
- package/template/src/utils/useString.ts +10 -0
package/package.json
CHANGED
|
@@ -7,6 +7,11 @@ import ChatContext from '../components/ChatContext';
|
|
|
7
7
|
import {useLiveStreamDataContext} from '../components/contexts/LiveStreamDataContext';
|
|
8
8
|
import {useVideoMeetingData} from '../components/contexts/VideoMeetingDataContext';
|
|
9
9
|
import {isMobileUA} from '../utils/common';
|
|
10
|
+
import {useString} from '../utils/useString';
|
|
11
|
+
import {
|
|
12
|
+
videoRoomPeopleCountTooltipAttendeeText,
|
|
13
|
+
videoRoomPeopleCountTooltipHostText,
|
|
14
|
+
} from '../language/default-labels/videoCallScreenLabels';
|
|
10
15
|
|
|
11
16
|
const ParticipantsCount = () => {
|
|
12
17
|
const {onlineUsersCount} = useContext(ChatContext);
|
|
@@ -15,17 +20,22 @@ const ParticipantsCount = () => {
|
|
|
15
20
|
const count = $config.EVENT_MODE
|
|
16
21
|
? hostUids.length + audienceUids.length
|
|
17
22
|
: onlineUsersCount;
|
|
23
|
+
|
|
24
|
+
const hostlabel = useString(videoRoomPeopleCountTooltipHostText)();
|
|
25
|
+
const attendeelabel = useString<{eventMode: boolean}>(
|
|
26
|
+
videoRoomPeopleCountTooltipAttendeeText,
|
|
27
|
+
);
|
|
18
28
|
return (
|
|
19
29
|
<IconButton
|
|
20
30
|
placement="right"
|
|
21
31
|
isClickable={isMobileUA() ? true : false}
|
|
22
32
|
toolTipMessage={
|
|
23
33
|
$config.EVENT_MODE
|
|
24
|
-
?
|
|
34
|
+
? `${hostlabel}: ${
|
|
25
35
|
$config.EVENT_MODE
|
|
26
36
|
? hostUids?.length || 0
|
|
27
37
|
: hostUidsVM.length || 0
|
|
28
|
-
}\n${$config.EVENT_MODE
|
|
38
|
+
}\n${attendeelabel({eventMode: $config.EVENT_MODE})}: ${
|
|
29
39
|
$config.EVENT_MODE
|
|
30
40
|
? audienceUids.length || 0
|
|
31
41
|
: attendeeUids?.length || 0
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
toolbarItemSettingText,
|
|
97
97
|
toolbarItemShareText,
|
|
98
98
|
toolbarItemTranscriptText,
|
|
99
|
-
|
|
99
|
+
toolbarItemVirtualBackgroundText,
|
|
100
100
|
toolbarItemWhiteboardText,
|
|
101
101
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
102
102
|
|
|
@@ -250,7 +250,7 @@ const MoreButton = () => {
|
|
|
250
250
|
const screenShareButton = useString<boolean>(toolbarItemShareText);
|
|
251
251
|
const recordingButton = useString<boolean>(toolbarItemRecordingText);
|
|
252
252
|
const moreButtonLabel = useString(toolbarItemMoreText)();
|
|
253
|
-
const virtualBackgroundLabel = useString(
|
|
253
|
+
const virtualBackgroundLabel = useString(toolbarItemVirtualBackgroundText)();
|
|
254
254
|
const chatLabel = useString(toolbarItemChatText)();
|
|
255
255
|
const inviteLabel = useString(toolbarItemInviteText)();
|
|
256
256
|
const peopleLabel = useString(toolbarItemPeopleText)();
|
|
@@ -495,7 +495,9 @@ const RtmConfigure = (props: any) => {
|
|
|
495
495
|
waitingRoomStatusRef.current?.waitingRoomStatus !==
|
|
496
496
|
WaitingRoomStatus.APPROVED
|
|
497
497
|
) {
|
|
498
|
-
|
|
498
|
+
//todo: hari/bhupen added important rtm message in the queue and run it later when user join the call
|
|
499
|
+
evt = data.evt;
|
|
500
|
+
value = data.value;
|
|
499
501
|
} else {
|
|
500
502
|
evt = data.evt;
|
|
501
503
|
value = data.value;
|
|
@@ -28,7 +28,7 @@ import {timeNow} from '../../rtm/utils';
|
|
|
28
28
|
import {useSidePanel} from '../../utils/useSidePanel';
|
|
29
29
|
import getUniqueID from '../../utils/getUniqueID';
|
|
30
30
|
import {trimText} from '../../utils/common';
|
|
31
|
-
import {
|
|
31
|
+
import {useStringRef} from '../../utils/useString';
|
|
32
32
|
import {
|
|
33
33
|
publicChatToastHeading,
|
|
34
34
|
multiplePublicChatToastHeading,
|
|
@@ -108,30 +108,33 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
108
108
|
const individualActiveRef = useRef<string | number>();
|
|
109
109
|
|
|
110
110
|
//public single
|
|
111
|
-
const fromText =
|
|
111
|
+
const fromText = useStringRef(publicChatToastHeading);
|
|
112
112
|
|
|
113
113
|
//public multple
|
|
114
|
-
const multiplePublicChatToastHeadingTT =
|
|
114
|
+
const multiplePublicChatToastHeadingTT = useStringRef(
|
|
115
115
|
multiplePublicChatToastHeading,
|
|
116
|
-
)
|
|
117
|
-
|
|
116
|
+
);
|
|
117
|
+
//@ts-ignore
|
|
118
|
+
const multiplePublicChatToastSubHeadingTT = useStringRef<{
|
|
118
119
|
count: number;
|
|
119
120
|
from: string;
|
|
120
121
|
}>(multiplePublicChatToastSubHeading);
|
|
121
122
|
|
|
122
123
|
//private single
|
|
123
|
-
const privateMessageLabel =
|
|
124
|
+
const privateMessageLabel = useStringRef(privateChatToastHeading);
|
|
124
125
|
|
|
125
126
|
//private multiple
|
|
126
|
-
|
|
127
|
+
//@ts-ignore
|
|
128
|
+
const multiplePrivateChatToastHeadingTT = useStringRef<{count: number}>(
|
|
127
129
|
multiplePrivateChatToastHeading,
|
|
128
130
|
);
|
|
129
131
|
|
|
130
132
|
//multiple private and public toast
|
|
131
|
-
const multiplePublicAndPrivateChatToastHeadingTT =
|
|
133
|
+
const multiplePublicAndPrivateChatToastHeadingTT = useStringRef(
|
|
132
134
|
multiplePublicAndPrivateChatToastHeading,
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
+
);
|
|
136
|
+
//@ts-ignore
|
|
137
|
+
const multiplePublicAndPrivateChatToastSubHeadingTT = useStringRef<{
|
|
135
138
|
publicChatCount: number;
|
|
136
139
|
privateChatCount: number;
|
|
137
140
|
from: string;
|
|
@@ -261,16 +264,18 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
261
264
|
leadingIconName: 'chat-nav',
|
|
262
265
|
text1:
|
|
263
266
|
privateMessages && privateMessages.length
|
|
264
|
-
? multiplePublicAndPrivateChatToastHeadingTT
|
|
265
|
-
: multiplePublicChatToastHeadingTT,
|
|
267
|
+
? multiplePublicAndPrivateChatToastHeadingTT?.current()
|
|
268
|
+
: multiplePublicChatToastHeadingTT?.current(),
|
|
266
269
|
text2:
|
|
267
270
|
privateMessages && privateMessages.length
|
|
268
|
-
?
|
|
271
|
+
? //@ts-ignore
|
|
272
|
+
multiplePublicAndPrivateChatToastSubHeadingTT?.current({
|
|
269
273
|
publicChatCount: publicMessages.length,
|
|
270
274
|
privateChatCount: privateMessages.length,
|
|
271
275
|
from: fromNames,
|
|
272
276
|
})
|
|
273
|
-
:
|
|
277
|
+
: //@ts-ignore
|
|
278
|
+
multiplePublicChatToastSubHeadingTT?.current({
|
|
274
279
|
count: publicMessages.length,
|
|
275
280
|
from: fromNames,
|
|
276
281
|
}),
|
|
@@ -297,9 +302,11 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
297
302
|
secondaryBtn: null,
|
|
298
303
|
type: 'info',
|
|
299
304
|
leadingIconName: 'chat-nav',
|
|
300
|
-
text1:
|
|
301
|
-
|
|
302
|
-
|
|
305
|
+
text1:
|
|
306
|
+
//@ts-ignore
|
|
307
|
+
multiplePrivateChatToastHeadingTT?.current({
|
|
308
|
+
count: privateMessages.length,
|
|
309
|
+
}),
|
|
303
310
|
text2: ``,
|
|
304
311
|
visibilityTime: 3000,
|
|
305
312
|
onPress: () => {
|
|
@@ -330,10 +337,10 @@ const ChatMessagesProvider = (props: ChatMessagesProviderProps) => {
|
|
|
330
337
|
type: 'info',
|
|
331
338
|
leadingIconName: 'chat-nav',
|
|
332
339
|
text1: isPrivateMessage
|
|
333
|
-
? privateMessageLabel
|
|
340
|
+
? privateMessageLabel?.current()
|
|
334
341
|
: //@ts-ignore
|
|
335
342
|
defaultContentRef.current.defaultContent[uidAsNumber]?.name
|
|
336
|
-
? fromText(
|
|
343
|
+
? fromText?.current(
|
|
337
344
|
trimText(
|
|
338
345
|
//@ts-ignore
|
|
339
346
|
defaultContentRef.current.defaultContent[uidAsNumber]?.name,
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
useState,
|
|
5
|
+
useRef,
|
|
6
|
+
useCallback,
|
|
7
|
+
useEffect,
|
|
8
|
+
} from 'react';
|
|
2
9
|
import {StyleSheet} from 'react-native';
|
|
3
10
|
import ChatContext, {controlMessageEnum} from '../ChatContext';
|
|
4
11
|
import Toast from '../../../react-native-toast-message';
|
|
@@ -21,7 +28,7 @@ import {SidePanelType, useContent, useSidePanel} from 'customization-api';
|
|
|
21
28
|
import TertiaryButton from '../../atoms/TertiaryButton';
|
|
22
29
|
import PrimaryButton from '../../atoms/PrimaryButton';
|
|
23
30
|
import {trimText} from '../../utils/common';
|
|
24
|
-
import {
|
|
31
|
+
import {useStringRef} from '../../utils/useString';
|
|
25
32
|
import {
|
|
26
33
|
livestreamRequestAlreadyProcessed,
|
|
27
34
|
livestreamToastApprovalBtnText,
|
|
@@ -35,50 +42,50 @@ export const LiveStreamContextConsumer = LiveStreamContext.Consumer;
|
|
|
35
42
|
export const LiveStreamContextProvider: React.FC<
|
|
36
43
|
liveStreamPropsInterface
|
|
37
44
|
> = props => {
|
|
38
|
-
const requestAlreadyProcessed =
|
|
45
|
+
const requestAlreadyProcessed = useStringRef(
|
|
39
46
|
livestreamRequestAlreadyProcessed,
|
|
40
|
-
)
|
|
47
|
+
);
|
|
41
48
|
|
|
42
|
-
const raiseHandRequestReceivedToastHeading =
|
|
49
|
+
const raiseHandRequestReceivedToastHeading = useStringRef(
|
|
43
50
|
LSNotificationObject.RAISE_HAND_RECEIVED.text1TranslationKey,
|
|
44
51
|
);
|
|
45
|
-
const raiseHandRequestReceivedToastSubHeading =
|
|
52
|
+
const raiseHandRequestReceivedToastSubHeading = useStringRef(
|
|
46
53
|
LSNotificationObject.RAISE_HAND_RECEIVED.text2TranslationKey,
|
|
47
|
-
)
|
|
54
|
+
);
|
|
48
55
|
|
|
49
|
-
const raiseHandRequestRecallToastHeading =
|
|
56
|
+
const raiseHandRequestRecallToastHeading = useStringRef(
|
|
50
57
|
LSNotificationObject.RAISE_HAND_REQUEST_RECALL.text1TranslationKey,
|
|
51
58
|
);
|
|
52
59
|
|
|
53
|
-
const raiseHandRequestAcceptedToastHeading =
|
|
60
|
+
const raiseHandRequestAcceptedToastHeading = useStringRef(
|
|
54
61
|
LSNotificationObject.RAISE_HAND_ACCEPTED.text1TranslationKey,
|
|
55
|
-
)
|
|
56
|
-
const raiseHandRequestAcceptedToastSubHeading =
|
|
62
|
+
);
|
|
63
|
+
const raiseHandRequestAcceptedToastSubHeading = useStringRef(
|
|
57
64
|
LSNotificationObject.RAISE_HAND_ACCEPTED.text2TranslationKey,
|
|
58
|
-
)
|
|
65
|
+
);
|
|
59
66
|
|
|
60
|
-
const raiseHandRequestRejectedToastHeading =
|
|
67
|
+
const raiseHandRequestRejectedToastHeading = useStringRef(
|
|
61
68
|
LSNotificationObject.RAISE_HAND_REJECTED.text1TranslationKey,
|
|
62
|
-
)
|
|
69
|
+
);
|
|
63
70
|
|
|
64
|
-
const raiseHandApprovedRequestRecallToastHeading =
|
|
71
|
+
const raiseHandApprovedRequestRecallToastHeading = useStringRef(
|
|
65
72
|
LSNotificationObject.RAISE_HAND_APPROVED_REQUEST_RECALL.text1TranslationKey,
|
|
66
|
-
)
|
|
73
|
+
);
|
|
67
74
|
|
|
68
|
-
const promoteAsCoHostToastHeading =
|
|
75
|
+
const promoteAsCoHostToastHeading = useStringRef(
|
|
69
76
|
LSNotificationObject.PROMOTE_AS_CO_HOST.text1TranslationKey,
|
|
70
|
-
)
|
|
77
|
+
);
|
|
71
78
|
|
|
72
|
-
const raiseHandRequestToastHeading =
|
|
79
|
+
const raiseHandRequestToastHeading = useStringRef(
|
|
73
80
|
LSNotificationObject.RAISE_HAND_REQUEST.text1TranslationKey,
|
|
74
|
-
)
|
|
75
|
-
const raiseHandRequestToastSubHeading =
|
|
81
|
+
);
|
|
82
|
+
const raiseHandRequestToastSubHeading = useStringRef(
|
|
76
83
|
LSNotificationObject.RAISE_HAND_REQUEST.text2TranslationKey,
|
|
77
|
-
)
|
|
84
|
+
);
|
|
78
85
|
|
|
79
|
-
const raiseHandRequestRecallLocalToastHeading =
|
|
86
|
+
const raiseHandRequestRecallLocalToastHeading = useStringRef(
|
|
80
87
|
LSNotificationObject.RAISE_HAND_REQUEST_RECALL_LOCAL.text1TranslationKey,
|
|
81
|
-
)
|
|
88
|
+
);
|
|
82
89
|
|
|
83
90
|
const screenshareContextInstance = useScreenshare();
|
|
84
91
|
const screenshareContextInstanceRef = useRef<any>();
|
|
@@ -164,8 +171,8 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
164
171
|
|
|
165
172
|
const [isPendingRequestToReview, setPendingRequestToReview] = useState(false);
|
|
166
173
|
|
|
167
|
-
const allowToBePresenter =
|
|
168
|
-
const deny =
|
|
174
|
+
const allowToBePresenter = useStringRef(livestreamToastApprovalBtnText);
|
|
175
|
+
const deny = useStringRef(livestreamToastDenyBtnText);
|
|
169
176
|
const showToast = (
|
|
170
177
|
text: string,
|
|
171
178
|
text2: string,
|
|
@@ -180,7 +187,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
180
187
|
<PrimaryButton
|
|
181
188
|
containerStyle={style.primaryBtn}
|
|
182
189
|
textStyle={style.primaryBtnText}
|
|
183
|
-
text={allowToBePresenter}
|
|
190
|
+
text={allowToBePresenter?.current()}
|
|
184
191
|
onPress={() => {
|
|
185
192
|
hostApprovesRequestOfUID(uid);
|
|
186
193
|
Toast.hide();
|
|
@@ -190,7 +197,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
190
197
|
btns.secondaryBtn = (
|
|
191
198
|
<TertiaryButton
|
|
192
199
|
containerStyle={style.secondaryBtn}
|
|
193
|
-
text={deny}
|
|
200
|
+
text={deny?.current()}
|
|
194
201
|
onPress={() => {
|
|
195
202
|
hostRejectsRequestOfUID(uid);
|
|
196
203
|
Toast.hide();
|
|
@@ -421,10 +428,10 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
421
428
|
sidePanelRef.current !== SidePanelType.Participants
|
|
422
429
|
) {
|
|
423
430
|
showToast(
|
|
424
|
-
raiseHandRequestReceivedToastHeading(
|
|
431
|
+
raiseHandRequestReceivedToastHeading?.current(
|
|
425
432
|
trimText(getAttendeeName(data.sender)),
|
|
426
433
|
),
|
|
427
|
-
raiseHandRequestReceivedToastSubHeading,
|
|
434
|
+
raiseHandRequestReceivedToastSubHeading?.current(),
|
|
428
435
|
data.sender,
|
|
429
436
|
data.ts,
|
|
430
437
|
);
|
|
@@ -444,7 +451,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
444
451
|
sidePanelRef.current !== SidePanelType.Participants
|
|
445
452
|
) {
|
|
446
453
|
showToast(
|
|
447
|
-
raiseHandRequestRecallToastHeading(
|
|
454
|
+
raiseHandRequestRecallToastHeading?.current(
|
|
448
455
|
trimText(getAttendeeName(data.sender)),
|
|
449
456
|
),
|
|
450
457
|
null,
|
|
@@ -500,8 +507,8 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
500
507
|
if (raiseHandList[localUidRef.current]?.raised === RaiseHandValue.FALSE)
|
|
501
508
|
return;
|
|
502
509
|
showToast(
|
|
503
|
-
raiseHandRequestAcceptedToastHeading,
|
|
504
|
-
raiseHandRequestAcceptedToastSubHeading,
|
|
510
|
+
raiseHandRequestAcceptedToastHeading?.current(),
|
|
511
|
+
raiseHandRequestAcceptedToastSubHeading?.current(),
|
|
505
512
|
);
|
|
506
513
|
// Promote user's privileges to host
|
|
507
514
|
changeClientRoleTo(ClientRole.Broadcaster);
|
|
@@ -521,13 +528,16 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
521
528
|
raiseHandListRef.current[localUidRef.current].role ==
|
|
522
529
|
ClientRole.Audience
|
|
523
530
|
) {
|
|
524
|
-
showToast(raiseHandRequestRejectedToastHeading, null);
|
|
531
|
+
showToast(raiseHandRequestRejectedToastHeading?.current(), null);
|
|
525
532
|
} else if (
|
|
526
533
|
raiseHandListRef.current[localUidRef.current].role ==
|
|
527
534
|
ClientRole.Broadcaster
|
|
528
535
|
) {
|
|
529
536
|
/** 2.b */
|
|
530
|
-
showToast(
|
|
537
|
+
showToast(
|
|
538
|
+
raiseHandApprovedRequestRecallToastHeading?.current(),
|
|
539
|
+
null,
|
|
540
|
+
);
|
|
531
541
|
screenshareContextInstanceRef?.current?.stopUserScreenShare(); // This will not exist on ios
|
|
532
542
|
|
|
533
543
|
// Demote user's privileges to audience
|
|
@@ -546,7 +556,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
546
556
|
const unsubPromoteAsCoHost = events.on(
|
|
547
557
|
LiveStreamControlMessageEnum.promoteAsCoHost,
|
|
548
558
|
data => {
|
|
549
|
-
showToast(promoteAsCoHostToastHeading, null);
|
|
559
|
+
showToast(promoteAsCoHostToastHeading.current(), null);
|
|
550
560
|
// Promote user's privileges to host
|
|
551
561
|
changeClientRoleTo(ClientRole.Broadcaster);
|
|
552
562
|
// Audience updates its local attributes and notfies all host when request is approved
|
|
@@ -618,7 +628,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
618
628
|
} else {
|
|
619
629
|
Toast.hide();
|
|
620
630
|
setTimeout(() => {
|
|
621
|
-
showToast(requestAlreadyProcessed, null);
|
|
631
|
+
showToast(requestAlreadyProcessed?.current(), null);
|
|
622
632
|
});
|
|
623
633
|
}
|
|
624
634
|
};
|
|
@@ -639,7 +649,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
639
649
|
} else {
|
|
640
650
|
Toast.hide();
|
|
641
651
|
setTimeout(() => {
|
|
642
|
-
showToast(requestAlreadyProcessed, null);
|
|
652
|
+
showToast(requestAlreadyProcessed?.current(), null);
|
|
643
653
|
});
|
|
644
654
|
}
|
|
645
655
|
};
|
|
@@ -667,7 +677,10 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
667
677
|
// If hand is already raised, skip the call
|
|
668
678
|
if (raiseHandList[localUidRef.current]?.raised === RaiseHandValue.TRUE)
|
|
669
679
|
return;
|
|
670
|
-
showToast(
|
|
680
|
+
showToast(
|
|
681
|
+
raiseHandRequestToastHeading?.current(),
|
|
682
|
+
raiseHandRequestToastSubHeading?.current(),
|
|
683
|
+
);
|
|
671
684
|
events.send(
|
|
672
685
|
EventNames.RAISED_ATTRIBUTE,
|
|
673
686
|
JSON.stringify({
|
|
@@ -713,7 +726,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
713
726
|
PersistanceLevel.Sender,
|
|
714
727
|
);
|
|
715
728
|
UpdtLocStateAndBCastAttr(ClientRole.Audience, new Date().getTime());
|
|
716
|
-
showToast(raiseHandRequestRecallLocalToastHeading, null);
|
|
729
|
+
showToast(raiseHandRequestRecallLocalToastHeading?.current(), null);
|
|
717
730
|
};
|
|
718
731
|
|
|
719
732
|
/** ******* AUDIENCE CONTROLS SECTION ENDS ******* */
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import React, {useContext, useEffect} from 'react';
|
|
14
14
|
import PrimaryButton from '../../atoms/PrimaryButton';
|
|
15
15
|
import {usePreCall} from './usePreCall';
|
|
16
|
-
import {useString} from '../../utils/useString';
|
|
16
|
+
import {useString, useStringRef} from '../../utils/useString';
|
|
17
17
|
import {
|
|
18
18
|
ChannelProfile,
|
|
19
19
|
DispatchContext,
|
|
@@ -34,6 +34,10 @@ import {EventNames} from '../../rtm-events';
|
|
|
34
34
|
import useWaitingRoomAPI from '../../subComponents/waiting-rooms/useWaitingRoomAPI';
|
|
35
35
|
import {useContent} from 'customization-api';
|
|
36
36
|
import EventsConfigure from '../EventsConfigure';
|
|
37
|
+
import {
|
|
38
|
+
waitingRoomApprovalRejectionToastHeading,
|
|
39
|
+
waitingRoomApprovalRejectionToastSubHeading,
|
|
40
|
+
} from '../../language/default-labels/videoCallScreenLabels';
|
|
37
41
|
|
|
38
42
|
export interface PreCallJoinWaitingRoomBtnProps {
|
|
39
43
|
render?: (
|
|
@@ -45,6 +49,10 @@ export interface PreCallJoinWaitingRoomBtnProps {
|
|
|
45
49
|
|
|
46
50
|
let shouldWaitingRoomPoll = null;
|
|
47
51
|
const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
|
|
52
|
+
const headinglabel = useStringRef(waitingRoomApprovalRejectionToastHeading);
|
|
53
|
+
const subheadinglabel = useStringRef(
|
|
54
|
+
waitingRoomApprovalRejectionToastSubHeading,
|
|
55
|
+
);
|
|
48
56
|
let pollingTimeout = React.useRef(null);
|
|
49
57
|
const {rtcProps} = useContext(PropsContext);
|
|
50
58
|
const {setCallActive, callActive} = usePreCall();
|
|
@@ -132,9 +140,9 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
|
|
|
132
140
|
});
|
|
133
141
|
// inform user that entry was denied by the host
|
|
134
142
|
Toast.show({
|
|
135
|
-
text1: `Approval Required`,
|
|
136
143
|
leadingIconName: 'info',
|
|
137
|
-
|
|
144
|
+
text1: headinglabel?.current(),
|
|
145
|
+
text2: subheadinglabel?.current(),
|
|
138
146
|
visibilityTime: 3000,
|
|
139
147
|
type: 'error',
|
|
140
148
|
primaryBtn: null,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import React, {useContext, useEffect} from 'react';
|
|
14
14
|
import PrimaryButton from '../../atoms/PrimaryButton';
|
|
15
15
|
import {usePreCall} from './usePreCall';
|
|
16
|
-
import {useString} from '../../utils/useString';
|
|
16
|
+
import {useString, useStringRef} from '../../utils/useString';
|
|
17
17
|
import {
|
|
18
18
|
ChannelProfile,
|
|
19
19
|
DispatchContext,
|
|
@@ -40,6 +40,10 @@ import events from '../../rtm-events-api';
|
|
|
40
40
|
import useWaitingRoomAPI from '../../subComponents/waiting-rooms/useWaitingRoomAPI';
|
|
41
41
|
import {UserType} from '../RTMConfigure';
|
|
42
42
|
import {useContent} from 'customization-api';
|
|
43
|
+
import {
|
|
44
|
+
waitingRoomApprovalRejectionToastHeading,
|
|
45
|
+
waitingRoomApprovalRejectionToastSubHeading,
|
|
46
|
+
} from '../../language/default-labels/videoCallScreenLabels';
|
|
43
47
|
|
|
44
48
|
const audio = new Audio(
|
|
45
49
|
'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
|
|
@@ -55,6 +59,10 @@ export interface PreCallJoinWaitingRoomBtnProps {
|
|
|
55
59
|
|
|
56
60
|
let shouldWaitingRoomPoll = null;
|
|
57
61
|
const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
|
|
62
|
+
const headinglabel = useStringRef(waitingRoomApprovalRejectionToastHeading);
|
|
63
|
+
const subheadinglabel = useStringRef(
|
|
64
|
+
waitingRoomApprovalRejectionToastSubHeading,
|
|
65
|
+
);
|
|
58
66
|
let pollingTimeout = React.useRef(null);
|
|
59
67
|
const {rtcProps} = useContext(PropsContext);
|
|
60
68
|
const {setCallActive, callActive} = usePreCall();
|
|
@@ -139,8 +147,8 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
|
|
|
139
147
|
// inform user that entry was denied by the host
|
|
140
148
|
Toast.show({
|
|
141
149
|
leadingIconName: 'info',
|
|
142
|
-
text1:
|
|
143
|
-
text2:
|
|
150
|
+
text1: headinglabel?.current(),
|
|
151
|
+
text2: subheadinglabel?.current(),
|
|
144
152
|
visibilityTime: 3000,
|
|
145
153
|
type: 'error',
|
|
146
154
|
primaryBtn: null,
|
|
@@ -18,7 +18,7 @@ const VBButton = (props: VBButtonProps) => {
|
|
|
18
18
|
const {isVBOpen, setIsVBOpen, showLabel = false} = props;
|
|
19
19
|
const {isToolbarMenuItem} = useToolbarMenu();
|
|
20
20
|
const {isOnActionSheet} = useActionSheet();
|
|
21
|
-
const vbLabel = useString('
|
|
21
|
+
const vbLabel = useString('toolbarItemVirtualBackgroundText')();
|
|
22
22
|
|
|
23
23
|
const onPress = () => {
|
|
24
24
|
setIsVBOpen(prev => !prev);
|
|
@@ -75,8 +75,8 @@ export const toolbarItemNoiseCancellationText =
|
|
|
75
75
|
export const toolbarItemWhiteboardText = 'toolbarItemWhiteboardText';
|
|
76
76
|
export const toolbarItemCaptionText = 'toolbarItemCaptionText';
|
|
77
77
|
export const toolbarItemTranscriptText = 'toolbarItemTranscriptText';
|
|
78
|
-
export const
|
|
79
|
-
'
|
|
78
|
+
export const toolbarItemVirtualBackgroundText =
|
|
79
|
+
'toolbarItemVirtualBackgroundText';
|
|
80
80
|
|
|
81
81
|
export const toolbarItemRaiseHandText = 'toolbarItemRaiseHandText';
|
|
82
82
|
|
|
@@ -379,6 +379,11 @@ export const waitingRoomApprovalRequiredPrimaryBtnText =
|
|
|
379
379
|
export const waitingRoomApprovalRequiredSecondaryBtnText =
|
|
380
380
|
'waitingRoomApprovalRequiredSecondaryBtnText';
|
|
381
381
|
|
|
382
|
+
export const waitingRoomApprovalRejectionToastHeading =
|
|
383
|
+
'waitingRoomApprovalRejectionToastHeading';
|
|
384
|
+
export const waitingRoomApprovalRejectionToastSubHeading =
|
|
385
|
+
'waitingRoomApprovalRejectionToastSubHeading';
|
|
386
|
+
|
|
382
387
|
export const videoRoomRecordingText = `video${room}RecordingText`;
|
|
383
388
|
export const videoRoomGoToActiveSpeakerText = `video${room}GoToActiveSpeakerText`;
|
|
384
389
|
export const videoRoomScreenshareText = `video${room}ScreenshareText`;
|
|
@@ -416,6 +421,10 @@ export const peoplePanelLivestreamingDenyBtnText =
|
|
|
416
421
|
export const sttTranscriptPanelSearchText = `${stt}TranscriptPanelSearchText`;
|
|
417
422
|
export const sttTranscriptPanelNoSearchResultsFoundText = `${stt}TranscriptPanelNoSearchResultsFoundText`;
|
|
418
423
|
export const sttTranscriptPanelViewLatestText = `${stt}TranscriptPanelViewLatestText`;
|
|
424
|
+
|
|
425
|
+
export const videoRoomPeopleCountTooltipHostText = `video${room}PeopleCountTooltipHostText`;
|
|
426
|
+
export const videoRoomPeopleCountTooltipAttendeeText = `video${room}PeopleCountTooltipAttendeeText`;
|
|
427
|
+
|
|
419
428
|
export interface I18nVideoCallScreenLabelsInterface {
|
|
420
429
|
[toolbarItemPeopleText]?: I18nBaseType;
|
|
421
430
|
[toolbarItemChatText]?: I18nBaseType;
|
|
@@ -440,7 +449,7 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
440
449
|
[toolbarItemWhiteboardText]?: I18nConditionalType;
|
|
441
450
|
[toolbarItemCaptionText]?: I18nConditionalType;
|
|
442
451
|
[toolbarItemTranscriptText]?: I18nConditionalType;
|
|
443
|
-
[
|
|
452
|
+
[toolbarItemVirtualBackgroundText]?: I18nBaseType;
|
|
444
453
|
|
|
445
454
|
[toolbarItemRaiseHandText]?: I18nConditionalType;
|
|
446
455
|
|
|
@@ -485,12 +494,12 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
485
494
|
[leavePopupSubHeading]?: I18nConditionalType;
|
|
486
495
|
[leavePopupPrimaryBtnText]?: I18nBaseType;
|
|
487
496
|
|
|
488
|
-
[removeFromRoomPopupHeading]?:
|
|
489
|
-
[removeFromRoomPopupSubHeading]?:
|
|
497
|
+
[removeFromRoomPopupHeading]?: I18nDynamicType;
|
|
498
|
+
[removeFromRoomPopupSubHeading]?: I18nDynamicType;
|
|
490
499
|
[removeFromRoomPopupPrimaryBtnText]?: I18nBaseType;
|
|
491
500
|
|
|
492
501
|
[removeScreenshareFromRoomPopupHeading]?: I18nBaseType;
|
|
493
|
-
[removeScreenshareFromRoomPopupSubHeading]?:
|
|
502
|
+
[removeScreenshareFromRoomPopupSubHeading]?: I18nDynamicType;
|
|
494
503
|
[removeScreenshareFromRoomPopupPrimaryBtnText]?: I18nBaseType;
|
|
495
504
|
|
|
496
505
|
[sttChangeLanguagePopupHeading]?: I18nConditionalType;
|
|
@@ -610,7 +619,7 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
610
619
|
|
|
611
620
|
[peoplePanelMeText]?: I18nBaseType;
|
|
612
621
|
[peoplePanelPresenterText]?: I18nBaseType;
|
|
613
|
-
[userRemovedFromTheRoomToastHeading]?:
|
|
622
|
+
[userRemovedFromTheRoomToastHeading]?: I18nDynamicType;
|
|
614
623
|
|
|
615
624
|
[vbPanelImageUploadErrorToastHeading]?: I18nBaseType;
|
|
616
625
|
[vbPanelImageUploadErrorToastSubHeading]?: I18nBaseType;
|
|
@@ -659,7 +668,7 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
659
668
|
username: string;
|
|
660
669
|
}>;
|
|
661
670
|
|
|
662
|
-
[deviceDetectionToastHeading]?:
|
|
671
|
+
[deviceDetectionToastHeading]?: I18nDynamicType;
|
|
663
672
|
[deviceDetectionToastSubHeading]?: I18nBaseType<{
|
|
664
673
|
name: string;
|
|
665
674
|
label: string;
|
|
@@ -679,6 +688,9 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
679
688
|
[waitingRoomApprovalRequiredPrimaryBtnText]?: I18nBaseType;
|
|
680
689
|
[waitingRoomApprovalRequiredSecondaryBtnText]?: I18nBaseType;
|
|
681
690
|
|
|
691
|
+
[waitingRoomApprovalRejectionToastHeading]?: I18nBaseType;
|
|
692
|
+
[waitingRoomApprovalRejectionToastSubHeading]?: I18nBaseType;
|
|
693
|
+
|
|
682
694
|
[videoRoomRecordingText]?: I18nBaseType;
|
|
683
695
|
[videoRoomGoToActiveSpeakerText]?: I18nBaseType;
|
|
684
696
|
[videoRoomScreenshareText]?: I18nDynamicType;
|
|
@@ -708,6 +720,9 @@ export interface I18nVideoCallScreenLabelsInterface {
|
|
|
708
720
|
[sttTranscriptPanelSearchText]?: I18nBaseType;
|
|
709
721
|
[sttTranscriptPanelNoSearchResultsFoundText]?: I18nBaseType;
|
|
710
722
|
[sttTranscriptPanelViewLatestText]?: I18nBaseType;
|
|
723
|
+
|
|
724
|
+
[videoRoomPeopleCountTooltipHostText]?: I18nBaseType;
|
|
725
|
+
[videoRoomPeopleCountTooltipAttendeeText]?: I18nBaseType;
|
|
711
726
|
}
|
|
712
727
|
|
|
713
728
|
export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
|
|
@@ -771,7 +786,7 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
|
|
|
771
786
|
[toolbarItemMoreText]: 'More',
|
|
772
787
|
|
|
773
788
|
[toolbarItemNoiseCancellationText]: 'Noise Cancellation',
|
|
774
|
-
[
|
|
789
|
+
[toolbarItemVirtualBackgroundText]: 'Virtual Background',
|
|
775
790
|
[toolbarItemWhiteboardText]: active =>
|
|
776
791
|
active ? 'Hide Whiteboard' : 'Show Whiteboard',
|
|
777
792
|
[toolbarItemCaptionText]: active =>
|
|
@@ -1090,6 +1105,10 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
|
|
|
1090
1105
|
[waitingRoomApprovalRequiredPrimaryBtnText]: 'Admit',
|
|
1091
1106
|
[waitingRoomApprovalRequiredSecondaryBtnText]: 'Deny',
|
|
1092
1107
|
|
|
1108
|
+
[waitingRoomApprovalRejectionToastHeading]: 'Approval Required',
|
|
1109
|
+
[waitingRoomApprovalRejectionToastSubHeading]:
|
|
1110
|
+
'Permission to enter the meeting was denied by the host',
|
|
1111
|
+
|
|
1093
1112
|
[videoRoomRecordingText]: 'Recording',
|
|
1094
1113
|
[videoRoomGoToActiveSpeakerText]: 'Go To Active Speaker',
|
|
1095
1114
|
[videoRoomScreenshareText]: username => `${username}'s screenshare`,
|
|
@@ -1131,4 +1150,8 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
|
|
|
1131
1150
|
[sttTranscriptPanelSearchText]: 'Search',
|
|
1132
1151
|
[sttTranscriptPanelNoSearchResultsFoundText]: 'No search results found',
|
|
1133
1152
|
[sttTranscriptPanelViewLatestText]: 'View Latest',
|
|
1153
|
+
|
|
1154
|
+
[videoRoomPeopleCountTooltipHostText]: 'Host',
|
|
1155
|
+
[videoRoomPeopleCountTooltipAttendeeText]: ({eventMode}) =>
|
|
1156
|
+
eventMode ? 'Audience' : 'Attendee',
|
|
1134
1157
|
};
|
|
@@ -13,6 +13,7 @@ import {useCustomization} from 'customization-implementation';
|
|
|
13
13
|
import {useLanguage} from '../language/useLanguage';
|
|
14
14
|
import {DEFAULT_I18_DATA} from '../language';
|
|
15
15
|
import {TextDataInterface} from '../language/default-labels/index';
|
|
16
|
+
import {useEffect, useRef} from 'react';
|
|
16
17
|
|
|
17
18
|
export function usei18nData(
|
|
18
19
|
selectedLanguageCode: string = DEFAULT_I18_DATA.locale,
|
|
@@ -59,3 +60,12 @@ export function useString<T = string>(
|
|
|
59
60
|
};
|
|
60
61
|
return getString;
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
export const useStringRef = (key: keyof TextDataInterface) => {
|
|
65
|
+
const fn = useString(key);
|
|
66
|
+
const refFn = useRef(fn);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
refFn.current = fn;
|
|
69
|
+
}, [fn]);
|
|
70
|
+
return refFn;
|
|
71
|
+
};
|