Browse Source

feat(rn-sdk): add getRoomsInfo ref callback

factor2
Abbas Al-Mansoori 1 year ago
parent
commit
1bc50ea71c
1 changed files with 15 additions and 1 deletions
  1. 15
    1
      react-native-sdk/index.tsx

+ 15
- 1
react-native-sdk/index.tsx View File

@@ -16,6 +16,8 @@ import { View, ViewStyle } from 'react-native';
16 16
 import { appNavigate } from './react/features/app/actions.native';
17 17
 import { App } from './react/features/app/components/App.native';
18 18
 import { setAudioMuted, setVideoMuted } from './react/features/base/media/actions';
19
+import { getRoomsInfo } from './react/features/breakout-rooms/functions';
20
+import type { IRoomsInfo } from '../react/features/breakout-rooms/types';
19 21
 
20 22
 
21 23
 interface IEventListeners {
@@ -49,10 +51,17 @@ interface IAppProps {
49 51
     userInfo?: IUserInfo;
50 52
 }
51 53
 
54
+export interface JitsiRefProps {
55
+    close: Function;
56
+    setAudioMuted?: (muted: boolean) => void;
57
+    setVideoMuted?: (muted: boolean) => void;
58
+    getRoomsInfo?: () => IRoomsInfo;
59
+}
60
+
52 61
 /**
53 62
  * Main React Native SDK component that displays a Jitsi Meet conference and gets all required params as props
54 63
  */
55
-export const JitsiMeeting = forwardRef((props: IAppProps, ref) => {
64
+export const JitsiMeeting = forwardRef<JitsiRefProps, IAppProps>((props, ref) => {
56 65
     const [ appProps, setAppProps ] = useState({});
57 66
     const app = useRef(null);
58 67
     const {
@@ -82,6 +91,11 @@ export const JitsiMeeting = forwardRef((props: IAppProps, ref) => {
82 91
             const dispatch = app.current.state.store.dispatch;
83 92
 
84 93
             dispatch(setVideoMuted(muted));
94
+        },
95
+        getRoomsInfo: () => {
96
+            const state = app.current.state.store.getState();
97
+
98
+            return getRoomsInfo(state);
85 99
         }
86 100
     }));
87 101
 

Loading…
Cancel
Save