agora-appbuilder-core 4.0.0-beta.57 → 4.0.0-beta.59

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.
Files changed (88) hide show
  1. package/package.json +1 -1
  2. package/template/src/auth/AuthProvider.tsx +12 -5
  3. package/template/src/auth/AuthRoute.tsx +9 -2
  4. package/template/src/auth/IDPAuth.electron.tsx +4 -1
  5. package/template/src/auth/IDPAuth.tsx +9 -2
  6. package/template/src/auth/IDPLogoutComponent.tsx +14 -5
  7. package/template/src/auth/UserCancelPopup.tsx +11 -4
  8. package/template/src/auth/openIDPURL.electron.tsx +4 -4
  9. package/template/src/auth/openIDPURL.tsx +1 -1
  10. package/template/src/auth/useIDPAuth.electron.tsx +6 -3
  11. package/template/src/components/Controls.tsx +30 -8
  12. package/template/src/components/DeviceConfigure.tsx +29 -11
  13. package/template/src/components/EventsConfigure.tsx +72 -19
  14. package/template/src/components/HostControlView.tsx +9 -4
  15. package/template/src/components/Navbar.tsx +2 -1
  16. package/template/src/components/ParticipantsView.tsx +14 -6
  17. package/template/src/components/PinnedVideo.tsx +9 -2
  18. package/template/src/components/Precall.native.tsx +5 -2
  19. package/template/src/components/RTMConfigure.tsx +1 -8
  20. package/template/src/components/SettingsView.tsx +6 -2
  21. package/template/src/components/chat-messages/useChatMessages.tsx +26 -17
  22. package/template/src/components/livestream/LiveStreamContext.tsx +10 -3
  23. package/template/src/components/livestream/Types.ts +24 -11
  24. package/template/src/components/livestream/views/LiveStreamAttendeeLandingTile.tsx +31 -11
  25. package/template/src/components/meeting-info-invite/MeetingInfoGridTile.tsx +10 -13
  26. package/template/src/components/participants/AllAudienceParticipants.tsx +4 -5
  27. package/template/src/components/participants/AllHostParticipants.tsx +5 -6
  28. package/template/src/components/participants/Participant.tsx +9 -2
  29. package/template/src/components/participants/UserActionMenuOptions.tsx +38 -24
  30. package/template/src/components/participants/WaitingRoomParticipants.tsx +10 -3
  31. package/template/src/components/popups/InvitePopup.tsx +8 -3
  32. package/template/src/components/popups/StartScreenSharePopup.native.tsx +22 -25
  33. package/template/src/components/popups/StopRecordingPopup.tsx +10 -4
  34. package/template/src/components/popups/StopScreenSharePopup.native.tsx +14 -4
  35. package/template/src/components/popups/WhiteboardClearAllPopup.tsx +12 -4
  36. package/template/src/components/useUserPreference.tsx +11 -10
  37. package/template/src/components/virtual-background/VBButton.tsx +3 -1
  38. package/template/src/components/virtual-background/VBCard.native.tsx +26 -6
  39. package/template/src/components/virtual-background/VBCard.tsx +26 -6
  40. package/template/src/components/virtual-background/VBPanel.tsx +8 -4
  41. package/template/src/components/virtual-background/VideoPreview.native.tsx +2 -1
  42. package/template/src/components/virtual-background/VideoPreview.tsx +2 -1
  43. package/template/src/components/whiteboard/StrokeWidthTool.tsx +4 -2
  44. package/template/src/components/whiteboard/WhiteboardToolBox.tsx +60 -22
  45. package/template/src/components/whiteboard/WhiteboardView.tsx +2 -1
  46. package/template/src/components/whiteboard/WhiteboardWidget.tsx +50 -15
  47. package/template/src/language/default-labels/commonLabels.ts +51 -4
  48. package/template/src/language/default-labels/joinScreenLabels.ts +8 -1
  49. package/template/src/language/default-labels/precallScreenLabels.ts +4 -1
  50. package/template/src/language/default-labels/videoCallScreenLabels.ts +876 -288
  51. package/template/src/pages/VideoCall.tsx +4 -3
  52. package/template/src/pages/video-call/ActionSheetContent.tsx +29 -4
  53. package/template/src/pages/video-call/DefaultLayouts.ts +6 -2
  54. package/template/src/pages/video-call/NameWithMicIcon.tsx +3 -3
  55. package/template/src/pages/video-call/SidePanelHeader.tsx +15 -7
  56. package/template/src/pages/video-call/VideoRenderer.tsx +10 -2
  57. package/template/src/subComponents/ChatBubble.tsx +2 -3
  58. package/template/src/subComponents/ChatContainer.tsx +12 -11
  59. package/template/src/subComponents/ChatInput.ios.tsx +8 -2
  60. package/template/src/subComponents/ChatInput.tsx +8 -2
  61. package/template/src/subComponents/CopyJoinInfo.tsx +1 -1
  62. package/template/src/subComponents/EndcallPopup.tsx +15 -14
  63. package/template/src/subComponents/LanguageSelector.tsx +2 -1
  64. package/template/src/subComponents/LayoutIconDropdown.tsx +8 -4
  65. package/template/src/subComponents/LocalAudioMute.tsx +4 -3
  66. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  67. package/template/src/subComponents/NetworkQualityPill.tsx +5 -2
  68. package/template/src/subComponents/RemoteAudioMute.tsx +3 -3
  69. package/template/src/subComponents/RemoteMutePopup.tsx +23 -9
  70. package/template/src/subComponents/RemoteVideoMute.tsx +3 -3
  71. package/template/src/subComponents/RemoveMeetingPopup.tsx +10 -6
  72. package/template/src/subComponents/RemoveScreensharePopup.tsx +10 -4
  73. package/template/src/subComponents/ScreenShareNotice.tsx +11 -6
  74. package/template/src/subComponents/caption/Caption.tsx +2 -1
  75. package/template/src/subComponents/caption/CaptionContainer.tsx +7 -3
  76. package/template/src/subComponents/caption/DownloadTranscriptBtn.tsx +2 -1
  77. package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +16 -7
  78. package/template/src/subComponents/caption/Transcript.tsx +14 -5
  79. package/template/src/subComponents/caption/TranscriptIcon.tsx +5 -3
  80. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -4
  81. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +8 -11
  82. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +4 -2
  83. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +4 -2
  84. package/template/src/subComponents/recording/useRecording.tsx +14 -7
  85. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +6 -6
  86. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +0 -5
  87. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +10 -8
  88. package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.0-beta.57",
