diff --git a/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsGrid.tsx b/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsGrid.tsx index ea9ca6e62..a8f1b4c4e 100644 --- a/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsGrid.tsx +++ b/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsGrid.tsx @@ -12,7 +12,6 @@ import { CallContentProps } from '../CallContent'; import { ParticipantViewComponentProps } from '../../Participant'; import { useIsInPiPMode } from '../../../hooks/useIsInPiPMode'; import { StreamVideoParticipant } from '@stream-io/video-client'; -// import { generateMockParticipants } from '.'; /** * Props for the CallParticipantsGrid component. @@ -61,9 +60,6 @@ export const CallParticipantsGrid = ({ }; let participants = allParticipants; - // console.log('🚀 ~ participants:', participants); - // let participants = generateMockParticipants(9); - const isInPiPMode = useIsInPiPMode(disablePictureInPicture); if (isInPiPMode) { participants = diff --git a/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx b/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx index 9f13d2fb1..f746d10ec 100644 --- a/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +++ b/packages/react-native-sdk/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx @@ -18,7 +18,6 @@ import { import { useTheme } from '../../../contexts/ThemeContext'; import { CallContentProps } from '../CallContent'; import { useIsInPiPMode } from '../../../hooks/useIsInPiPMode'; -// import { generateMockParticipants } from '.'; /** * Props for the CallParticipantsSpotlight component. @@ -65,11 +64,10 @@ export const CallParticipantsSpotlight = ({ sortBy: speakerLayoutSortPreset, }); let allParticipants = useDebouncedValue(_allParticipants, 300); // we debounce the participants to avoid unnecessary rerenders that happen when participant tracks are all subscribed simultaneously - // allParticipants = generateMockParticipants(10); // for testing const [participantInSpotlight, ...otherParticipants] = allParticipants; const isScreenShareOnSpotlight = participantInSpotlight && hasScreenShare(participantInSpotlight); - const isUserAloneInCall = allParticipants?.length === 1; + const isUserAloneInCall = _allParticipants?.length === 1; const isInPiP = useIsInPiPMode(disablePictureInPicture); diff --git a/packages/react-native-sdk/src/components/Call/CallLayout/index.ts b/packages/react-native-sdk/src/components/Call/CallLayout/index.ts index abcb8fec4..7a8274996 100644 --- a/packages/react-native-sdk/src/components/Call/CallLayout/index.ts +++ b/packages/react-native-sdk/src/components/Call/CallLayout/index.ts @@ -1,221 +1,2 @@ export * from './CallParticipantsGrid'; export * from './CallParticipantsSpotlight'; - -// TODO: before merge remove this -export const generateMockParticipants = (count: number) => { - const mockParticipants = [ - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=john&name=john', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 361467495, seconds: '1729747222' }, - name: 'john', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'dd179c0a-2b5d-41b7-be4b-fa8758f92d5a', - trackLookupPrefix: '9c7a05feecd46070', - userId: 'john', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=Marko&name=Marko', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 227903648, seconds: '1729747225' }, - name: 'Marko', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: '05a4a2da-3760-4c01-b193-ede42027a3cw', - trackLookupPrefix: 'f055633e656610db', - userId: 'Marko', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=kristian&name=kristian', - isDominantSpeaker: false, - isLocalParticipant: true, - isSpeaking: false, - joinedAt: { nanos: 782654015, seconds: '1729747234' }, - name: 'kristian', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: '0c907764-84ee-40b4-a7b5-b02c8e6eeae4', - trackLookupPrefix: '03ded86c7006b12f', - userId: 'kristian', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=sarah&name=sarah', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 782654015, seconds: '1729747234' }, - name: 'Sarah', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: '0c907764-84ee-40b4-a7b5-b02c8e6eeaef4', - trackLookupPrefix: '03ded86c7006b12f', - userId: 'sarah', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=alice&name=alice', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 123456789, seconds: '1729747240' }, - name: 'Alice', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'f8d4a2cd-4599-41a8-a457-4e23876e1ac2', - trackLookupPrefix: 'b9d0f9c25f83c63a', - userId: 'alice', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=bob&name=bob', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 987654321, seconds: '1729747250' }, - name: 'Bob', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'a4d3f2b9-783d-4b87-9c02-e8c9a8a75d3f', - trackLookupPrefix: 'd3b2c9a75d3f4b87', - userId: 'bob', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=charlie&name=charlie', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 543210987, seconds: '1729747260' }, - name: 'Charlie', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'b5f2a3c4-2d6e-4f89-8a9e-1c3d5e6f7a89', - trackLookupPrefix: 'c3d5e6f7a89f4f89', - userId: 'charlie', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=david&name=david', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 876543210, seconds: '1729747270' }, - name: 'David', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'c2d5f3a4-9e7b-4c89-a03e-1b5f2d3e4a5b', - trackLookupPrefix: 'f2d3e4a5b3c9e7b4', - userId: 'david', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=emma&name=emma', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 654321098, seconds: '1729747280' }, - name: 'Emma', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'd3a5c4b2-8e7f-4c89-a2b1-3d5f6e7a8c90', - trackLookupPrefix: 'e7a8c90b4c89f4a7', - userId: 'emma', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - { - audioLevel: 0, - connectionQuality: 3, - custom: { fields: {} }, - image: 'https://getstream.io/random_png/?id=frank&name=frank', - isDominantSpeaker: false, - isLocalParticipant: false, - isSpeaking: false, - joinedAt: { nanos: 321098765, seconds: '1729747290' }, - name: 'Frank', - publishedTracks: [], - reaction: undefined, - roles: ['user'], - sessionId: 'e2b1d4c3-5f8e-4a7b-90c3-f5a6e8d7c9b0', - trackLookupPrefix: 'f8e7a6d9b0c4f5b3', - userId: 'frank', - viewportVisibilityState: { - screenShareTrack: 'UNKNOWN', - videoTrack: 'VISIBLE', - }, - }, - ]; - - // Limit the returned participants to the requested count - return mockParticipants.slice(0, count); -};