@stream-io/video-react-native-sdk 0.1.5 → 0.1.6
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 +16 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +2 -2
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/CallControls.js +2 -2
- package/dist/commonjs/components/Call/CallControls/CallControls.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +2 -2
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +2 -2
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +22 -6
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +23 -11
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +21 -8
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js +5 -3
- package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/UserInfo.js +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +11 -10
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/theme/theme.js +10 -4
- package/dist/commonjs/theme/theme.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +2 -2
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallControls/CallControls.js +2 -2
- package/dist/module/components/Call/CallControls/CallControls.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +2 -2
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +2 -2
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +22 -6
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js +23 -11
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +21 -8
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/RingingCallContent.js +5 -3
- package/dist/module/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/UserInfo.js +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +12 -11
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/module/constants/index.js +1 -1
- package/dist/module/theme/theme.js +10 -4
- package/dist/module/theme/theme.js.map +1 -1
- package/dist/module/version.js +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/RingingCallContent/IncomingCall.d.ts +15 -6
- package/dist/typescript/components/Call/RingingCallContent/IncomingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts +6 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.d.ts.map +1 -1
- package/dist/typescript/constants/index.d.ts +1 -1
- package/dist/typescript/theme/theme.d.ts +6 -0
- package/dist/typescript/theme/theme.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/common/addNewLinesToAppDelegate.d.ts +1 -0
- package/expo-config-plugin/dist/common/addNewLinesToAppDelegate.js +17 -0
- package/expo-config-plugin/dist/common/types.d.ts +8 -0
- package/expo-config-plugin/dist/common/types.js +2 -0
- package/package.json +5 -5
- package/src/components/Call/CallContent/CallContent.tsx +2 -2
- package/src/components/Call/CallControls/CallControls.tsx +2 -2
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +2 -2
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +2 -2
- package/src/components/Call/Lobby/Lobby.tsx +32 -11
- package/src/components/Call/RingingCallContent/IncomingCall.tsx +54 -32
- package/src/components/Call/RingingCallContent/OutgoingCall.tsx +40 -24
- package/src/components/Call/RingingCallContent/RingingCallContent.tsx +7 -3
- package/src/components/Call/RingingCallContent/UserInfo.tsx +1 -1
- package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx +43 -51
- package/src/constants/index.ts +1 -1
- package/src/theme/theme.ts +16 -4
- package/src/version.ts +1 -1
|
@@ -174,12 +174,12 @@ export const CallContent = ({
|
|
|
174
174
|
supportedReactions,
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
-
const
|
|
177
|
+
const landscapeStyles: ViewStyle = {
|
|
178
178
|
flexDirection: landscape ? 'row' : 'column',
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
return (
|
|
182
|
-
<View style={[styles.container, callContent.container,
|
|
182
|
+
<View style={[styles.container, callContent.container, landscapeStyles]}>
|
|
183
183
|
<View style={[styles.container, callContent.callParticipantsContainer]}>
|
|
184
184
|
<View
|
|
185
185
|
style={[styles.view, callContent.topContainer]}
|
|
@@ -31,7 +31,7 @@ export const CallControls = ({
|
|
|
31
31
|
const {
|
|
32
32
|
theme: { colors, callControls },
|
|
33
33
|
} = useTheme();
|
|
34
|
-
const
|
|
34
|
+
const landscapeStyles: ViewStyle = {
|
|
35
35
|
flexDirection: landscape ? 'column-reverse' : 'row',
|
|
36
36
|
paddingHorizontal: landscape ? 12 : 0,
|
|
37
37
|
paddingVertical: landscape ? 0 : 12,
|
|
@@ -42,7 +42,7 @@ export const CallControls = ({
|
|
|
42
42
|
styles.container,
|
|
43
43
|
{ backgroundColor: colors.static_grey },
|
|
44
44
|
callControls.container,
|
|
45
|
-
|
|
45
|
+
landscapeStyles,
|
|
46
46
|
style,
|
|
47
47
|
]}
|
|
48
48
|
>
|
|
@@ -54,7 +54,7 @@ export const CallParticipantsGrid = ({
|
|
|
54
54
|
// we debounce the participants arrays to avoid unnecessary rerenders that happen when participant tracks are all subscribed simultaneously
|
|
55
55
|
const remoteParticipants = useDebouncedValue(_remoteParticipants, 300);
|
|
56
56
|
const allParticipants = useDebouncedValue(_allParticipants, 300);
|
|
57
|
-
const
|
|
57
|
+
const landscapeStyles: ViewStyle = {
|
|
58
58
|
flexDirection: landscape ? 'row' : 'column',
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -80,7 +80,7 @@ export const CallParticipantsGrid = ({
|
|
|
80
80
|
<View
|
|
81
81
|
style={[
|
|
82
82
|
styles.container,
|
|
83
|
-
|
|
83
|
+
landscapeStyles,
|
|
84
84
|
{ backgroundColor: colors.dark_gray },
|
|
85
85
|
callParticipantsGrid.container,
|
|
86
86
|
]}
|
|
@@ -75,7 +75,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
75
75
|
ParticipantView,
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const landscapeStyles: ViewStyle = {
|
|
79
79
|
flexDirection: landscape ? 'row' : 'column',
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -88,7 +88,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
88
88
|
testID={ComponentTestIds.CALL_PARTICIPANTS_SPOTLIGHT}
|
|
89
89
|
style={[
|
|
90
90
|
styles.container,
|
|
91
|
-
|
|
91
|
+
landscapeStyles,
|
|
92
92
|
{
|
|
93
93
|
backgroundColor: colors.dark_gray,
|
|
94
94
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
3
|
import { MicOff } from '../../../icons';
|
|
4
4
|
import {
|
|
5
5
|
useCall,
|
|
@@ -40,6 +40,11 @@ export type LobbyProps = {
|
|
|
40
40
|
* Component to customize the Join Call Button in the Lobby component.
|
|
41
41
|
*/
|
|
42
42
|
JoinCallButton?: ComponentType<JoinCallButtonProps> | null;
|
|
43
|
+
/**
|
|
44
|
+
* Check if device is in landscape mode.
|
|
45
|
+
* This will apply the landscape mode styles to the component.
|
|
46
|
+
*/
|
|
47
|
+
landscape?: boolean;
|
|
43
48
|
/**
|
|
44
49
|
* Component to customize the Lobby Footer in the Lobby component.
|
|
45
50
|
*/
|
|
@@ -53,6 +58,7 @@ export const Lobby = ({
|
|
|
53
58
|
onJoinCallHandler,
|
|
54
59
|
LobbyControls = DefaultLobbyControls,
|
|
55
60
|
JoinCallButton = DefaultJoinCallButton,
|
|
61
|
+
landscape = false,
|
|
56
62
|
LobbyFooter = DefaultLobbyFooter,
|
|
57
63
|
}: LobbyProps) => {
|
|
58
64
|
const {
|
|
@@ -75,16 +81,21 @@ export const Lobby = ({
|
|
|
75
81
|
name: connectedUser?.name,
|
|
76
82
|
} as StreamVideoParticipant;
|
|
77
83
|
|
|
84
|
+
const landscapeStyles: ViewStyle = {
|
|
85
|
+
flexDirection: landscape ? 'row' : 'column',
|
|
86
|
+
};
|
|
87
|
+
|
|
78
88
|
return (
|
|
79
89
|
<View
|
|
80
90
|
style={[
|
|
81
91
|
styles.container,
|
|
92
|
+
landscapeStyles,
|
|
82
93
|
{ backgroundColor: colors.static_grey },
|
|
83
94
|
lobby.container,
|
|
84
95
|
]}
|
|
85
96
|
>
|
|
86
97
|
{connectedUser && (
|
|
87
|
-
|
|
98
|
+
<View style={[styles.topContainer, lobby.topContainer]}>
|
|
88
99
|
<Text
|
|
89
100
|
style={[
|
|
90
101
|
styles.heading,
|
|
@@ -126,15 +137,17 @@ export const Lobby = ({
|
|
|
126
137
|
)}
|
|
127
138
|
<ParticipantStatus />
|
|
128
139
|
</View>
|
|
129
|
-
|
|
130
|
-
</>
|
|
131
|
-
)}
|
|
132
|
-
{LobbyFooter && (
|
|
133
|
-
<LobbyFooter
|
|
134
|
-
JoinCallButton={JoinCallButton}
|
|
135
|
-
onJoinCallHandler={onJoinCallHandler}
|
|
136
|
-
/>
|
|
140
|
+
</View>
|
|
137
141
|
)}
|
|
142
|
+
<View style={[styles.bottomContainer, lobby.bottomContainer]}>
|
|
143
|
+
{LobbyControls && <LobbyControls />}
|
|
144
|
+
{LobbyFooter && (
|
|
145
|
+
<LobbyFooter
|
|
146
|
+
JoinCallButton={JoinCallButton}
|
|
147
|
+
onJoinCallHandler={onJoinCallHandler}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
</View>
|
|
138
151
|
</View>
|
|
139
152
|
);
|
|
140
153
|
};
|
|
@@ -195,13 +208,16 @@ const styles = StyleSheet.create({
|
|
|
195
208
|
container: {
|
|
196
209
|
flex: 1,
|
|
197
210
|
justifyContent: 'center',
|
|
211
|
+
},
|
|
212
|
+
topContainer: {
|
|
213
|
+
flex: 2,
|
|
214
|
+
justifyContent: 'space-evenly',
|
|
198
215
|
paddingHorizontal: 12,
|
|
199
216
|
},
|
|
200
217
|
heading: {
|
|
201
218
|
textAlign: 'center',
|
|
202
219
|
},
|
|
203
220
|
subHeading: {
|
|
204
|
-
marginBottom: 16,
|
|
205
221
|
textAlign: 'center',
|
|
206
222
|
},
|
|
207
223
|
videoContainer: {
|
|
@@ -213,6 +229,11 @@ const styles = StyleSheet.create({
|
|
|
213
229
|
padding: 8,
|
|
214
230
|
},
|
|
215
231
|
topView: {},
|
|
232
|
+
bottomContainer: {
|
|
233
|
+
flex: 1,
|
|
234
|
+
justifyContent: 'space-evenly',
|
|
235
|
+
paddingHorizontal: 12,
|
|
236
|
+
},
|
|
216
237
|
participantStatusContainer: {
|
|
217
238
|
alignSelf: 'flex-start',
|
|
218
239
|
flexDirection: 'row',
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ImageBackground,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import {
|
|
4
10
|
useCallStateHooks,
|
|
5
11
|
useConnectedUser,
|
|
@@ -28,6 +34,11 @@ export type IncomingCallProps = IncomingCallControlsProps & {
|
|
|
28
34
|
* Prop to customize the IncomingCall controls.
|
|
29
35
|
*/
|
|
30
36
|
IncomingCallControls?: React.ComponentType<IncomingCallControlsProps> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Check if device is in landscape mode.
|
|
39
|
+
* This will apply the landscape mode styles to the component.
|
|
40
|
+
*/
|
|
41
|
+
landscape?: boolean;
|
|
31
42
|
};
|
|
32
43
|
|
|
33
44
|
/**
|
|
@@ -39,45 +50,59 @@ export const IncomingCall = ({
|
|
|
39
50
|
onRejectCallHandler,
|
|
40
51
|
CallTopView = DefaultCallTopView,
|
|
41
52
|
IncomingCallControls = DefaultIncomingCallControls,
|
|
53
|
+
landscape,
|
|
42
54
|
}: IncomingCallProps) => {
|
|
43
55
|
const { t } = useI18n();
|
|
44
56
|
const {
|
|
45
57
|
theme: { colors, incomingCall, typefaces },
|
|
46
58
|
} = useTheme();
|
|
47
59
|
|
|
60
|
+
const landscapeContentStyles: ViewStyle = {
|
|
61
|
+
flexDirection: landscape ? 'row' : 'column',
|
|
62
|
+
};
|
|
63
|
+
|
|
48
64
|
return (
|
|
49
65
|
<Background>
|
|
50
66
|
{CallTopView && <CallTopView />}
|
|
51
|
-
<View style={[styles.content, incomingCall.content]}>
|
|
52
|
-
<UserInfo />
|
|
53
|
-
<Text
|
|
54
|
-
style={[
|
|
55
|
-
styles.incomingCallText,
|
|
56
|
-
{ color: colors.static_white },
|
|
57
|
-
typefaces.heading6,
|
|
58
|
-
incomingCall.incomingCallText,
|
|
59
|
-
]}
|
|
60
|
-
>
|
|
61
|
-
{t('Incoming Call...')}
|
|
62
|
-
</Text>
|
|
63
|
-
</View>
|
|
64
67
|
<View
|
|
65
|
-
style={[styles.
|
|
68
|
+
style={[styles.content, landscapeContentStyles, incomingCall.content]}
|
|
66
69
|
>
|
|
67
|
-
{
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
<View style={[styles.topContainer, incomingCall.topContainer]}>
|
|
71
|
+
<UserInfo />
|
|
72
|
+
<Text
|
|
73
|
+
style={[
|
|
74
|
+
styles.incomingCallText,
|
|
75
|
+
{ color: colors.static_white },
|
|
76
|
+
typefaces.heading6,
|
|
77
|
+
incomingCall.incomingCallText,
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
{t('Incoming Call...')}
|
|
81
|
+
</Text>
|
|
82
|
+
</View>
|
|
83
|
+
<View style={[styles.bottomContainer, incomingCall.bottomContainer]}>
|
|
84
|
+
<View
|
|
85
|
+
style={[
|
|
86
|
+
styles.incomingCallControls,
|
|
87
|
+
incomingCall.incomingCallControls,
|
|
88
|
+
]}
|
|
89
|
+
>
|
|
90
|
+
{IncomingCallControls && (
|
|
91
|
+
<IncomingCallControls
|
|
92
|
+
onAcceptCallHandler={onAcceptCallHandler}
|
|
93
|
+
onRejectCallHandler={onRejectCallHandler}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
73
98
|
</View>
|
|
74
99
|
</Background>
|
|
75
100
|
);
|
|
76
101
|
};
|
|
77
102
|
|
|
78
|
-
const Background: React.FunctionComponent<{
|
|
79
|
-
children
|
|
80
|
-
}) => {
|
|
103
|
+
const Background: React.FunctionComponent<{
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
}> = ({ children }) => {
|
|
81
106
|
const {
|
|
82
107
|
theme: { colors, incomingCall },
|
|
83
108
|
} = useTheme();
|
|
@@ -99,7 +124,6 @@ const Background: React.FunctionComponent<{ children: React.ReactNode }> = ({
|
|
|
99
124
|
uri: avatarsToShow[0],
|
|
100
125
|
}}
|
|
101
126
|
style={[
|
|
102
|
-
StyleSheet.absoluteFill,
|
|
103
127
|
styles.background,
|
|
104
128
|
{ backgroundColor: colors.static_grey },
|
|
105
129
|
incomingCall.background,
|
|
@@ -112,7 +136,6 @@ const Background: React.FunctionComponent<{ children: React.ReactNode }> = ({
|
|
|
112
136
|
return (
|
|
113
137
|
<View
|
|
114
138
|
style={[
|
|
115
|
-
StyleSheet.absoluteFill,
|
|
116
139
|
styles.background,
|
|
117
140
|
{ backgroundColor: colors.static_grey },
|
|
118
141
|
incomingCall.background,
|
|
@@ -128,16 +151,15 @@ export const styles = StyleSheet.create({
|
|
|
128
151
|
flex: 1,
|
|
129
152
|
},
|
|
130
153
|
content: {
|
|
131
|
-
|
|
154
|
+
flex: 1,
|
|
132
155
|
},
|
|
156
|
+
topContainer: { flex: 1 },
|
|
133
157
|
incomingCallText: {
|
|
134
|
-
marginTop:
|
|
158
|
+
marginTop: 8,
|
|
135
159
|
textAlign: 'center',
|
|
136
160
|
},
|
|
161
|
+
bottomContainer: { flex: 1, justifyContent: 'center' },
|
|
137
162
|
incomingCallControls: {
|
|
138
|
-
|
|
139
|
-
bottom: 64,
|
|
140
|
-
left: 0,
|
|
141
|
-
right: 0,
|
|
163
|
+
justifyContent: 'center',
|
|
142
164
|
},
|
|
143
165
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
3
|
import { UserInfo } from './UserInfo';
|
|
4
4
|
import { Z_INDEX } from '../../../constants';
|
|
5
5
|
import {
|
|
@@ -31,6 +31,11 @@ export type OutgoingCallProps = OutgoingCallControlsProps & {
|
|
|
31
31
|
* Prop to customize the OutgoingCall controls.
|
|
32
32
|
*/
|
|
33
33
|
OutgoingCallControls?: React.ComponentType<OutgoingCallControlsProps> | null;
|
|
34
|
+
/**
|
|
35
|
+
* Check if device is in landscape mode.
|
|
36
|
+
* This will apply the landscape mode styles to the component.
|
|
37
|
+
*/
|
|
38
|
+
landscape?: boolean;
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
/**
|
|
@@ -40,12 +45,17 @@ export type OutgoingCallProps = OutgoingCallControlsProps & {
|
|
|
40
45
|
export const OutgoingCall = ({
|
|
41
46
|
CallTopView = DefaultCallTopView,
|
|
42
47
|
OutgoingCallControls = DefaultOutgoingCallControls,
|
|
48
|
+
landscape,
|
|
43
49
|
}: OutgoingCallProps) => {
|
|
44
50
|
const {
|
|
45
51
|
theme: { colors, typefaces, outgoingCall },
|
|
46
52
|
} = useTheme();
|
|
47
53
|
const { t } = useI18n();
|
|
48
54
|
|
|
55
|
+
const landscapeContentStyles: ViewStyle = {
|
|
56
|
+
flexDirection: landscape ? 'row' : 'column',
|
|
57
|
+
};
|
|
58
|
+
|
|
49
59
|
return (
|
|
50
60
|
<>
|
|
51
61
|
<View
|
|
@@ -56,28 +66,35 @@ export const OutgoingCall = ({
|
|
|
56
66
|
]}
|
|
57
67
|
>
|
|
58
68
|
{CallTopView && <CallTopView />}
|
|
59
|
-
<View style={[styles.content, outgoingCall.content]}>
|
|
60
|
-
<UserInfo />
|
|
61
|
-
<Text
|
|
62
|
-
style={[
|
|
63
|
-
styles.callingText,
|
|
64
|
-
{ color: colors.static_white },
|
|
65
|
-
typefaces.heading6,
|
|
66
|
-
outgoingCall.callingText,
|
|
67
|
-
]}
|
|
68
|
-
>
|
|
69
|
-
{t('Calling...')}
|
|
70
|
-
</Text>
|
|
71
|
-
</View>
|
|
72
69
|
<View
|
|
73
|
-
style={[
|
|
74
|
-
styles.outgoingCallControls,
|
|
75
|
-
outgoingCall.outgoingCallControls,
|
|
76
|
-
]}
|
|
70
|
+
style={[styles.content, landscapeContentStyles, outgoingCall.content]}
|
|
77
71
|
>
|
|
78
|
-
{
|
|
72
|
+
<View style={[styles.topContainer, outgoingCall.topContainer]}>
|
|
73
|
+
<UserInfo />
|
|
74
|
+
<Text
|
|
75
|
+
style={[
|
|
76
|
+
styles.callingText,
|
|
77
|
+
{ color: colors.static_white },
|
|
78
|
+
typefaces.heading6,
|
|
79
|
+
outgoingCall.callingText,
|
|
80
|
+
]}
|
|
81
|
+
>
|
|
82
|
+
{t('Calling...')}
|
|
83
|
+
</Text>
|
|
84
|
+
</View>
|
|
85
|
+
<View style={[styles.bottomContainer, outgoingCall.bottomContainer]}>
|
|
86
|
+
<View
|
|
87
|
+
style={[
|
|
88
|
+
styles.outgoingCallControls,
|
|
89
|
+
outgoingCall.outgoingCallControls,
|
|
90
|
+
]}
|
|
91
|
+
>
|
|
92
|
+
{OutgoingCallControls && <OutgoingCallControls />}
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
79
95
|
</View>
|
|
80
96
|
</View>
|
|
97
|
+
|
|
81
98
|
<Background />
|
|
82
99
|
</>
|
|
83
100
|
);
|
|
@@ -133,17 +150,16 @@ const styles = StyleSheet.create({
|
|
|
133
150
|
container: {
|
|
134
151
|
zIndex: Z_INDEX.IN_MIDDLE,
|
|
135
152
|
},
|
|
153
|
+
topContainer: { flex: 1 },
|
|
136
154
|
content: {
|
|
137
|
-
|
|
155
|
+
flex: 1,
|
|
138
156
|
},
|
|
139
157
|
callingText: {
|
|
140
158
|
marginTop: 16,
|
|
141
159
|
textAlign: 'center',
|
|
142
160
|
},
|
|
161
|
+
bottomContainer: { flex: 1, alignSelf: 'center', justifyContent: 'center' },
|
|
143
162
|
outgoingCallControls: {
|
|
144
|
-
|
|
145
|
-
bottom: 64,
|
|
146
|
-
left: 0,
|
|
147
|
-
right: 0,
|
|
163
|
+
justifyContent: 'center',
|
|
148
164
|
},
|
|
149
165
|
});
|
|
@@ -55,7 +55,7 @@ const RingingCallPanel = ({
|
|
|
55
55
|
CallContent = DefaultCallContent,
|
|
56
56
|
JoiningCallIndicator = DefaultJoiningCallIndicator,
|
|
57
57
|
CallTopView,
|
|
58
|
-
landscape,
|
|
58
|
+
landscape = false,
|
|
59
59
|
}: RingingCallContentProps) => {
|
|
60
60
|
const call = useCall();
|
|
61
61
|
const isCallCreatedByMe = call?.isCreatedByMe;
|
|
@@ -66,8 +66,12 @@ const RingingCallPanel = ({
|
|
|
66
66
|
switch (callingState) {
|
|
67
67
|
case CallingState.RINGING:
|
|
68
68
|
return isCallCreatedByMe
|
|
69
|
-
? OutgoingCall &&
|
|
70
|
-
|
|
69
|
+
? OutgoingCall && (
|
|
70
|
+
<OutgoingCall CallTopView={CallTopView} landscape={landscape} />
|
|
71
|
+
)
|
|
72
|
+
: IncomingCall && (
|
|
73
|
+
<IncomingCall CallTopView={CallTopView} landscape={landscape} />
|
|
74
|
+
);
|
|
71
75
|
case CallingState.JOINED:
|
|
72
76
|
return (
|
|
73
77
|
CallContent && (
|
package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useEffect
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
2
|
import { LayoutRectangle, View } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
FloatingViewAlignment,
|
|
@@ -46,13 +46,8 @@ try {
|
|
|
46
46
|
children,
|
|
47
47
|
}: FloatingViewProps) => {
|
|
48
48
|
// to store the starting position of the gesture
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
y: number;
|
|
52
|
-
}>({
|
|
53
|
-
x: 0,
|
|
54
|
-
y: 0,
|
|
55
|
-
});
|
|
49
|
+
// NOTE: note be used for deriving styling
|
|
50
|
+
const start = useSharedValue({ x: 0, y: 0 });
|
|
56
51
|
// to store the necessary translate x, y position
|
|
57
52
|
const translationX = useSharedValue(0);
|
|
58
53
|
const translationY = useSharedValue(0);
|
|
@@ -82,55 +77,51 @@ try {
|
|
|
82
77
|
});
|
|
83
78
|
}, [rectangle, containerWidth, containerHeight]);
|
|
84
79
|
|
|
85
|
-
const dragGesture =
|
|
86
|
-
() =>
|
|
87
|
-
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
translationX.value
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
translationY.value
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
translationX.value = withTiming(closestAlignment.x);
|
|
123
|
-
translationY.value = withTiming(closestAlignment.y);
|
|
124
|
-
}),
|
|
125
|
-
[snapAlignments, translationX, translationY],
|
|
126
|
-
);
|
|
80
|
+
const dragGesture = Gesture.Pan()
|
|
81
|
+
.onStart((_e) => {
|
|
82
|
+
start.value = {
|
|
83
|
+
x: translationX.value,
|
|
84
|
+
y: translationY.value,
|
|
85
|
+
};
|
|
86
|
+
})
|
|
87
|
+
.onUpdate((e) => {
|
|
88
|
+
// update the translation with the distance of the gesture + starting position
|
|
89
|
+
translationX.value = Math.max(
|
|
90
|
+
0,
|
|
91
|
+
Math.min(
|
|
92
|
+
e.translationX + (start.value.x ?? 0),
|
|
93
|
+
snapAlignments[FloatingViewAlignment.bottomRight].x,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
translationY.value = Math.max(
|
|
97
|
+
0,
|
|
98
|
+
Math.min(
|
|
99
|
+
e.translationY + (start.value.y ?? 0),
|
|
100
|
+
snapAlignments[FloatingViewAlignment.bottomRight].y,
|
|
101
|
+
),
|
|
102
|
+
);
|
|
103
|
+
})
|
|
104
|
+
.onEnd(() => {
|
|
105
|
+
// snap to the closest alignment with a spring animation
|
|
106
|
+
const position = {
|
|
107
|
+
x: translationX.value,
|
|
108
|
+
y: translationY.value,
|
|
109
|
+
};
|
|
110
|
+
const closestAlignment = getClosestSnapAlignment({
|
|
111
|
+
position,
|
|
112
|
+
snapAlignments,
|
|
113
|
+
});
|
|
114
|
+
translationX.value = withTiming(closestAlignment.x);
|
|
115
|
+
translationY.value = withTiming(closestAlignment.y);
|
|
116
|
+
});
|
|
127
117
|
|
|
118
|
+
/* Move to the initial position */
|
|
128
119
|
useEffect(() => {
|
|
129
120
|
if (!rectangle) {
|
|
130
121
|
return;
|
|
131
122
|
}
|
|
132
123
|
const alignment = snapAlignments[initialAlignment];
|
|
133
|
-
|
|
124
|
+
start.value = alignment;
|
|
134
125
|
|
|
135
126
|
translationX.value = alignment.x;
|
|
136
127
|
translationY.value = alignment.y;
|
|
@@ -145,6 +136,7 @@ try {
|
|
|
145
136
|
opacity,
|
|
146
137
|
translationX,
|
|
147
138
|
translationY,
|
|
139
|
+
start,
|
|
148
140
|
]);
|
|
149
141
|
|
|
150
142
|
const animatedStyle = useAnimatedStyle(() => {
|
package/src/constants/index.ts
CHANGED
package/src/theme/theme.ts
CHANGED
|
@@ -101,9 +101,11 @@ export type Theme = {
|
|
|
101
101
|
};
|
|
102
102
|
lobby: {
|
|
103
103
|
container: ViewStyle;
|
|
104
|
+
topContainer: ViewStyle;
|
|
104
105
|
heading: TextStyle;
|
|
105
106
|
subHeading: TextStyle;
|
|
106
107
|
videoContainer: ViewStyle;
|
|
108
|
+
bottomContainer: ViewStyle;
|
|
107
109
|
infoContainer: ViewStyle;
|
|
108
110
|
infoText: TextStyle;
|
|
109
111
|
participantStatusContainer: ViewStyle;
|
|
@@ -148,8 +150,10 @@ export type Theme = {
|
|
|
148
150
|
incomingCall: {
|
|
149
151
|
background: ViewStyle;
|
|
150
152
|
content: ViewStyle;
|
|
153
|
+
topContainer: ViewStyle;
|
|
151
154
|
incomingCallText: TextStyle;
|
|
152
155
|
incomingCallControls: ViewStyle;
|
|
156
|
+
bottomContainer: ViewStyle;
|
|
153
157
|
buttonGroup: ViewStyle;
|
|
154
158
|
};
|
|
155
159
|
joiningCallIndicator: {
|
|
@@ -159,8 +163,10 @@ export type Theme = {
|
|
|
159
163
|
container: ViewStyle;
|
|
160
164
|
background: ViewStyle;
|
|
161
165
|
content: ViewStyle;
|
|
166
|
+
topContainer: ViewStyle;
|
|
162
167
|
callingText: TextStyle;
|
|
163
168
|
outgoingCallControls: ViewStyle;
|
|
169
|
+
bottomContainer: ViewStyle;
|
|
164
170
|
buttonGroup: ViewStyle;
|
|
165
171
|
deviceControlButtons: ViewStyle;
|
|
166
172
|
};
|
|
@@ -213,10 +219,10 @@ export const defaultTheme: Theme = {
|
|
|
213
219
|
},
|
|
214
220
|
avatarSizes: {
|
|
215
221
|
xs: 50,
|
|
216
|
-
sm:
|
|
217
|
-
md:
|
|
218
|
-
lg:
|
|
219
|
-
xl:
|
|
222
|
+
sm: 90,
|
|
223
|
+
md: 100,
|
|
224
|
+
lg: 160,
|
|
225
|
+
xl: 180,
|
|
220
226
|
},
|
|
221
227
|
},
|
|
222
228
|
typefaces: {
|
|
@@ -318,8 +324,10 @@ export const defaultTheme: Theme = {
|
|
|
318
324
|
},
|
|
319
325
|
lobby: {
|
|
320
326
|
container: {},
|
|
327
|
+
topContainer: {},
|
|
321
328
|
heading: {},
|
|
322
329
|
subHeading: {},
|
|
330
|
+
bottomContainer: {},
|
|
323
331
|
videoContainer: {},
|
|
324
332
|
infoContainer: {},
|
|
325
333
|
infoText: {},
|
|
@@ -373,16 +381,20 @@ export const defaultTheme: Theme = {
|
|
|
373
381
|
incomingCall: {
|
|
374
382
|
background: {},
|
|
375
383
|
content: {},
|
|
384
|
+
topContainer: {},
|
|
376
385
|
incomingCallText: {},
|
|
377
386
|
incomingCallControls: {},
|
|
387
|
+
bottomContainer: {},
|
|
378
388
|
buttonGroup: {},
|
|
379
389
|
},
|
|
380
390
|
outgoingCall: {
|
|
381
391
|
container: {},
|
|
382
392
|
background: {},
|
|
383
393
|
content: {},
|
|
394
|
+
topContainer: {},
|
|
384
395
|
callingText: {},
|
|
385
396
|
outgoingCallControls: {},
|
|
397
|
+
bottomContainer: {},
|
|
386
398
|
buttonGroup: {},
|
|
387
399
|
deviceControlButtons: {},
|
|
388
400
|
},
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.6';
|