agora-appbuilder-core 4.1.10-beta.1 → 4.1.11-beta.2

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 (132) hide show
  1. package/package.json +2 -2
  2. package/template/agora-rn-uikit/src/Utils/isBotUser.ts +1 -1
  3. package/template/android/app/build.gradle +0 -7
  4. package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
  5. package/template/bridge/rtm/web/Types.ts +0 -183
  6. package/template/bridge/rtm/web/index.ts +488 -450
  7. package/template/customization-api/typeDefinition.ts +0 -1
  8. package/template/defaultConfig.js +3 -4
  9. package/template/global.d.ts +0 -1
  10. package/template/ios/Podfile +0 -41
  11. package/template/package.json +5 -5
  12. package/template/src/AppRoutes.tsx +3 -3
  13. package/template/src/ai-agent/components/ControlButtons.tsx +1 -1
  14. package/template/src/assets/font-styles.css +1 -33
  15. package/template/src/assets/fonts/icomoon.ttf +0 -0
  16. package/template/src/assets/selection.json +1 -1
  17. package/template/src/atoms/ActionMenu.tsx +93 -13
  18. package/template/src/atoms/CustomIcon.tsx +1 -8
  19. package/template/src/atoms/DropDownMulti.tsx +80 -29
  20. package/template/src/atoms/Dropdown.tsx +0 -5
  21. package/template/src/atoms/Input.tsx +2 -1
  22. package/template/src/atoms/TertiaryButton.tsx +1 -1
  23. package/template/src/atoms/UserAvatar.tsx +1 -1
  24. package/template/src/components/ChatContext.ts +3 -5
  25. package/template/src/components/Controls.tsx +167 -208
  26. package/template/src/components/DeviceConfigure.tsx +1 -1
  27. package/template/src/components/EventsConfigure.tsx +168 -118
  28. package/template/src/components/Navbar.tsx +11 -14
  29. package/template/src/components/RTMConfigure.tsx +819 -32
  30. package/template/src/components/beauty-effect/useBeautyEffects.tsx +13 -50
  31. package/template/src/components/chat/chatConfigure.tsx +1 -7
  32. package/template/src/components/chat-messages/useChatMessages.tsx +11 -43
  33. package/template/src/components/controls/useControlPermissionMatrix.tsx +4 -32
  34. package/template/src/components/participants/AllHostParticipants.tsx +2 -10
  35. package/template/src/components/participants/Participant.tsx +1 -7
  36. package/template/src/components/participants/UserActionMenuOptions.tsx +2 -12
  37. package/template/src/components/precall/joinCallBtn.native.tsx +7 -2
  38. package/template/src/components/precall/joinCallBtn.tsx +7 -2
  39. package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +16 -15
  40. package/template/src/components/precall/joinWaitingRoomBtn.tsx +31 -17
  41. package/template/src/components/precall/textInput.tsx +45 -22
  42. package/template/src/components/precall/usePreCall.tsx +7 -0
  43. package/template/src/components/recordings/RecordingsDateTable.tsx +2 -3
  44. package/template/src/components/room-info/useRoomInfo.tsx +5 -0
  45. package/template/src/components/useUserPreference.tsx +12 -39
  46. package/template/src/components/virtual-background/useVB.tsx +0 -18
  47. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +0 -27
  48. package/template/src/language/default-labels/videoCallScreenLabels.ts +27 -11
  49. package/template/src/logger/AppBuilderLogger.tsx +3 -11
  50. package/template/src/pages/VideoCall.tsx +518 -171
  51. package/template/src/pages/video-call/ActionSheetContent.tsx +77 -77
  52. package/template/src/pages/video-call/SidePanelHeader.tsx +81 -53
  53. package/template/src/pages/video-call/VideoCallScreen.tsx +0 -18
  54. package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +1 -0
  55. package/template/src/rtm/RTMEngine.ts +37 -262
  56. package/template/src/rtm/utils.ts +1 -68
  57. package/template/src/rtm-events/constants.ts +7 -40
  58. package/template/src/rtm-events-api/Events.ts +39 -158
  59. package/template/src/subComponents/ChatBubble.tsx +3 -3
  60. package/template/src/subComponents/ChatContainer.tsx +9 -19
  61. package/template/src/subComponents/LocalAudioMute.tsx +2 -2
  62. package/template/src/subComponents/LocalVideoMute.tsx +2 -2
  63. package/template/src/subComponents/SidePanelEnum.tsx +0 -1
  64. package/template/src/subComponents/caption/Caption.tsx +48 -7
  65. package/template/src/subComponents/caption/CaptionContainer.tsx +324 -51
  66. package/template/src/subComponents/caption/CaptionIcon.tsx +35 -34
  67. package/template/src/subComponents/caption/CaptionText.tsx +103 -2
  68. package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +179 -69
  69. package/template/src/subComponents/caption/Transcript.tsx +46 -11
  70. package/template/src/subComponents/caption/TranscriptIcon.tsx +27 -35
  71. package/template/src/subComponents/caption/TranscriptText.tsx +78 -3
  72. package/template/src/subComponents/caption/proto/ptoto.js +38 -4
  73. package/template/src/subComponents/caption/proto/test.proto +34 -19
  74. package/template/src/subComponents/caption/useCaption.tsx +754 -11
  75. package/template/src/subComponents/caption/useSTTAPI.tsx +118 -205
  76. package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +152 -33
  77. package/template/src/subComponents/caption/useStreamMessageUtils.ts +165 -34
  78. package/template/src/subComponents/caption/utils.ts +171 -3
  79. package/template/src/subComponents/chat/ChatSendButton.tsx +0 -1
  80. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +0 -16
  81. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
  82. package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +4 -7
  83. package/template/src/utils/SdkEvents.ts +3 -0
  84. package/template/src/utils/useEndCall.ts +4 -4
  85. package/template/src/utils/useMuteToggleLocal.ts +10 -14
  86. package/template/src/utils/useSpeechToText.ts +31 -20
  87. package/template/bridge/rtm/web/index-legacy.ts +0 -540
  88. package/template/src/components/RTMConfigure-legacy.tsx +0 -848
  89. package/template/src/components/UserGlobalPreferenceProvider.tsx +0 -227
  90. package/template/src/components/breakout-room/BreakoutRoomPanel.tsx +0 -58
  91. package/template/src/components/breakout-room/context/BreakoutRoomContext.tsx +0 -2508
  92. package/template/src/components/breakout-room/events/BreakoutRoomEventsConfigure.tsx +0 -272
  93. package/template/src/components/breakout-room/events/constants.ts +0 -17
  94. package/template/src/components/breakout-room/hoc/BreakoutRoomNameRenderer.tsx +0 -68
  95. package/template/src/components/breakout-room/hooks/useBreakoutRoomExit.ts +0 -49
  96. package/template/src/components/breakout-room/state/reducer.ts +0 -522
  97. package/template/src/components/breakout-room/state/types.ts +0 -54
  98. package/template/src/components/breakout-room/ui/BreakoutMeetingTitle.tsx +0 -60
  99. package/template/src/components/breakout-room/ui/BreakoutRoomActionMenu.tsx +0 -136
  100. package/template/src/components/breakout-room/ui/BreakoutRoomAnnouncementModal.tsx +0 -135
  101. package/template/src/components/breakout-room/ui/BreakoutRoomGroupSettings.tsx +0 -588
  102. package/template/src/components/breakout-room/ui/BreakoutRoomMainRoomUsers.tsx +0 -142
  103. package/template/src/components/breakout-room/ui/BreakoutRoomMemberActionMenu.tsx +0 -122
  104. package/template/src/components/breakout-room/ui/BreakoutRoomParticipants.tsx +0 -124
  105. package/template/src/components/breakout-room/ui/BreakoutRoomRaiseHand.tsx +0 -65
  106. package/template/src/components/breakout-room/ui/BreakoutRoomRenameModal.tsx +0 -227
  107. package/template/src/components/breakout-room/ui/BreakoutRoomSettings.tsx +0 -140
  108. package/template/src/components/breakout-room/ui/BreakoutRoomTransition.tsx +0 -52
  109. package/template/src/components/breakout-room/ui/BreakoutRoomView.tsx +0 -193
  110. package/template/src/components/breakout-room/ui/ExitBreakoutRoomIconButton.tsx +0 -79
  111. package/template/src/components/breakout-room/ui/ParticipantManualAssignmentModal.tsx +0 -638
  112. package/template/src/components/breakout-room/ui/SelectParticipantAssignmentStrategy.tsx +0 -57
  113. package/template/src/components/common/Dividers.tsx +0 -53
  114. package/template/src/components/controls/toolbar-items/ExitBreakoutRoomToolbarItem.tsx +0 -13
  115. package/template/src/components/raise-hand/RaiseHandButton.tsx +0 -50
  116. package/template/src/components/raise-hand/RaiseHandProvider.tsx +0 -308
  117. package/template/src/components/raise-hand/index.ts +0 -14
  118. package/template/src/components/room-info/useCurrentRoomInfo.tsx +0 -42
  119. package/template/src/components/room-info/useSetBreakoutRoomInfo.tsx +0 -64
  120. package/template/src/pages/video-call/BreakoutVideoCall.tsx +0 -213
  121. package/template/src/pages/video-call/VideoCallContent.tsx +0 -211
  122. package/template/src/pages/video-call/VideoCallStateWrapper.tsx +0 -495
  123. package/template/src/rtm/RTMConfigureBreakoutRoomProvider.tsx +0 -882
  124. package/template/src/rtm/RTMConfigureMainRoomProvider.tsx +0 -757
  125. package/template/src/rtm/RTMCoreProvider.tsx +0 -419
  126. package/template/src/rtm/RTMGlobalStateProvider.tsx +0 -706
  127. package/template/src/rtm/RTMStatusBanner.tsx +0 -99
  128. package/template/src/rtm/constants.ts +0 -12
  129. package/template/src/rtm/hooks/useMainRoomUserDisplayName.ts +0 -45
  130. package/template/src/rtm/rtm-presence-utils.ts +0 -344
  131. package/template/src/subComponents/chat/ChatAnnouncementView.tsx +0 -65
  132. package/template/src/utils/useDebouncedCallback.tsx +0 -20
