@stream-io/video-react-native-sdk 0.0.28 → 0.1.1
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/CHANGELOG.md +18 -0
- package/README.md +19 -10
- package/dist/commonjs/components/Call/CallContent/CallContent.js +7 -3
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/CallControls.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/{ReactionButton.js → ReactionsButton.js} +8 -8
- package/dist/commonjs/components/Call/CallControls/ReactionsButton.js.map +1 -0
- package/dist/commonjs/components/Call/CallControls/index.js +4 -4
- package/dist/commonjs/components/Call/CallControls/index.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js +10 -9
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +2 -0
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +4 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +5 -2
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +7 -23
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js +63 -0
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js.map +1 -0
- package/dist/commonjs/components/Call/Lobby/index.js +11 -0
- package/dist/commonjs/components/Call/Lobby/index.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/index.js +4 -2
- package/dist/commonjs/components/Participant/FloatingParticipantView/index.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js +4 -18
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js +4 -2
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
- package/dist/commonjs/constants/index.js.map +1 -1
- package/dist/commonjs/translations/en.json +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +1 -2
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +7 -3
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallControls/CallControls.js.map +1 -1
- package/dist/module/components/Call/CallControls/{ReactionButton.js → ReactionsButton.js} +6 -6
- package/dist/module/components/Call/CallControls/ReactionsButton.js.map +1 -0
- package/dist/module/components/Call/CallControls/index.js +1 -1
- package/dist/module/components/Call/CallControls/index.js.map +1 -1
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js +10 -9
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +2 -0
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +4 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +5 -2
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +7 -23
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/Lobby/LobbyFooter.js +56 -0
- package/dist/module/components/Call/Lobby/LobbyFooter.js.map +1 -0
- package/dist/module/components/Call/Lobby/index.js +1 -0
- package/dist/module/components/Call/Lobby/index.js.map +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/index.js +4 -2
- package/dist/module/components/Participant/FloatingParticipantView/index.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js +6 -20
- package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantView.js +4 -2
- package/dist/module/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
- package/dist/module/constants/index.js.map +1 -1
- package/dist/module/translations/en.json +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +1 -2
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts +17 -8
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/CallControls.d.ts +2 -6
- package/dist/typescript/components/Call/CallControls/CallControls.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts +20 -0
- package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts.map +1 -0
- package/dist/typescript/components/Call/CallControls/index.d.ts +1 -1
- package/dist/typescript/components/Call/CallControls/index.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts +4 -5
- package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts +5 -8
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts +5 -8
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts +3 -2
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts +6 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/LobbyFooter.d.ts +10 -0
- package/dist/typescript/components/Call/Lobby/LobbyFooter.d.ts.map +1 -0
- package/dist/typescript/components/Call/Lobby/index.d.ts +1 -0
- package/dist/typescript/components/Call/Lobby/index.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts +3 -3
- package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts +3 -2
- package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts +4 -4
- package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts.map +1 -1
- package/dist/typescript/constants/index.d.ts +2 -2
- package/dist/typescript/constants/index.d.ts.map +1 -1
- package/dist/typescript/translations/index.d.ts +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +1 -11
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Call/CallContent/CallContent.tsx +41 -25
- package/src/components/Call/CallControls/CallControls.tsx +9 -13
- package/src/components/Call/CallControls/{ReactionButton.tsx → ReactionsButton.tsx} +13 -6
- package/src/components/Call/CallControls/index.tsx +1 -1
- package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +14 -14
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +17 -16
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +7 -7
- package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +25 -20
- package/src/components/Call/Lobby/Lobby.tsx +16 -36
- package/src/components/Call/Lobby/LobbyFooter.tsx +75 -0
- package/src/components/Call/Lobby/index.ts +1 -0
- package/src/components/Participant/FloatingParticipantView/index.tsx +8 -2
- package/src/components/Participant/ParticipantView/ParticipantReaction.tsx +16 -29
- package/src/components/Participant/ParticipantView/ParticipantView.tsx +38 -32
- package/src/constants/index.ts +2 -2
- package/src/translations/en.json +1 -1
- package/src/utils/StreamVideoRN/index.ts +1 -2
- package/src/utils/StreamVideoRN/types.ts +1 -11
- package/src/version.ts +1 -1
- package/dist/commonjs/components/Call/CallControls/ReactionButton.js.map +0 -1
- package/dist/module/components/Call/CallControls/ReactionButton.js.map +0 -1
- package/dist/typescript/components/Call/CallControls/ReactionButton.d.ts +0 -15
- package/dist/typescript/components/Call/CallControls/ReactionButton.d.ts.map +0 -1
|
@@ -13,9 +13,10 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
CallControlProps,
|
|
15
15
|
CallControls as DefaultCallControls,
|
|
16
|
+
HangUpCallButtonProps,
|
|
16
17
|
} from '../CallControls';
|
|
17
18
|
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
18
|
-
import { CallingState } from '@stream-io/video-client';
|
|
19
|
+
import { CallingState, StreamReaction } from '@stream-io/video-client';
|
|
19
20
|
import { useIncallManager } from '../../../hooks';
|
|
20
21
|
import { Z_INDEX } from '../../../constants';
|
|
21
22
|
import { useDebouncedValue } from '../../../utils/hooks';
|
|
@@ -25,42 +26,53 @@ import {
|
|
|
25
26
|
ParticipantViewComponentProps,
|
|
26
27
|
} from '../../Participant';
|
|
27
28
|
import { useTheme } from '../../../contexts';
|
|
29
|
+
import {
|
|
30
|
+
CallParticipantsListComponentProps,
|
|
31
|
+
CallParticipantsListProps,
|
|
32
|
+
} from '../CallParticipantsList';
|
|
28
33
|
|
|
29
|
-
export type
|
|
30
|
-
|
|
31
|
-
| 'CallParticipantsList'
|
|
32
|
-
| 'ParticipantLabel'
|
|
33
|
-
| 'ParticipantNetworkQualityIndicator'
|
|
34
|
-
| 'ParticipantReaction'
|
|
35
|
-
| 'ParticipantVideoFallback'
|
|
36
|
-
| 'ParticipantView'
|
|
37
|
-
| 'VideoRenderer'
|
|
38
|
-
> & {
|
|
39
|
-
/**
|
|
40
|
-
* Component to customize the CallTopView component.
|
|
41
|
-
*/
|
|
42
|
-
CallTopView?: React.ComponentType<CallTopViewProps> | null;
|
|
43
|
-
/**
|
|
44
|
-
* Component to customize the CallControls component.
|
|
45
|
-
*/
|
|
46
|
-
CallControls?: React.ComponentType<CallControlProps> | null;
|
|
47
|
-
/**
|
|
48
|
-
* Component to customize the FloatingParticipantView.
|
|
49
|
-
*/
|
|
50
|
-
FloatingParticipantView?: React.ComponentType<FloatingParticipantViewProps> | null;
|
|
34
|
+
export type StreamReactionType = StreamReaction & {
|
|
35
|
+
icon: string;
|
|
51
36
|
};
|
|
52
37
|
|
|
53
|
-
|
|
38
|
+
type CallContentComponentProps = ParticipantViewComponentProps &
|
|
39
|
+
Pick<CallParticipantsListComponentProps, 'ParticipantView'> & {
|
|
40
|
+
/**
|
|
41
|
+
* Component to customize the CallTopView component.
|
|
42
|
+
*/
|
|
43
|
+
CallTopView?: React.ComponentType<CallTopViewProps> | null;
|
|
44
|
+
/**
|
|
45
|
+
* Component to customize the CallControls component.
|
|
46
|
+
*/
|
|
47
|
+
CallControls?: React.ComponentType<CallControlProps> | null;
|
|
48
|
+
/**
|
|
49
|
+
* Component to customize the FloatingParticipantView.
|
|
50
|
+
*/
|
|
51
|
+
FloatingParticipantView?: React.ComponentType<FloatingParticipantViewProps> | null;
|
|
52
|
+
/**
|
|
53
|
+
* Component to customize the CallParticipantsList.
|
|
54
|
+
*/
|
|
55
|
+
CallParticipantsList?: React.ComponentType<CallParticipantsListProps> | null;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type CallContentProps = Pick<
|
|
59
|
+
HangUpCallButtonProps,
|
|
60
|
+
'onHangupCallHandler'
|
|
61
|
+
> &
|
|
54
62
|
Pick<
|
|
55
63
|
CallTopViewProps,
|
|
56
64
|
'onBackPressed' | 'onParticipantInfoPress' | 'ParticipantsInfoBadge'
|
|
57
65
|
> &
|
|
58
|
-
|
|
66
|
+
CallContentComponentProps & {
|
|
59
67
|
/**
|
|
60
68
|
* This switches the participant's layout between the grid and the spotlight mode.
|
|
61
69
|
*/
|
|
62
70
|
layout?: 'grid' | 'spotlight';
|
|
63
71
|
/**
|
|
72
|
+
* Reactions that are to be supported in the call
|
|
73
|
+
*/
|
|
74
|
+
supportedReactions?: StreamReactionType[];
|
|
75
|
+
/*
|
|
64
76
|
* Check if device is in landscape mode.
|
|
65
77
|
* This will apply the landscape mode styles to the component.
|
|
66
78
|
*/
|
|
@@ -83,6 +95,7 @@ export const CallContent = ({
|
|
|
83
95
|
ParticipantsInfoBadge,
|
|
84
96
|
VideoRenderer,
|
|
85
97
|
layout = 'grid',
|
|
98
|
+
supportedReactions,
|
|
86
99
|
landscape = true,
|
|
87
100
|
}: CallContentProps) => {
|
|
88
101
|
const [
|
|
@@ -150,6 +163,7 @@ export const CallContent = ({
|
|
|
150
163
|
showLocalParticipant: isRemoteParticipantInFloatingView,
|
|
151
164
|
ParticipantView,
|
|
152
165
|
CallParticipantsList,
|
|
166
|
+
supportedReactions,
|
|
153
167
|
};
|
|
154
168
|
|
|
155
169
|
const callParticipantsSpotlightProps: CallParticipantsSpotlightProps = {
|
|
@@ -157,6 +171,7 @@ export const CallContent = ({
|
|
|
157
171
|
landscape,
|
|
158
172
|
ParticipantView,
|
|
159
173
|
CallParticipantsList,
|
|
174
|
+
supportedReactions,
|
|
160
175
|
};
|
|
161
176
|
|
|
162
177
|
const landScapeStyles: ViewStyle = {
|
|
@@ -187,6 +202,7 @@ export const CallContent = ({
|
|
|
187
202
|
: localParticipant
|
|
188
203
|
}
|
|
189
204
|
onPressHandler={handleFloatingViewParticipantSwitch}
|
|
205
|
+
supportedReactions={supportedReactions}
|
|
190
206
|
{...participantViewProps}
|
|
191
207
|
/>
|
|
192
208
|
)}
|
|
@@ -4,24 +4,20 @@ import { ToggleAudioPublishingButton } from './ToggleAudioPublishingButton';
|
|
|
4
4
|
import { ToggleVideoPublishingButton } from './ToggleVideoPublishingButton';
|
|
5
5
|
import { ToggleCameraFaceButton } from './ToggleCameraFaceButton';
|
|
6
6
|
import { Z_INDEX } from '../../../constants';
|
|
7
|
-
import { HangUpCallButton } from './HangupCallButton';
|
|
7
|
+
import { HangUpCallButton, HangUpCallButtonProps } from './HangupCallButton';
|
|
8
8
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Props for the CallControls Component.
|
|
12
12
|
*/
|
|
13
|
-
export type CallControlProps = Pick<ViewProps, 'style'> &
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* This will apply the landscape mode styles to the component.
|
|
22
|
-
*/
|
|
23
|
-
landscape?: boolean;
|
|
24
|
-
};
|
|
13
|
+
export type CallControlProps = Pick<ViewProps, 'style'> &
|
|
14
|
+
Pick<HangUpCallButtonProps, 'onHangupCallHandler'> & {
|
|
15
|
+
/**
|
|
16
|
+
* Check if device is in landscape mode.
|
|
17
|
+
* This will apply the landscape mode styles to the component.
|
|
18
|
+
*/
|
|
19
|
+
landscape?: boolean;
|
|
20
|
+
};
|
|
25
21
|
|
|
26
22
|
/**
|
|
27
23
|
* A list/row of controls (mute audio/video, toggle front/back camera, hangup call etc.)
|
|
@@ -5,14 +5,18 @@ import { OwnCapability } from '@stream-io/video-client';
|
|
|
5
5
|
import { ButtonTestIds } from '../../../constants/TestIds';
|
|
6
6
|
import { Reaction } from '../../../icons';
|
|
7
7
|
import { ReactionsPicker } from './internal/ReactionsPicker';
|
|
8
|
-
import { StreamVideoRN } from '../../../utils';
|
|
9
8
|
import { LayoutChangeEvent, LayoutRectangle } from 'react-native';
|
|
10
9
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
10
|
+
import { StreamReactionType } from '../CallContent';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Props for the Reaction button
|
|
14
14
|
*/
|
|
15
|
-
export type
|
|
15
|
+
export type ReactionsButtonProps = {
|
|
16
|
+
/**
|
|
17
|
+
* Supported Reactions to be sent while in the call.
|
|
18
|
+
*/
|
|
19
|
+
supportedReactions?: StreamReactionType[];
|
|
16
20
|
/**
|
|
17
21
|
* Handler to be called when the reaction button is pressed.
|
|
18
22
|
*/
|
|
@@ -23,7 +27,10 @@ export type ReactionButtonProps = {
|
|
|
23
27
|
* Button to display the list of Reactions supported in the call.
|
|
24
28
|
* On press, it opens a view that can be used to send Reaction.
|
|
25
29
|
*/
|
|
26
|
-
export const
|
|
30
|
+
export const ReactionsButton = ({
|
|
31
|
+
supportedReactions,
|
|
32
|
+
onPressHandler,
|
|
33
|
+
}: ReactionsButtonProps) => {
|
|
27
34
|
const [showReactionsPicker, setShowReactionsPicker] =
|
|
28
35
|
useState<boolean>(false);
|
|
29
36
|
const [reactionsButtonLayoutRectangle, setReactionsButtonLayoutRectangle] =
|
|
@@ -48,7 +55,7 @@ export const ReactionButton = ({ onPressHandler }: ReactionButtonProps) => {
|
|
|
48
55
|
});
|
|
49
56
|
};
|
|
50
57
|
|
|
51
|
-
const
|
|
58
|
+
const reactionsButtonHandler = () => {
|
|
52
59
|
if (onPressHandler) {
|
|
53
60
|
onPressHandler();
|
|
54
61
|
return;
|
|
@@ -61,7 +68,7 @@ export const ReactionButton = ({ onPressHandler }: ReactionButtonProps) => {
|
|
|
61
68
|
<Restricted requiredGrants={[OwnCapability.CREATE_REACTION]}>
|
|
62
69
|
<CallControlsButton
|
|
63
70
|
testID={ButtonTestIds.REACTION}
|
|
64
|
-
onPress={
|
|
71
|
+
onPress={reactionsButtonHandler}
|
|
65
72
|
onLayout={onReactionsButtonLayout}
|
|
66
73
|
>
|
|
67
74
|
<Reaction color={colors.static_black} />
|
|
@@ -69,7 +76,7 @@ export const ReactionButton = ({ onPressHandler }: ReactionButtonProps) => {
|
|
|
69
76
|
</Restricted>
|
|
70
77
|
{showReactionsPicker && (
|
|
71
78
|
<ReactionsPicker
|
|
72
|
-
|
|
79
|
+
supportedReactions={supportedReactions}
|
|
73
80
|
reactionsButtonLayoutRectangle={reactionsButtonLayoutRectangle}
|
|
74
81
|
onRequestedClose={() => {
|
|
75
82
|
setShowReactionsPicker(false);
|
|
@@ -7,7 +7,7 @@ export * from './ToggleAudioPublishingButton';
|
|
|
7
7
|
export * from './ToggleVideoPublishingButton';
|
|
8
8
|
export * from './ToggleCameraFaceButton';
|
|
9
9
|
export * from './ChatButton';
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './ReactionsButton';
|
|
11
11
|
export * from './CallControls';
|
|
12
12
|
export * from './LobbyControls';
|
|
13
13
|
export * from './IncomingCallControls';
|
|
@@ -6,26 +6,26 @@ import {
|
|
|
6
6
|
Animated,
|
|
7
7
|
Easing,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import { StreamVideoConfig } from '../../../../utils/StreamVideoRN/types';
|
|
10
9
|
import { useCall } from '@stream-io/video-react-bindings';
|
|
11
10
|
import { SendReactionRequest } from '@stream-io/video-client';
|
|
12
11
|
import { ComponentTestIds } from '../../../../constants/TestIds';
|
|
13
12
|
import { useTheme } from '../../../../contexts/ThemeContext';
|
|
13
|
+
import { ReactionsButtonProps } from '../ReactionsButton';
|
|
14
|
+
import { defaultEmojiReactions } from '../../../../constants';
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
reactions: StreamVideoConfig['supportedReactions'];
|
|
16
|
+
type ReactionPickerProps = Pick<ReactionsButtonProps, 'supportedReactions'> & {
|
|
17
17
|
reactionsButtonLayoutRectangle?: LayoutRectangle;
|
|
18
18
|
onRequestedClose: () => void;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
21
|
const TOP_PADDING = 4;
|
|
22
22
|
const REACTION_MARGIN_BOTTOM = 4;
|
|
23
23
|
|
|
24
24
|
export const ReactionsPicker = ({
|
|
25
|
-
|
|
25
|
+
supportedReactions = defaultEmojiReactions,
|
|
26
26
|
reactionsButtonLayoutRectangle,
|
|
27
27
|
onRequestedClose,
|
|
28
|
-
}:
|
|
28
|
+
}: ReactionPickerProps) => {
|
|
29
29
|
const {
|
|
30
30
|
theme: { colors, reactionsPicker },
|
|
31
31
|
} = useTheme();
|
|
@@ -37,9 +37,9 @@ export const ReactionsPicker = ({
|
|
|
37
37
|
// the top padding
|
|
38
38
|
TOP_PADDING +
|
|
39
39
|
// take margins into account
|
|
40
|
-
REACTION_MARGIN_BOTTOM *
|
|
40
|
+
REACTION_MARGIN_BOTTOM * supportedReactions.length +
|
|
41
41
|
// the size of the reaction icon items (same size as reactions button * amount of reactions)
|
|
42
|
-
reactionItemSize *
|
|
42
|
+
reactionItemSize * supportedReactions.length;
|
|
43
43
|
|
|
44
44
|
const reactionsPopupStyle = {
|
|
45
45
|
// we should show the popup right above the reactions button and not top of it
|
|
@@ -112,9 +112,9 @@ export const ReactionsPicker = ({
|
|
|
112
112
|
}}
|
|
113
113
|
>
|
|
114
114
|
{/* all the reactions */}
|
|
115
|
-
{
|
|
115
|
+
{supportedReactions.map((supportedReaction) => (
|
|
116
116
|
<Pressable
|
|
117
|
-
key={
|
|
117
|
+
key={supportedReaction.emoji_code}
|
|
118
118
|
style={[
|
|
119
119
|
styles.reactionItem,
|
|
120
120
|
reactionItemStyle,
|
|
@@ -126,9 +126,9 @@ export const ReactionsPicker = ({
|
|
|
126
126
|
]}
|
|
127
127
|
onPress={() => {
|
|
128
128
|
onClose({
|
|
129
|
-
type:
|
|
130
|
-
custom:
|
|
131
|
-
emoji_code:
|
|
129
|
+
type: supportedReaction.type,
|
|
130
|
+
custom: supportedReaction.custom,
|
|
131
|
+
emoji_code: supportedReaction.emoji_code,
|
|
132
132
|
});
|
|
133
133
|
}}
|
|
134
134
|
>
|
|
@@ -148,7 +148,7 @@ export const ReactionsPicker = ({
|
|
|
148
148
|
reactionsPicker.reactionText,
|
|
149
149
|
]}
|
|
150
150
|
>
|
|
151
|
-
{
|
|
151
|
+
{supportedReaction.icon}
|
|
152
152
|
</Animated.Text>
|
|
153
153
|
</Pressable>
|
|
154
154
|
))}
|
|
@@ -4,30 +4,29 @@ import { useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
|
4
4
|
import { useDebouncedValue } from '../../../utils/hooks/useDebouncedValue';
|
|
5
5
|
import {
|
|
6
6
|
CallParticipantsList as DefaultCallParticipantsList,
|
|
7
|
-
CallParticipantsListProps,
|
|
8
7
|
CallParticipantsListComponentProps,
|
|
9
8
|
} from '../CallParticipantsList/CallParticipantsList';
|
|
10
9
|
import { ComponentTestIds } from '../../../constants/TestIds';
|
|
11
10
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
11
|
+
import { CallContentProps } from '../CallContent';
|
|
12
|
+
import { ParticipantViewComponentProps } from '../../Participant';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Props for the CallParticipantsGrid component.
|
|
15
16
|
*/
|
|
16
|
-
export type CallParticipantsGridProps =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
landscape?: boolean;
|
|
30
|
-
};
|
|
17
|
+
export type CallParticipantsGridProps = ParticipantViewComponentProps &
|
|
18
|
+
Pick<CallContentProps, 'supportedReactions' | 'CallParticipantsList'> &
|
|
19
|
+
Pick<CallParticipantsListComponentProps, 'ParticipantView'> & {
|
|
20
|
+
/**
|
|
21
|
+
* Boolean to decide if local participant will be visible in the grid when there is 1:1 call.
|
|
22
|
+
*/
|
|
23
|
+
showLocalParticipant?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Check if device is in landscape mode.
|
|
26
|
+
* This will apply the landscape mode styles to the component.
|
|
27
|
+
*/
|
|
28
|
+
landscape?: boolean;
|
|
29
|
+
};
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* Component used to display the list of participants in a grid mode.
|
|
@@ -41,6 +40,7 @@ export const CallParticipantsGrid = ({
|
|
|
41
40
|
ParticipantView,
|
|
42
41
|
VideoRenderer,
|
|
43
42
|
showLocalParticipant = false,
|
|
43
|
+
supportedReactions,
|
|
44
44
|
landscape,
|
|
45
45
|
}: CallParticipantsGridProps) => {
|
|
46
46
|
const {
|
|
@@ -89,6 +89,7 @@ export const CallParticipantsGrid = ({
|
|
|
89
89
|
{CallParticipantsList && (
|
|
90
90
|
<CallParticipantsList
|
|
91
91
|
participants={participants}
|
|
92
|
+
supportedReactions={supportedReactions}
|
|
92
93
|
landscape={landscape}
|
|
93
94
|
{...participantViewProps}
|
|
94
95
|
/>
|
|
@@ -11,23 +11,20 @@ import { ComponentTestIds } from '../../../constants/TestIds';
|
|
|
11
11
|
import {
|
|
12
12
|
CallParticipantsList as DefaultCallParticipantsList,
|
|
13
13
|
CallParticipantsListComponentProps,
|
|
14
|
-
CallParticipantsListProps,
|
|
15
14
|
} from '../CallParticipantsList/CallParticipantsList';
|
|
16
15
|
import {
|
|
17
16
|
ParticipantView as DefaultParticipantView,
|
|
18
17
|
ParticipantViewComponentProps,
|
|
19
18
|
} from '../../Participant';
|
|
20
19
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
20
|
+
import { CallContentProps } from '../CallContent';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Props for the CallParticipantsSpotlight component.
|
|
24
24
|
*/
|
|
25
|
-
export type CallParticipantsSpotlightProps =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* Component to customize the CallParticipantsList.
|
|
29
|
-
*/
|
|
30
|
-
CallParticipantsList?: React.ComponentType<CallParticipantsListProps> | null;
|
|
25
|
+
export type CallParticipantsSpotlightProps = ParticipantViewComponentProps &
|
|
26
|
+
Pick<CallContentProps, 'supportedReactions' | 'CallParticipantsList'> &
|
|
27
|
+
Pick<CallParticipantsListComponentProps, 'ParticipantView'> & {
|
|
31
28
|
/**
|
|
32
29
|
* Check if device is in landscape mode.
|
|
33
30
|
* This will apply the landscape mode styles to the component.
|
|
@@ -50,6 +47,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
50
47
|
ParticipantVideoFallback,
|
|
51
48
|
ParticipantView = DefaultParticipantView,
|
|
52
49
|
VideoRenderer,
|
|
50
|
+
supportedReactions,
|
|
53
51
|
landscape,
|
|
54
52
|
}: CallParticipantsSpotlightProps) => {
|
|
55
53
|
const {
|
|
@@ -115,6 +113,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
115
113
|
trackType={
|
|
116
114
|
isScreenShareOnSpotlight ? 'screenShareTrack' : 'videoTrack'
|
|
117
115
|
}
|
|
116
|
+
supportedReactions={supportedReactions}
|
|
118
117
|
{...participantViewProps}
|
|
119
118
|
/>
|
|
120
119
|
)}
|
|
@@ -130,6 +129,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
130
129
|
participants={
|
|
131
130
|
isScreenShareOnSpotlight ? allParticipants : otherParticipants
|
|
132
131
|
}
|
|
132
|
+
supportedReactions={supportedReactions}
|
|
133
133
|
horizontal={!landscape}
|
|
134
134
|
numberOfColumns={!landscape ? 2 : 1}
|
|
135
135
|
landscape={landscape}
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
ParticipantViewComponentProps,
|
|
22
22
|
ParticipantViewProps,
|
|
23
23
|
} from '../../Participant/ParticipantView';
|
|
24
|
+
import { CallContentProps } from '../CallContent';
|
|
24
25
|
|
|
25
26
|
type FlatListProps = React.ComponentProps<
|
|
26
27
|
typeof FlatList<StreamVideoParticipant | StreamVideoLocalParticipant>
|
|
@@ -42,26 +43,27 @@ export type CallParticipantsListComponentProps =
|
|
|
42
43
|
/**
|
|
43
44
|
* Props of the CallParticipantsList component
|
|
44
45
|
*/
|
|
45
|
-
export type CallParticipantsListProps = CallParticipantsListComponentProps &
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
export type CallParticipantsListProps = CallParticipantsListComponentProps &
|
|
47
|
+
Pick<CallContentProps, 'supportedReactions'> & {
|
|
48
|
+
/**
|
|
49
|
+
* The list of participants to display in the list
|
|
50
|
+
*/
|
|
51
|
+
participants: (StreamVideoParticipant | StreamVideoLocalParticipant)[];
|
|
52
|
+
/**
|
|
53
|
+
* The number of columns to display in the list of participants while in vertical or horizontal scrolling mode. This property is only used when there are more than 2 participants.
|
|
54
|
+
* @default 2
|
|
55
|
+
*/
|
|
56
|
+
numberOfColumns?: number;
|
|
57
|
+
/**
|
|
58
|
+
* If true, the list will be displayed in horizontal scrolling mode
|
|
59
|
+
*/
|
|
60
|
+
horizontal?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Check if phone is in landscape mode.
|
|
63
|
+
* This will apply the landscape mode styles to the component.
|
|
64
|
+
*/
|
|
65
|
+
landscape?: boolean;
|
|
66
|
+
};
|
|
65
67
|
|
|
66
68
|
/**
|
|
67
69
|
* This component displays a list of participants in a FlatList.
|
|
@@ -79,6 +81,7 @@ export const CallParticipantsList = ({
|
|
|
79
81
|
ParticipantReaction,
|
|
80
82
|
ParticipantVideoFallback,
|
|
81
83
|
VideoRenderer,
|
|
84
|
+
supportedReactions,
|
|
82
85
|
landscape,
|
|
83
86
|
}: CallParticipantsListProps) => {
|
|
84
87
|
const [containerLayout, setContainerLayout] = useState({
|
|
@@ -195,6 +198,7 @@ export const CallParticipantsList = ({
|
|
|
195
198
|
style={itemContainerStyle}
|
|
196
199
|
trackType="videoTrack"
|
|
197
200
|
isVisible={isVisible}
|
|
201
|
+
supportedReactions={supportedReactions}
|
|
198
202
|
{...participantProps}
|
|
199
203
|
/>
|
|
200
204
|
)}
|
|
@@ -220,6 +224,7 @@ export const CallParticipantsList = ({
|
|
|
220
224
|
style={styles.flexed}
|
|
221
225
|
trackType="videoTrack"
|
|
222
226
|
key={keyExtractor(participant, index)}
|
|
227
|
+
supportedReactions={supportedReactions}
|
|
223
228
|
{...participantProps}
|
|
224
229
|
/>
|
|
225
230
|
)
|
|
@@ -19,6 +19,10 @@ import {
|
|
|
19
19
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
20
20
|
import { useCallMediaStreamCleanup } from '../../../hooks/internal/useCallMediaStreamCleanup';
|
|
21
21
|
import type { MediaStream } from '@stream-io/react-native-webrtc';
|
|
22
|
+
import {
|
|
23
|
+
LobbyFooter as DefaultLobbyFooter,
|
|
24
|
+
LobbyFooterProps,
|
|
25
|
+
} from './LobbyFooter';
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
* Props for the Lobby Component.
|
|
@@ -36,6 +40,10 @@ export type LobbyProps = {
|
|
|
36
40
|
* Component to customize the Join Call Button in the Lobby component.
|
|
37
41
|
*/
|
|
38
42
|
JoinCallButton?: ComponentType<JoinCallButtonProps> | null;
|
|
43
|
+
/**
|
|
44
|
+
* Component to customize the Lobby Footer in the Lobby component.
|
|
45
|
+
*/
|
|
46
|
+
LobbyFooter?: ComponentType<LobbyFooterProps> | null;
|
|
39
47
|
};
|
|
40
48
|
|
|
41
49
|
/**
|
|
@@ -45,20 +53,19 @@ export const Lobby = ({
|
|
|
45
53
|
onJoinCallHandler,
|
|
46
54
|
LobbyControls = DefaultLobbyControls,
|
|
47
55
|
JoinCallButton = DefaultJoinCallButton,
|
|
56
|
+
LobbyFooter = DefaultLobbyFooter,
|
|
48
57
|
}: LobbyProps) => {
|
|
49
58
|
const {
|
|
50
59
|
theme: { colors, lobby, typefaces },
|
|
51
60
|
} = useTheme();
|
|
52
61
|
const connectedUser = useConnectedUser();
|
|
53
|
-
const { useCameraState
|
|
62
|
+
const { useCameraState } = useCallStateHooks();
|
|
54
63
|
const { status: cameraStatus } = useCameraState();
|
|
55
64
|
const call = useCall();
|
|
56
|
-
const session = useCallSession();
|
|
57
65
|
const { t } = useI18n();
|
|
58
66
|
const localVideoStream = call?.camera.state.mediaStream as unknown as
|
|
59
67
|
| MediaStream
|
|
60
68
|
| undefined;
|
|
61
|
-
const participantsCount = session?.participants.length;
|
|
62
69
|
|
|
63
70
|
useCallMediaStreamCleanup();
|
|
64
71
|
|
|
@@ -122,35 +129,12 @@ export const Lobby = ({
|
|
|
122
129
|
{LobbyControls && <LobbyControls />}
|
|
123
130
|
</>
|
|
124
131
|
)}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
>
|
|
132
|
-
<Text
|
|
133
|
-
style={[
|
|
134
|
-
{ color: colors.static_white },
|
|
135
|
-
typefaces.subtitleBold,
|
|
136
|
-
lobby.infoText,
|
|
137
|
-
]}
|
|
138
|
-
>
|
|
139
|
-
{t('You are about to join a call with id {{ callId }}.', {
|
|
140
|
-
callId: call?.id,
|
|
141
|
-
}) +
|
|
142
|
-
' ' +
|
|
143
|
-
(participantsCount
|
|
144
|
-
? t(
|
|
145
|
-
'{{ numberOfParticipants }} participant(s) are in the call.',
|
|
146
|
-
{ numberOfParticipants: participantsCount },
|
|
147
|
-
)
|
|
148
|
-
: t('You are first to Join the call.'))}
|
|
149
|
-
</Text>
|
|
150
|
-
{JoinCallButton && (
|
|
151
|
-
<JoinCallButton onJoinCallHandler={onJoinCallHandler} />
|
|
152
|
-
)}
|
|
153
|
-
</View>
|
|
132
|
+
{LobbyFooter && (
|
|
133
|
+
<LobbyFooter
|
|
134
|
+
JoinCallButton={JoinCallButton}
|
|
135
|
+
onJoinCallHandler={onJoinCallHandler}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
154
138
|
</View>
|
|
155
139
|
);
|
|
156
140
|
};
|
|
@@ -229,10 +213,6 @@ const styles = StyleSheet.create({
|
|
|
229
213
|
padding: 8,
|
|
230
214
|
},
|
|
231
215
|
topView: {},
|
|
232
|
-
infoContainer: {
|
|
233
|
-
padding: 12,
|
|
234
|
-
borderRadius: 10,
|
|
235
|
-
},
|
|
236
216
|
participantStatusContainer: {
|
|
237
217
|
alignSelf: 'flex-start',
|
|
238
218
|
flexDirection: 'row',
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LobbyProps } from './Lobby';
|
|
3
|
+
import { View, StyleSheet, Text } from 'react-native';
|
|
4
|
+
import {
|
|
5
|
+
useCall,
|
|
6
|
+
useCallStateHooks,
|
|
7
|
+
useI18n,
|
|
8
|
+
} from '@stream-io/video-react-bindings';
|
|
9
|
+
import { useTheme } from '../../../contexts/ThemeContext';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for the Lobby Footer in the Lobby component.
|
|
13
|
+
*/
|
|
14
|
+
export type LobbyFooterProps = Pick<
|
|
15
|
+
LobbyProps,
|
|
16
|
+
'onJoinCallHandler' | 'JoinCallButton'
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The default Lobby Footer to be used in the Lobby component.
|
|
21
|
+
*/
|
|
22
|
+
export const LobbyFooter = ({
|
|
23
|
+
onJoinCallHandler,
|
|
24
|
+
JoinCallButton,
|
|
25
|
+
}: LobbyFooterProps) => {
|
|
26
|
+
const {
|
|
27
|
+
theme: { colors, lobby, typefaces },
|
|
28
|
+
} = useTheme();
|
|
29
|
+
const { useCallSession } = useCallStateHooks();
|
|
30
|
+
|
|
31
|
+
const { t } = useI18n();
|
|
32
|
+
|
|
33
|
+
const call = useCall();
|
|
34
|
+
const session = useCallSession();
|
|
35
|
+
|
|
36
|
+
const participantsCount = session?.participants.length;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<View
|
|
40
|
+
style={[
|
|
41
|
+
styles.infoContainer,
|
|
42
|
+
{ backgroundColor: colors.static_overlay },
|
|
43
|
+
lobby.infoContainer,
|
|
44
|
+
]}
|
|
45
|
+
>
|
|
46
|
+
<Text
|
|
47
|
+
style={[
|
|
48
|
+
{ color: colors.static_white },
|
|
49
|
+
typefaces.subtitleBold,
|
|
50
|
+
lobby.infoText,
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
{t('You are about to join a call with id {{ callId }}.', {
|
|
54
|
+
callId: call?.id,
|
|
55
|
+
}) +
|
|
56
|
+
' ' +
|
|
57
|
+
(participantsCount
|
|
58
|
+
? t('{{ numberOfParticipants }} participant(s) are in the call.', {
|
|
59
|
+
numberOfParticipants: participantsCount,
|
|
60
|
+
})
|
|
61
|
+
: t('You are first to join the call.'))}
|
|
62
|
+
</Text>
|
|
63
|
+
{JoinCallButton && (
|
|
64
|
+
<JoinCallButton onJoinCallHandler={onJoinCallHandler} />
|
|
65
|
+
)}
|
|
66
|
+
</View>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
infoContainer: {
|
|
72
|
+
padding: 12,
|
|
73
|
+
borderRadius: 10,
|
|
74
|
+
},
|
|
75
|
+
});
|