3
+ "version": "4.0.0-beta.59",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -32,6 +32,11 @@ import SDKMethodEventsManager from '../utils/SdkMethodEvents';
32
32
  import StorageContext from '../components/StorageContext';
33
33
  import UserCancelPopup from './UserCancelPopup';
34
34
  import {exitApp} from './openIDPURL';
35
+ import {useString} from '../utils/useString';
36
+ import {
37
+ authSessionTimeoutToastHeading,
38
+ loadingText,
39
+ } from '../language/default-labels/commonLabels';
35
40
 
36
41
  export const GET_USER = gql`
37
42
  query getUser {
@@ -58,6 +63,8 @@ interface AuthContextInterface {
58
63
  const AuthContext = createContext<AuthContextInterface | null>(null);
59
64
 
60
65
  const AuthProvider = (props: AuthProviderProps) => {
66
+ const loadingLabel = useString(loadingText)();
67
+ const timeoutHeading = useString(authSessionTimeoutToastHeading)();
61
68
  const regEvent = useRef(true);
62
69
  const refreshTimeoutWeb = useRef(null);
63
70
  const [showNativePopup, setShowNativePopup] = useState(false);
@@ -142,7 +149,7 @@ const AuthProvider = (props: AuthProviderProps) => {
142
149
  Toast.show({
143
150
  leadingIconName: 'alert',
144
151
  type: 'error',
145
- text1: 'Your session has timed out, Retrying...',
152
+ text1: timeoutHeading,
146
153
  visibilityTime: 3000,
147
154
  });
148
155
  setTimeout(() => {
@@ -314,7 +321,7 @@ const AuthProvider = (props: AuthProviderProps) => {
314
321
  Toast.show({
315
322
  leadingIconName: 'alert',
316
323
  type: 'error',
317
- text1: 'Your session has timed out, Retrying...',
324
+ text1: timeoutHeading,
318
325
  visibilityTime: 3000,
319
326
  });
320
327
  setTimeout(() => {
@@ -344,6 +351,7 @@ const AuthProvider = (props: AuthProviderProps) => {
344
351
  : isIOS() || isAndroid()
345
352
  ? deepLinkUrl
346
353
  : '',
354
+ timeoutHeading,
347
355
  )?.then((response: any) => {
348
356
  if (isAndroid() || isIOS()) {
349
357
  if (response && response?.showNativePopup) {
@@ -442,8 +450,7 @@ const AuthProvider = (props: AuthProviderProps) => {
442
450
  history.push('/create');
443
451
  } else {
444
452
  tokenLogout()
445
- .then(res => {
446
- })
453
+ .then(res => {})
447
454
  .catch(() => {
448
455
  console.error('user logout failed');
449
456
  setAuthError('Error occured on Logout, please try again.');
@@ -481,7 +488,7 @@ const AuthProvider = (props: AuthProviderProps) => {
481
488
  <></>
482
489
  )}
483
490
  {(!authenticated && !ENABLE_AUTH) || (ENABLE_AUTH && loading) ? (
484
- <Loading text={'Loading...'} />
491
+ <Loading text={loadingLabel} />
485
492
  ) : (
486
493
  props.children
487
494
  )}
@@ -18,6 +18,11 @@ import isSDK from '../utils/isSDK';
18
18
  import Loading from '../subComponents/Loading';
19
19
  import Login from '../pages/Login';
20
20
  import {isAndroid, isIOS} from '../utils/common';
21
+ import {useString} from '../utils/useString';
22
+ import {
23
+ authAuthenticationFailedText,
24
+ loadingText,
25
+ } from '../language/default-labels/commonLabels';
21
26
 
22
27
  interface PrivateRouteProps extends RouteProps {
23
28
  children: React.ReactNode;
@@ -26,6 +31,8 @@ interface PrivateRouteProps extends RouteProps {
26
31
  const AuthRoute: React.FC<PrivateRouteProps> = props => {
27
32
  const didMountRef = useRef(false);
28
33
  const {authenticated} = useAuth();
34
+ const loadingLabel = useString(loadingText)();
35
+ const failedtext = useString(authAuthenticationFailedText)();
29
36
 
30
37
  useEffect(() => {
31
38
  if (!didMountRef.current) return;
@@ -33,7 +40,7 @@ const AuthRoute: React.FC<PrivateRouteProps> = props => {
33
40
  Toast.show({
34
41
  leadingIconName: 'alert',
35
42
  type: 'error',
36
- text1: 'Authentication failed',
43
+ text1: failedtext,
37
44
  visibilityTime: 1000,
38
45
  });
39
46
  }
@@ -56,7 +63,7 @@ const AuthRoute: React.FC<PrivateRouteProps> = props => {
56
63
  //if user closes inapp browser then show login/signup button
57
64
  // <Login />
58
65
  //)
59
- <Loading text={'Loading...'} />
66
+ <Loading text={loadingLabel} />
60
67
  );
61
68
  // <Redirect
62
69
  // to={{
@@ -3,12 +3,15 @@ import {useAuth} from './AuthProvider';
3
3
  import {useHistory, useParams} from '../components/Router';
4
4
  import Loading from '../subComponents/Loading';
5
5
  import useTokenAuth from './useTokenAuth';
6
+ import {useString} from '../utils/useString';
7
+ import {authAuthorizingApplicationText} from '../language/default-labels/commonLabels';
6
8
 
7
9
  export const IDPAuth = () => {
8
10
  const {setIsAuthenticated} = useAuth();
9
11
  const {enableTokenAuth} = useTokenAuth();
10
12
  const history = useHistory();
11
13
  const {token}: {token: string} = useParams();
14
+ const text = useString(authAuthorizingApplicationText)();
12
15
 
13
16
  useEffect(() => {
14
17
  if (token) {
@@ -24,5 +27,5 @@ export const IDPAuth = () => {
24
27
  }
25
28
  }, []);
26
29
 
27
- return <Loading text={'Authorizing app...'} />;
30
+ return <Loading text={text} />;
28
31
  };
@@ -6,8 +6,15 @@ import {useApolloClient} from '@apollo/client';
6
6
  import Toast from '../../react-native-toast-message';
7
7
  import {getParamFromURL} from '../utils/common';
8
8
  import useTokenAuth from './useTokenAuth';
9
+ import {useString} from '../utils/useString';
10
+ import {
11
+ authAuthorizingApplicationText,
12
+ authErrorOnLoginToastHeading,
13
+ } from '../language/default-labels/commonLabels';
9
14
 
10
15
  export const IDPAuth = () => {
16
+ const toastheading = useString(authErrorOnLoginToastHeading)();
17
+ const text = useString(authAuthorizingApplicationText)();
11
18
  const {setIsAuthenticated, authLogin} = useAuth();
12
19
  const history = useHistory();
13
20
  const {token: returnTo}: {token: string} = useParams();
@@ -47,7 +54,7 @@ export const IDPAuth = () => {
47
54
  Toast.show({
48
55
  leadingIconName: 'alert',
49
56
  type: 'error',
50
- text1: 'Error occured on Login, Please login again.',
57
+ text1: toastheading,
51
58
  visibilityTime: 3000,
52
59
  });
53
60
  setTimeout(() => {
@@ -56,5 +63,5 @@ export const IDPAuth = () => {
56
63
  }
57
64
  }, []);
58
65
 
59
- return <Loading text={'Authorizing app...'} />;
66
+ return <Loading text={text} />;
60
67
  };
@@ -8,6 +8,14 @@ import {isMobileUA, useIsDesktop} from '../utils/common';
8
8
  import TertiaryButton from '../atoms/TertiaryButton';
9
9
  import isSDK from '../utils/isSDK';
10
10
  import {useAuth} from './AuthProvider';
11
+ import {useString} from '../utils/useString';
12
+ import {
13
+ authLogoutPopupHeading,
14
+ authLogoutPopupPrimaryBtnText,
15
+ authLogoutPopupSubHeading,
16
+ cancelText,
17
+ logoutText,
18
+ } from '../language/default-labels/commonLabels';
11
19
 
12
20
  interface LogoutPopupProps {
13
21
  modalVisible: boolean;
@@ -16,11 +24,11 @@ interface LogoutPopupProps {
16
24
  }
17
25
  const LogoutPopup = (props: LogoutPopupProps) => {
18
26
  const isDesktop = useIsDesktop()('popup');
19
- const logoutLabelHeading = 'Logout?';
20
- const logoutLabelSubHeading = 'Are you sure you wanna log out?';
27
+ const logoutLabelHeading = useString(authLogoutPopupHeading)();
28
+ const logoutLabelSubHeading = useString(authLogoutPopupSubHeading)();
21
29
 
22
- const cancelBtnLabel = 'CANCEL';
23
- const confirmBtnLabel = 'CONFIRM';
30
+ const cancelBtnLabel = useString(cancelText)();
31
+ const confirmBtnLabel = useString(authLogoutPopupPrimaryBtnText)();
24
32
  return (
25
33
  <Popup
26
34
  modalVisible={props.modalVisible}
@@ -114,6 +122,7 @@ interface IDPLogoutComponentProps {
114
122
  }
115
123
 
116
124
  const IDPLogoutComponent = (props?: IDPLogoutComponentProps) => {
125
+ const logoutLabel = useString(logoutText)();
117
126
  const {authenticated, authLogout} = useAuth();
118
127
  const [modalVisible, setModalVisible] = useState(false);
119
128
  return authenticated && $config.ENABLE_IDP_AUTH && !isSDK() ? (
@@ -136,7 +145,7 @@ const IDPLogoutComponent = (props?: IDPLogoutComponentProps) => {
136
145
  setModalVisible={setModalVisible}
137
146
  />
138
147
  <TertiaryButton
139
- text="Logout"
148
+ text={logoutLabel}
140
149
  onPress={() => {
141
150
  setModalVisible(true);
142
151
  }}
@@ -6,6 +6,13 @@ import PrimaryButton from '../atoms/PrimaryButton';
6
6
  import ThemeConfig from '../theme';
7
7
  import {useIsDesktop} from '../utils/common';
8
8
  import TertiaryButton from '../atoms/TertiaryButton';
9
+ import {useString} from '../utils/useString';
10
+ import {
11
+ authLogInRequiredPopupHeading,
12
+ authLogInRequiredPopupPrimaryBtnText,
13
+ authLogInRequiredPopupSecondaryBtnText,
14
+ authLogInRequiredPopupSubHeading,
15
+ } from '../language/default-labels/commonLabels';
9
16
 
10
17
  interface UserCancelPopupProps {
11
18
  modalVisible: boolean;
@@ -15,11 +22,11 @@ interface UserCancelPopupProps {
15
22
  }
16
23
  const UserCancelPopup = (props: UserCancelPopupProps) => {
17
24
  const isDesktop = useIsDesktop()('popup');
18
- const logoutLabelHeading = 'Login Required';
19
- const logoutLabelSubHeading = 'Log-in to your organization to contiue';
25
+ const logoutLabelHeading = useString(authLogInRequiredPopupHeading)();
26
+ const logoutLabelSubHeading = useString(authLogInRequiredPopupSubHeading)();
20
27
 
21
- const closeAppBtnLabel = 'CLOSE APP';
22
- const loginBtnLabel = 'LOGIN';
28
+ const loginBtnLabel = useString(authLogInRequiredPopupPrimaryBtnText)();
29
+ const closeAppBtnLabel = useString(authLogInRequiredPopupSecondaryBtnText)();
23
30
  return (
24
31
  <Popup
25
32
  cancelable={false}
@@ -8,7 +8,7 @@ export const getIDPAuthLoginURL = () => {
8
8
  }&origin_url=${getOriginURL()}&platform_id=${getPlatformId()}`;