@@ -1,142 +0,0 @@
1
- import React, {useMemo} from 'react';
2
- import {View, Text, StyleSheet} from 'react-native';
3
- import {useRTMGlobalState} from '../../../rtm/RTMGlobalStateProvider';
4
- import ThemeConfig from '../../../theme';
5
- import {useBreakoutRoom} from '../context/BreakoutRoomContext';
6
- import UserAvatar from '../../../atoms/UserAvatar';
7
- import Tooltip from '../../../atoms/Tooltip';
8
- import {useString} from '../../../utils/useString';
9
- import {videoRoomUserFallbackText} from '../../../language/default-labels/videoCallScreenLabels';
10
-
11
- interface MainRoomUser {
12
- uid: number;
13
- name: string;
14
- }
15
-
16
- const BreakoutRoomMainRoomUsers = ({scrollOffset}) => {
17
- const {mainRoomRTMUsers} = useRTMGlobalState();
18
- const {breakoutGroups, breakoutRoomVersion} = useBreakoutRoom();
19
- const remoteUserDefaultLabel = useString(videoRoomUserFallbackText)();
20
-
21
- // Get all assigned users from breakout rooms
22
- const assignedUserUids = useMemo(() => {
23
- const assigned = new Set<number>();
24
- breakoutGroups.forEach(group => {
25
- group.participants.hosts.forEach(uid => assigned.add(uid));
26
- group.participants.attendees.forEach(uid => assigned.add(uid));
27
- });
28
- return assigned;
29
- }, [breakoutRoomVersion]);
30
-
31
- // Filter main room users to only show those not assigned to breakout rooms
32
- const mainRoomOnlyUsers = useMemo(() => {
33
- const users: MainRoomUser[] = [];
34
-
35
- Object.entries(mainRoomRTMUsers).forEach(([uidStr, userData]) => {
36
- const uid = parseInt(uidStr, 10);
37
-
38
- // Skip if user is assigned to a breakout room
39
- if (assignedUserUids.has(uid)) {
40
- return;
41
- }
42
-
43
- // Only include RTC users who are online
44
- if (userData.type === 'rtc' && !userData.offline) {
45
- users.push({
46
- uid,
47
- name: userData.name || remoteUserDefaultLabel,
48
- });
49
- }
50
- });
51
-
52
- return users;
53
- }, [mainRoomRTMUsers, assignedUserUids, breakoutRoomVersion]);
54
-
55
- return (
56
- <View style={style.card}>
57
- <View style={style.section}>
58
- <Text style={style.title}>Main Room ({mainRoomOnlyUsers.length})</Text>
59
- <View style={style.participantContainer}>
60
- {mainRoomOnlyUsers.map(user => (
61
- <View key={user.uid}>
62
- <Tooltip
63
- key={user.uid}
64
- scrollY={scrollOffset}
65
- toolTipMessage={user.name}
66
- renderContent={() => {
67
- return (
68
- <UserAvatar
69
- name={user.name}
70
- containerStyle={style.userAvatarContainer}
71
- textStyle={style.userAvatarText}
72
- />
73
- );
74
- }}
75
- />
76
- </View>
77
- ))}
78
- </View>
79
- {mainRoomOnlyUsers.length === 0 && (
80
- <Text style={style.emptyText}>No users online in main room</Text>
81
- )}
82
- </View>
83
- </View>
84
- );
85
- };
86
-
87
- export default BreakoutRoomMainRoomUsers;
88
-
89
- const style = StyleSheet.create({
90
- card: {
91
- width: '100%',
92
- padding: 16,
93
- display: 'flex',
94
- flexDirection: 'column',
95
- justifyContent: 'center',
96
- alignItems: 'center',
97
- borderRadius: 8,
98
- backgroundColor: $config.CARD_LAYER_2_COLOR,
99
- borderColor: $config.CARD_LAYER_3_COLOR,
100
- gap: 12,
101
- },
102
- section: {
103
- width: '100%',
104
- display: 'flex',
105
- flexDirection: 'column',
106
- gap: 12,
107
- },
108
- title: {
109
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.high,
110
- fontSize: ThemeConfig.FontSize.small,
111
- lineHeight: 16,
112
- fontWeight: '500',
113
- opacity: 0.8,
114
- },
115
- participantContainer: {
116
- display: 'flex',
117
- flexDirection: 'row',
118
- gap: 5,
119
- },
120
- emptyText: {
121
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.medium,
122
- fontSize: ThemeConfig.FontSize.tiny,
123
- lineHeight: 16,
124
- fontWeight: '400',
125
- },
126
- userAvatarContainer: {
127
- backgroundColor: $config.VIDEO_AUDIO_TILE_AVATAR_COLOR,
128
- width: 24,
129
- height: 24,
130
- borderRadius: 12,
131
- display: 'flex',
132
- alignItems: 'center',
133
- justifyContent: 'center',
134
- },
135
- userAvatarText: {
136
- fontSize: ThemeConfig.FontSize.tiny,
137
- lineHeight: 24,
138
- fontWeight: '600',
139
- color: $config.BACKGROUND_COLOR,
140
- display: 'flex',
141
- },
142
- });
@@ -1,122 +0,0 @@
1
- /*
2
- ********************************************
3
- Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the "Materials") are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.'s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
10
- *********************************************
11
- */
12
-
13
- import React, {useState, useEffect, useRef} from 'react';
14
- import {View, useWindowDimensions} from 'react-native';
15
- import ActionMenu, {ActionMenuItem} from '../../../atoms/ActionMenu';
16
- import {calculatePosition} from '../../../utils/common';
17
- import {useBreakoutRoom} from '../context/BreakoutRoomContext';
18
- import {UidType} from '../../../../agora-rn-uikit';
19
- import IconButton from '../../../atoms/IconButton';
20
-
21
- interface BreakoutRoomMemberActionMenuProps {
22
- memberUid: UidType;
23
- }
24
-
25
- const BreakoutRoomMemberActionMenu: React.FC<
26
- BreakoutRoomMemberActionMenuProps
27
- > = ({memberUid}) => {
28
- const [actionMenuVisible, setActionMenuVisible] = useState(false);
29
- const [isPosCalculated, setIsPosCalculated] = useState(false);
30
- const [modalPosition, setModalPosition] = useState({});
31
- const {width: globalWidth, height: globalHeight} = useWindowDimensions();
32
- const moreIconRef = useRef(null);
33
-
34
- const {getRoomMemberDropdownOptions} = useBreakoutRoom();
35
-
36
- // Get member-specific dropdown options using breakout room context
37
- const memberOptions = getRoomMemberDropdownOptions(memberUid);
38
-
39
- // Transform to ActionMenuItem format
40
- const actionMenuItems: ActionMenuItem[] = memberOptions.map(
41
- (option, index) => ({
42
- order: index + 1,
43
- icon: option.icon,
44
- iconColor: $config.SECONDARY_ACTION_COLOR,
45
- textColor: $config.SECONDARY_ACTION_COLOR,
46
- title: option.title,
47
- onPress: () => {
48
- option.onOptionPress();
49
- setActionMenuVisible(false);
50
- },
51
- }),
52
- );
53
-
54
- // Calculate position when menu becomes visible
55
- useEffect(() => {
56
- if (actionMenuVisible) {
57
- moreIconRef?.current?.measure(
58
- (
59
- _fx: number,
60
- _fy: number,
61
- localWidth: number,
62
- localHeight: number,
63
- px: number,
64
- py: number,
65
- ) => {
66
- const data = calculatePosition({
67
- px,
68
- py,
69
- localWidth,
70
- localHeight,
71
- globalHeight,
72
- globalWidth,
73
- });
74
- setModalPosition(data);
75
- setIsPosCalculated(true);
76
- },
77
- );
78
- }
79
- }, [actionMenuVisible]);
80
-
81
- // Don't render if no actions available
82
- if (actionMenuItems.length === 0) {
83
- return null;
84
- }
85
-
86
- return (
87
- <>
88
- <ActionMenu
89
- from={'breakout-room-member-actions'}
90
- actionMenuVisible={actionMenuVisible && isPosCalculated}
91
- setActionMenuVisible={setActionMenuVisible}
92
- modalPosition={modalPosition}
93
- items={actionMenuItems}
94
- />
95
- <View
96
- ref={moreIconRef}
97
- collapsable={false}
98
- style={{
99
- width: 24,
100
- height: 24,
101
- alignSelf: 'center',
102
- justifyContent: 'center',
103
- alignItems: 'center',
104
- }}>
105
- <IconButton
106
- hoverEffect={false}
107
- iconProps={{
108
- iconType: 'plain',
109
- name: 'more-menu',
110
- iconSize: 20,
111
- tintColor: $config.SECONDARY_ACTION_COLOR,
112
- }}
113
- onPress={() => {
114
- setActionMenuVisible(true);
115
- }}
116
- />
117
- </View>
118
- </>
119
- );
120
- };
121
-
122
- export default BreakoutRoomMemberActionMenu;
@@ -1,124 +0,0 @@
1
- /*
2
- ********************************************
3
- Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the "Materials") are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.'s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
10
- *********************************************
11
- */
12
-
13
- import React from 'react';
14
- import {View, Text, StyleSheet} from 'react-native';
15
- import UserAvatar from '../../../atoms/UserAvatar';
16
- import {ContentInterface, UidType} from '../../../../agora-rn-uikit';
17
- import ThemeConfig from '../../../theme';
18
- import ImageIcon from '../../../atoms/ImageIcon';
19
- import Tooltip from '../../../atoms/Tooltip';
20
- import {BreakoutRoomUser} from '../state/reducer';
21
-
22
- interface Props {
23
- isHost?: boolean;
24
- participants?: {uid: UidType; user: BreakoutRoomUser}[];
25
- }
26
-
27
- const BreakoutRoomParticipants: React.FC<Props> = ({
28
- participants,
29
- isHost = false,
30
- }) => {
31
- return (
32
- <>
33
- <View
34
- style={[
35
- styles.titleContainer,
36
- participants?.length > 0 ? {} : styles.titleLowOpacity,
37
- ]}>
38
- <View>
39
- <ImageIcon
40
- iconType="plain"
41
- name="people"
42
- tintColor={$config.FONT_COLOR}
43
- iconSize={20}
44
- />
45
- </View>
46
- <Text style={styles.title}>
47
- Main Room {isHost ? `(${participants.length} unassigned)` : ''}
48
- </Text>
49
- </View>
50
- <View style={styles.participantContainer}>
51
- {participants.length > 0 ? (
52
- participants.map(item => (
53
- <View style={[styles.participantItem]} key={item.uid}>
54
- <Tooltip
55
- toolTipMessage={item.user.name}
56
- renderContent={() => {
57
- return (
58
- <UserAvatar
59
- name={item.user.name}
60
- containerStyle={styles.userAvatarContainer}
61
- textStyle={styles.userAvatarText}
62
- />
63
- );
64
- }}
65
- />
66
- </View>
67
- ))
68
- ) : (
69
- <Text style={styles.emptyStateText}>
70
- {isHost
71
- ? 'No participants available for breakout rooms'
72
- : 'No members'}
73
- </Text>
74
- )}
75
- </View>
76
- </>
77
- );
78
- };
79
-
80
- const styles = StyleSheet.create({
81
- titleLowOpacity: {
82
- opacity: 0.2,
83
- },
84
- titleContainer: {
85
- display: 'flex',
86
- flexDirection: 'row',
87
- gap: 4,
88
- alignItems: 'center',
89
- },
90
- title: {
91
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.high,
92
- fontSize: ThemeConfig.FontSize.small,
93
- lineHeight: 16,
94
- fontWeight: '500',
95
- },
96
- participantContainer: {
97
- display: 'flex',
98
- flexDirection: 'row',
99
- gap: 5,
100
- },
101
- participantItem: {},
102
- userAvatarContainer: {
103
- backgroundColor: $config.VIDEO_AUDIO_TILE_AVATAR_COLOR,
104
- width: 24,
105
- height: 24,
106
- borderRadius: 12,
107
- display: 'flex',
108
- alignItems: 'center',
109
- justifyContent: 'center',
110
- },
111
- userAvatarText: {
112
- fontSize: ThemeConfig.FontSize.tiny,
113
- lineHeight: 12,
114
- fontWeight: '600',
115
- color: $config.BACKGROUND_COLOR,
116
- display: 'flex',
117
- },
118
- emptyStateText: {
119
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.low,
120
- fontSize: ThemeConfig.FontSize.tiny,
121
- },
122
- });
123
-
124
- export default BreakoutRoomParticipants;
@@ -1,65 +0,0 @@
1
- import React from 'react';
2
- import {View, StyleSheet, Text} from 'react-native';
3
- import ImageIcon from '../../../atoms/ImageIcon';
4
- import ThemeConfig from '../../../theme';
5
- import {useBreakoutRoom} from '../context/BreakoutRoomContext';
6
- import {RaiseHandButton} from '../../raise-hand';
7
-
8
- export default function BreakoutRoomRaiseHand() {
9
- const {isUserInRoom} = useBreakoutRoom();
10
- return (
11
- <View style={style.card}>
12
- {!isUserInRoom() ? (
13
- <View style={style.cardHeader}>
14
- <ImageIcon
15
- iconType="plain"
16
- name="info"
17
- iconSize={20}
18
- tintColor={$config.SECONDARY_ACTION_COLOR}
19
- />
20
- <Text style={style.infoText}>
21
- Please wait, the meeting host will assign you to a room shortly.
22
- </Text>
23
- </View>
24
- ) : (
25
- <></>
26
- )}
27
- <View style={style.cardFooter}>
28
- <RaiseHandButton />
29
- </View>
30
- </View>
31
- );
32
- }
33
-
34
- const style = StyleSheet.create({
35
- card: {
36
- width: '100%',
37
- padding: 16,
38
- display: 'flex',
39
- flexDirection: 'column',
40
- justifyContent: 'center',
41
- alignItems: 'center',
42
- borderRadius: 8,
43
- backgroundColor: $config.CARD_LAYER_2_COLOR,
44
- borderColor: $config.CARD_LAYER_3_COLOR,
45
- gap: 16,
46
- },
47
- cardHeader: {
48
- display: 'flex',
49
- flexDirection: 'row',
50
- justifyContent: 'flex-start',
51
- alignItems: 'center',
52
- gap: 8,
53
- },
54
- cardFooter: {
55
- display: 'flex',
56
- flex: 1,
57
- width: '100%',
58
- },
59
- infoText: {
60
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.high,
61
- fontSize: ThemeConfig.FontSize.tiny,
62
- fontWeight: '400',
63
- lineHeight: 16,
64
- },
65
- });
@@ -1,227 +0,0 @@
1
- import React, {SetStateAction, Dispatch} from 'react';
2
- import {View, StyleSheet, TextInput, Text} from 'react-native';
3
- import GenericModal from '../../common/GenericModal';
4
- import ThemeConfig from '../../../theme';
5
- import TertiaryButton from '../../../atoms/TertiaryButton';
6
-
7
- interface BreakoutRoomRenameModalProps {
8
- setModalOpen: Dispatch<SetStateAction<boolean>>;
9
- currentRoomName: string;
10
- updateRoomName: (newName: string) => void;
11
- existingRoomNames: string[];
12
- }
13
-
14
- export default function BreakoutRoomRenameModal(
15
- props: BreakoutRoomRenameModalProps,
16
- ) {
17
- const {currentRoomName, setModalOpen, updateRoomName, existingRoomNames} =
18
- props;
19
- const [roomName, setRoomName] = React.useState(currentRoomName);
20
-
21
- const MAX_ROOM_NAME_LENGTH = 30;
22
-
23
- // Helper function to normalize room name (trim and collapse multiple spaces)
24
- const normalizeRoomName = (name: string) => {
25
- return name.trim().replace(/\s+/g, ' ');
26
- };
27
-
28
- // Check if the normalized room name already exists in other rooms
29
- const isDuplicateName = existingRoomNames.some(existingName => {
30
- const normalizedExistingName =
31
- normalizeRoomName(existingName).toLowerCase();
32
- const normalizedNewName = normalizeRoomName(roomName).toLowerCase();
33
- const normalizedCurrentName =
34
- normalizeRoomName(currentRoomName).toLowerCase();
35
-
36
- return (
37
- normalizedExistingName === normalizedNewName &&
38
- normalizedExistingName !== normalizedCurrentName
39
- );
40
- });
41
-
42
- const disabled =
43
- roomName.trim() === '' ||
44
- roomName.trim().length > MAX_ROOM_NAME_LENGTH ||
45
- normalizeRoomName(roomName).toLowerCase() ===
46
- normalizeRoomName(currentRoomName).toLowerCase() ||
47
- isDuplicateName;
48
-
49
- return (
50
- <GenericModal
51
- visible={true}
52
- onRequestClose={() => setModalOpen(false)}
53
- showCloseIcon={true}
54
- title={'Rename Room'}
55
- cancelable={true}
56
- contentContainerStyle={style.contentContainer}>
57
- <View style={style.fullBody}>
58
- <View style={style.mbody}>
59
- <View style={style.form}>
60
- <Text style={style.label}>Room name</Text>
61
- <TextInput
62
- id="room-rename-text"
63
- style={[
64
- style.inputBox,
65
- roomName.trim().length > MAX_ROOM_NAME_LENGTH &&
66
- style.inputBoxError,
67
- ]}
68
- value={roomName}
69
- onChangeText={setRoomName}
70
- placeholder="Rename room..."
71
- placeholderTextColor={
72
- $config.FONT_COLOR + ThemeConfig.EmphasisPlus.low
73
- }
74
- underlineColorAndroid="transparent"
75
- maxLength={50}
76
- />
77
- <View style={style.inputFooter}>
78
- <Text
79
- style={[
80
- style.characterCount,
81
- (roomName.trim().length > MAX_ROOM_NAME_LENGTH ||
82
- isDuplicateName) &&
83
- style.characterCountError,
84
- ]}>
85
- {roomName.trim().length}/{MAX_ROOM_NAME_LENGTH}
86
- </Text>
87
- {roomName.trim().length > MAX_ROOM_NAME_LENGTH && (
88
- <Text style={style.errorText}>
89
- Room name cannot exceed {MAX_ROOM_NAME_LENGTH} characters
90
- </Text>
91
- )}
92
- {isDuplicateName && (
93
- <Text style={style.errorText}>
94
- A room with this name already exists
95
- </Text>
96
- )}
97
- </View>
98
- </View>
99
- </View>
100
- <View style={style.mfooter}>
101
- <View>
102
- <TertiaryButton
103
- containerStyle={style.cancelBtn}
104
- textStyle={style.actionBtnText}
105
- text={'Cancel'}
106
- onPress={() => {
107
- setModalOpen(false);
108
- }}
109
- />
110
- </View>
111
- <View>
112
- <TertiaryButton
113
- containerStyle={disabled ? style.disabledSendBtn : style.sendBtn}
114
- textStyle={style.actionBtnText}
115
- text={'Save'}
116
- disabled={disabled}
117
- onPress={() => {
118
- updateRoomName(normalizeRoomName(roomName));
119
- }}
120
- />
121
- </View>
122
- </View>
123
- </View>
124
- </GenericModal>
125
- );
126
- }
127
-
128
- const style = StyleSheet.create({
129
- contentContainer: {
130
- display: 'flex',
131
- flexDirection: 'column',
132
- alignItems: 'flex-start',
133
- flexShrink: 0,
134
- width: '100%',
135
- maxWidth: 500,
136
- height: 272,
137
- },
138
- fullBody: {
139
- width: '100%',
140
- height: '100%',
141
- flex: 1,
142
- },
143
- mbody: {
144
- padding: 12,
145
- borderTopColor: $config.CARD_LAYER_3_COLOR,
146
- borderTopWidth: 1,
147
- borderBottomColor: $config.CARD_LAYER_3_COLOR,
148
- borderBottomWidth: 1,
149
- },
150
- form: {
151
- display: 'flex',
152
- flexDirection: 'column',
153
- gap: 12,
154
- width: '100%',
155
- },
156
- mfooter: {
157
- padding: 12,
158
- gap: 12,
159
- display: 'flex',
160
- flexDirection: 'row',
161
- alignItems: 'center',
162
- justifyContent: 'flex-end',
163
- },
164
- label: {
165
- fontSize: ThemeConfig.FontSize.small,
166
- fontWeight: '500',
167
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.high,
168
- lineHeight: 16,
169
- },
170
- inputBox: {
171
- fontSize: ThemeConfig.FontSize.normal,
172
- fontWeight: '400',
173
- color: $config.FONT_COLOR,
174
- padding: 20,
175
- lineHeight: 20,
176
- borderRadius: 8,
177
- borderWidth: 1,
178
- borderColor: $config.INPUT_FIELD_BORDER_COLOR,
179
- backgroundColor: $config.INPUT_FIELD_BACKGROUND_COLOR,
180
- outline: 'none',
181
- },
182
- inputBoxError: {
183
- borderColor: $config.SEMANTIC_ERROR,
184
- },
185
- inputFooter: {
186
- display: 'flex',
187
- flexDirection: 'row',
188
- justifyContent: 'space-between',
189
- alignItems: 'center',
190
- marginTop: 4,
191
- },
192
- characterCount: {
193
- fontSize: ThemeConfig.FontSize.tiny,
194
- fontWeight: '400',
195
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.medium,
196
- },
197
- characterCountError: {
198
- color: $config.SEMANTIC_ERROR,
199
- },
200
- errorText: {
201
- fontSize: ThemeConfig.FontSize.tiny,
202
- fontWeight: '400',
203
- color: $config.SEMANTIC_ERROR,
204
- },
205
- actionBtnText: {
206
- color: $config.SECONDARY_ACTION_COLOR,
207
- fontSize: ThemeConfig.FontSize.small,
208
- lineHeight: 16,
209
- },
210
- cancelBtn: {
211
- borderRadius: 4,
212
- minWidth: 140,
213
- borderColor: $config.SECONDARY_ACTION_COLOR,
214
- backgroundColor: 'transparent',
215
- },
216
- sendBtn: {
217
- borderRadius: 4,
218
- minWidth: 140,
219
- borderColor: $config.PRIMARY_ACTION_BRAND_COLOR,
220
- backgroundColor: $config.PRIMARY_ACTION_BRAND_COLOR,
221
- },
222
- disabledSendBtn: {
223
- borderRadius: 4,
224
- minWidth: 140,
225
- backgroundColor: $config.SEMANTIC_NEUTRAL,
226
- },
227
- });