9
9
  };
10
10
 
11
- export const addEventListenerForToken = history => {
11
+ export const addEventListenerForToken = (history, heading) => {
12
12
  window.addEventListener(
13
13
  'message',
14
14
  ({data, origin}: {data: {token: string; msg: string}; origin: string}) => {
@@ -18,7 +18,7 @@ export const addEventListenerForToken = history => {
18
18
  Toast.show({
19
19
  leadingIconName: 'alert',
20
20
  type: 'error',
21
- text1: 'Your session has timed out, Retrying...',
21
+ text1: heading ? heading : 'Your session has timed out, Retrying...',
22
22
  visibilityTime: 3000,
23
23
  });
24
24
  setTimeout(() => {
@@ -31,8 +31,8 @@ export const addEventListenerForToken = history => {
31
31
  );
32
32
  };
33
33
 
34
- export const enableIDPAuth = async history => {
35
- addEventListenerForToken(history);
34
+ export const enableIDPAuth = async (history, heading) => {
35
+ addEventListenerForToken(history, heading);
36
36
  //open the auth login in the popup
37
37
  window.open(getIDPAuthLoginURL(), 'modal');
38
38
  };
@@ -13,7 +13,7 @@ export const getIDPAuthLoginURL = (returnTo?: any) => {
13
13
  }&redirect_url=${finalRedirectURL}&origin_url=${getOriginURL()}&platform_id=${getPlatformId()}`;
14
14
  };
15
15
 
16
- export const enableIDPAuth = async (returnTo?: any) => {
16
+ export const enableIDPAuth = async (returnTo?: any, heading?: string) => {
17
17
  Linking.openURL(getIDPAuthLoginURL(returnTo));
18
18
  };
19
19
 
@@ -7,10 +7,13 @@ import {
7
7
  import StorageContext from '../components/StorageContext';
8
8
  import useTokenAuth from './useTokenAuth';
9
9
  import {useHistory} from '../components/Router';
10
+ import {useString} from '../utils/useString';
11
+ import {authSessionTimeoutToastHeading} from '../language/default-labels/commonLabels';
10
12
 
11
13
  export const useIDPAuth = () => {
12
14
  const {store, setStore} = useContext(StorageContext);
13
15
  const {tokenLogout} = useTokenAuth();
16
+ const headingText = useString(authSessionTimeoutToastHeading)();
14
17
  const history = useHistory();
15
18
  const idpLogout = () => {
16
19
  return new Promise((resolve, reject) => {
@@ -21,7 +24,7 @@ export const useIDPAuth = () => {
21
24
  authorization: store?.token ? `Bearer ${store?.token}` : '',
22
25
  },
23
26
  })
24
- .then((response) => response.json())
27
+ .then(response => response.json())
25
28
  .then((res: any) => {
26
29
  if (res && res?.url) {
27
30
  //Storing the URL in the local variable
@@ -33,7 +36,7 @@ export const useIDPAuth = () => {
33
36
  tokenLogout()
34
37
  .then(() => {
35
38
  //call IDP logout url
36
- addEventListenerForToken(history);
39
+ addEventListenerForToken(history, headingText);
37
40
  setTimeout(() => {
38
41
  window.open(IDPAuthLogoutURL, 'modal');
39
42
  });
@@ -46,7 +49,7 @@ export const useIDPAuth = () => {
46
49
  reject(false);
47
50
  }
48
51
  })
49
- .catch((_) => {
52
+ .catch(_ => {
50
53
  reject(false);
51
54
  });
52
55
  } catch (error) {
@@ -83,6 +83,8 @@ import LocalEventEmitter, {
83
83
  import {useSetRoomInfo} from './room-info/useSetRoomInfo';
84
84
  import {useString} from '../utils/useString';
85
85
  import {
86
+ sttSpokenLanguageToastHeading,
87
+ sttSpokenLanguageToastSubHeading,
86
88
  toolbarItemCaptionText,
87
89
  toolbarItemChatText,
88
90
  toolbarItemInviteText,
@@ -954,6 +956,13 @@ const Controls = (props: ControlsProps) => {
954
956
  const {setLanguage, setMeetingTranscript, setIsSTTActive} = useCaption();
955
957
  const defaultContentRef = React.useRef(defaultContent);
956
958
  const {setRoomInfo} = useSetRoomInfo();
959
+ const heading = useString<'Set' | 'Changed'>(sttSpokenLanguageToastHeading);
960
+ const subheading = useString<{
961
+ action: 'Set' | 'Changed';
962
+ newLanguage: string;
963
+ oldLanguage: string;
964
+ username: string;
965
+ }>(sttSpokenLanguageToastSubHeading);
957
966
 
958
967
  const {
959
968
  data: {isHost},
@@ -982,21 +991,34 @@ const Controls = (props: ControlsProps) => {
982
991
  : `changed the spoken language from "${getLanguageLabel(
983
992
  prevLang,
984
993
  )}" to "${getLanguageLabel(newLang)}" `;
985
- const msg = `${
986
- //@ts-ignore
987
- defaultContentRef.current[uid]?.name || username
988
- } ${actionText} `;
994
+ // const msg = `${
995
+ // //@ts-ignore
996
+ // defaultContentRef.current[uid]?.name || username
997
+ // } ${actionText} `;
998
+ let subheadingObj: any = {};
999
+ if (prevLang.indexOf('') !== -1) {
1000
+ subheadingObj = {
1001
+ username: defaultContentRef.current[uid]?.name || username,
1002
+ action: prevLang.indexOf('') !== -1 ? 'Set' : 'Changed',
1003
+ newLanguage: getLanguageLabel(newLang),
1004
+ };
1005
+ } else {
1006
+ subheadingObj = {
1007
+ username: defaultContentRef.current[uid]?.name || username,
1008
+ action: prevLang.indexOf('') !== -1 ? 'Set' : 'Changed',
1009
+ newLanguage: getLanguageLabel(newLang),
1010
+ oldLanguage: getLanguageLabel(prevLang),
1011
+ };
1012
+ }
989
1013
 
990
1014
  Toast.show({
991
1015
  leadingIconName: 'lang-select',
992
1016
  type: 'info',
993
- text1: `Spoken Language ${
994
- prevLang.indexOf('') !== -1 ? 'Set' : 'Changed'
995
- }`,
1017
+ text1: heading(prevLang.indexOf('') !== -1 ? 'Set' : 'Changed'),
996
1018
  visibilityTime: 3000,
997
1019
  primaryBtn: null,
998
1020
  secondaryBtn: null,
999
- text2: msg,
1021
+ text2: subheading(subheadingObj),
1000
1022
  });
1001
1023
  setRoomInfo(prev => {
1002
1024
  return {
@@ -33,6 +33,14 @@ import {getOS} from '../utils/common';
33
33
  import LocalEventEmitter, {
34
34
  LocalEventsEnum,
35
35
  } from '../rtm-events-api/LocalEvents';
36
+ import {useString} from '../utils/useString';
37
+ import {
38
+ deviceDetectionCancelBtnText,
39
+ deviceDetectionCheckboxText,
40
+ deviceDetectionPrimaryBtnText,
41
+ deviceDetectionToastHeading,
42
+ deviceDetectionToastSubHeading,
43
+ } from '../language/default-labels/videoCallScreenLabels';
36
44
 
37
45
  const log = (...args: any[]) => {
38
46
  console.log('[DeviceConfigure] ', ...args);
@@ -54,6 +62,14 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
54
62
  const [uiSelectedSpeaker, setUiSelectedSpeaker] = useState('');
55
63
  const [deviceList, setDeviceList] = useState<deviceInfo[]>([]);
56
64
 
65
+ const toastHeading = useString(deviceDetectionToastHeading);
66
+ const toastSubHeading = useString<{name: string; label: string}>(
67
+ deviceDetectionToastSubHeading,
68
+ );
69
+ const toastPrimaryBtnText = useString(deviceDetectionPrimaryBtnText)();
70
+ const toastCancelBtnText = useString(deviceDetectionCancelBtnText)();
71
+ const toastCheckboxBtnText = useString(deviceDetectionCheckboxText)();
72
+
57
73
  const micSelectInProgress = useRef(false);
58
74
  const micSelectQueue = useRef([]);
59
75
 
@@ -713,23 +729,25 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
713
729
  type: 'checked',
714
730
  leadingIconName: 'mic-on',
715
731
  // leadingIcon: <CustomIcon name={'mic-on'} />,
716
- text1: `New ${name} detected`,
732
+ text1: toastHeading(name),
733
+ text2: toastSubHeading({name, label: device?.label}),
717
734
  // @ts-ignore
718
- text2: (
719
- <Text>
720
- <Text>New {name} named </Text>
721
- <Text style={{fontWeight: 'bold'}}>{device.label}</Text>
722
- <Text> detected. Do you want to switch?</Text>
723
- </Text>
724
- ),
735
+ // text2: (
736
+ // <Text>
737
+ // <Text>New {name} named </Text>
738
+ // <Text style={{fontWeight: 'bold'}}>{device.label}</Text>
739
+ // <Text> detected. Do you want to switch?</Text>
740
+ // </Text>
741
+ // ),
725
742
  visibilityTime: 6000,
743
+ //@ts-ignore
726
744
  checkbox: {
727
745
  disabled: false,
728
746
  color: primaryColor,
729
- text: 'Remember my choice',
747
+ text: toastCheckboxBtnText,
730
748
  },
731
749
  primaryBtn: {
732
- text: 'SWITCH DEVICE',
750
+ text: toastPrimaryBtnText,
733
751
  onPress: (checked: boolean) => {
734
752
  setAction(device.deviceId);
735
753
  checked && updateRememberedDeviceList(device, true);
@@ -737,7 +755,7 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
737
755
  },
738
756
  },
739
757
  secondaryBtn: {
740
- text: 'IGNORE',
758
+ text: toastCancelBtnText,
741
759
  onPress: (checked: boolean) => {
742
760
  checked && updateRememberedDeviceList(device, false);
743
761
  Toast.hide();
@@ -39,12 +39,54 @@ import LocalEventEmitter, {
39
39
  import {ENABLE_AUTH} from '../auth/config';
40
40
  import {useAuth} from '../auth/AuthProvider';
41
41
  import ThemeConfig from '../theme';
42
+ import {
43
+ I18nMuteType,
44
+ hostMutedUserToastHeading,
45
+ hostRemovedUserToastHeading,
46
+ hostRequestedUserToastHeading,
47
+ hostRequestedUserToastPrimaryBtnText,
48
+ hostRequestedUserToastSecondaryBtnText,
49
+ waitingRoomApprovalRequiredPrimaryBtnText,
50
+ waitingRoomApprovalRequiredSecondaryBtnText,
51
+ waitingRoomApprovalRequiredToastHeading,
52
+ waitingRoomApprovalRequiredToastSubHeading,
53
+ } from '../language/default-labels/videoCallScreenLabels';
54
+ import {useString} from '../utils/useString';
42
55
 
43
56
  interface Props {
44
57
  children: React.ReactNode;
45
58
  }
46
59
 
47
60
  const EventsConfigure: React.FC<Props> = props => {
61
+ const hostMutedUserToastHeadingTT = useString<I18nMuteType>(
62
+ hostMutedUserToastHeading,
63
+ );
64
+ const hostRequestedUserToastHeadingTT = useString<I18nMuteType>(
65
+ hostRequestedUserToastHeading,
66
+ );
67
+ const hostRequestedUserToastPrimaryBtnTextTT = useString<I18nMuteType>(
68
+ hostRequestedUserToastPrimaryBtnText,
69
+ );
70
+ const hostRequestedUserToastSecondaryBtnTextTT = useString<I18nMuteType>(
71
+ hostRequestedUserToastSecondaryBtnText,
72
+ );
73
+
74
+ const hostRemovedUserToastHeadingTT = useString(
75
+ hostRemovedUserToastHeading,
76
+ )();
77
+
78
+ const waitingRoomApprovalRequiredToastHeadingTT = useString(
79
+ waitingRoomApprovalRequiredToastHeading,
80
+ )();
81
+ const waitingRoomApprovalRequiredToastSubHeadingTT = useString(
82
+ waitingRoomApprovalRequiredToastSubHeading,
83
+ );
84
+ const waitingRoomApprovalRequiredPrimaryBtnTextTT = useString(
85
+ waitingRoomApprovalRequiredPrimaryBtnText,
86
+ )();
87
+ const waitingRoomApprovalRequiredSecondaryBtnTextTT = useString(
88
+ waitingRoomApprovalRequiredSecondaryBtnText,
89
+ )();
48
90
  //@ts-ignore
49
91
  const {isScreenshareActive, ScreenshareStoppedCallback, stopUserScreenShare} =
50
92
  useScreenshare();
@@ -106,7 +148,7 @@ const EventsConfigure: React.FC<Props> = props => {
106
148
  // text1: `${
107
149
  // defaultContentRef.current.defaultContent[sender].name || 'The host'
108
150
  // } muted you.`,
109
- text1: 'The host has muted your video.',
151
+ text1: hostMutedUserToastHeadingTT(I18nMuteType.video),
110
152
  visibilityTime: 3000,
111
153
  primaryBtn: null,
112
154
  secondaryBtn: null,
@@ -137,7 +179,7 @@ const EventsConfigure: React.FC<Props> = props => {
137
179
  // text1: `${
138
180
  // defaultContentRef.current.defaultContent[sender].name || 'The host'
139
181
  // } muted you.`,
140
- text1: 'The host has muted your audio.',
182
+ text1: hostMutedUserToastHeadingTT(I18nMuteType.audio),
141
183
  visibilityTime: 3000,
142
184
  primaryBtn: null,
143
185
  secondaryBtn: null,
@@ -167,7 +209,7 @@ const EventsConfigure: React.FC<Props> = props => {
167
209
  Toast.show({
168
210
  leadingIconName: 'info',
169
211
  type: 'info',
170
- text1: 'The host has removed you from the room.',
212
+ text1: hostRemovedUserToastHeadingTT,
171
213
  visibilityTime: 5000,
172
214
  primaryBtn: null,
173
215
  secondaryBtn: null,
@@ -183,7 +225,7 @@ const EventsConfigure: React.FC<Props> = props => {
183
225
  Toast.show({
184
226
  leadingIconName: 'mic-on',
185
227
  type: 'info',
186
- text1: 'The host has requested you to speak',
228
+ text1: hostRequestedUserToastHeadingTT(I18nMuteType.audio),
187
229
  visibilityTime: 3000,
188
230
  leadingIcon: null,
189
231
  primaryBtn:
@@ -194,7 +236,7 @@ const EventsConfigure: React.FC<Props> = props => {
194
236
  <PrimaryButton
195
237
  containerStyle={style.primaryBtn}
196
238
  textStyle={style.textStyle}
197
- text="UNMUTE"
239
+ text={hostRequestedUserToastPrimaryBtnTextTT(I18nMuteType.audio)}
198
240
  onPress={() => {
199
241
  RtcEngineUnsafe.muteLocalAudioStream(false);
200
242
  dispatch({
@@ -208,16 +250,21 @@ const EventsConfigure: React.FC<Props> = props => {
208
250
  secondaryBtn:
209
251
  permissionStatusRef.current ===
210
252
  PermissionState.GRANTED_FOR_CAM_AND_MIC ||
211
- permissionStatusRef.current === PermissionState.GRANTED_FOR_MIC_ONLY
212
- ? SecondaryBtn
213
- : null,
253
+ permissionStatusRef.current ===
254
+ PermissionState.GRANTED_FOR_MIC_ONLY ? (
255
+ <SecondaryBtn
256
+ text={hostRequestedUserToastSecondaryBtnTextTT(
257
+ I18nMuteType.audio,
258
+ )}
259
+ />
260
+ ) : null,
214
261
  });
215
262
  });
216
263
  events.on(controlMessageEnum.requestVideo, () => {
217
264
  Toast.show({
218
265
  leadingIconName: 'video-on',
219
266
  type: 'info',
220
- text1: 'The host has asked you to start your video.',
267
+ text1: hostRequestedUserToastHeadingTT(I18nMuteType.video),
221
268
  visibilityTime: 3000,
222
269
  leadingIcon: null,
223
270
  primaryBtn:
@@ -228,7 +275,7 @@ const EventsConfigure: React.FC<Props> = props => {
228
275
  <PrimaryButton
229
276
  containerStyle={style.primaryBtn}
230
277
  textStyle={style.textStyle}
231
- text="UNMUTE"
278
+ text={hostRequestedUserToastPrimaryBtnTextTT(I18nMuteType.video)}
232
279
  onPress={async () => {
233
280
  isWebInternal()
234
281
  ? await RtcEngineUnsafe.muteLocalVideoStream(false)
@@ -246,9 +293,14 @@ const EventsConfigure: React.FC<Props> = props => {
246
293
  secondaryBtn:
247
294
  permissionStatusRef.current ===
248
295
  PermissionState.GRANTED_FOR_CAM_AND_MIC ||
249
- permissionStatusRef.current === PermissionState.GRANTED_FOR_CAM_ONLY
250
- ? SecondaryBtn
251
- : null,
296
+ permissionStatusRef.current ===
297
+ PermissionState.GRANTED_FOR_CAM_ONLY ? (
298
+ <SecondaryBtn
299
+ text={hostRequestedUserToastSecondaryBtnTextTT(
300
+ I18nMuteType.video,
301
+ )}
302
+ />
303
+ ) : null,
252
304
  });
253
305
  });
254
306
 
@@ -419,7 +471,7 @@ const EventsConfigure: React.FC<Props> = props => {
419
471
  <PrimaryButton
420
472
  containerStyle={style.primaryBtn}
421
473
  textStyle={style.textStyle}
422
- text="Admit"
474
+ text={waitingRoomApprovalRequiredPrimaryBtnTextTT}
423
475
  onPress={() => {
424
476
  // user approving waiting room request
425
477
  const res = approval({
@@ -451,7 +503,7 @@ const EventsConfigure: React.FC<Props> = props => {
451
503
  <TertiaryButton
452
504
  containerStyle={style.secondaryBtn}
453
505
  textStyle={style.textStyle}
454
- text="Deny"
506
+ text={waitingRoomApprovalRequiredSecondaryBtnTextTT}
455
507
  onPress={() => {
456
508
  // user rejecting waiting room request
457
509
  const res = approval({
@@ -485,8 +537,8 @@ const EventsConfigure: React.FC<Props> = props => {
485
537
  leadingIconName: 'info',
486
538
  leadingIcon: null,
487
539
  type: 'info',
488
- text1: 'Approval Required',
489
- text2: `${userName} is waiting for approval to join the call`,
540
+ text1: waitingRoomApprovalRequiredToastHeadingTT,
541
+ text2: waitingRoomApprovalRequiredToastSubHeadingTT(userName),
490
542
  visibilityTime: 30000,
491
543
  ...btns,
492
544
  });
@@ -633,16 +685,17 @@ const style = StyleSheet.create({
633
685
  color: $config.FONT_COLOR,
634
686
  },
635
687
  });
636
- const SecondaryBtn = (
688
+ const SecondaryBtn = props => (
637
689
  <TertiaryButton
638
690
  containerStyle={style.secondaryBtn}
639
691
  textStyle={style.textStyle}
640
- text="LATER"
692
+ text={props?.text || 'LATER'}
641
693
  onPress={() => {
642
694
  Toast.hide();
643
695
  }}
644
696
  />
645
697
  );
698
+
646
699
  const PrimaryButton = props => {
647
700
  const {text, containerStyle, textStyle, onPress} = props;
648
701
  return (