@stream-io/video-react-native-sdk 0.0.27 → 0.1.0

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 (118) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +19 -10
  3. package/dist/commonjs/components/Call/CallContent/CallContent.js +17 -6
  4. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  5. package/dist/commonjs/components/Call/CallControls/CallControls.js +8 -4
  6. package/dist/commonjs/components/Call/CallControls/CallControls.js.map +1 -1
  7. package/dist/commonjs/components/Call/CallControls/{ReactionButton.js → ReactionsButton.js} +8 -8
  8. package/dist/commonjs/components/Call/CallControls/ReactionsButton.js.map +1 -0
  9. package/dist/commonjs/components/Call/CallControls/index.js +4 -4
  10. package/dist/commonjs/components/Call/CallControls/index.js.map +1 -1
  11. package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js +10 -9
  12. package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
  13. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +10 -3
  14. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  15. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +19 -9
  16. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  17. package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +14 -4
  18. package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
  19. package/dist/commonjs/components/Call/CallTopView/CallTopView.js +5 -2
  20. package/dist/commonjs/components/Call/CallTopView/CallTopView.js.map +1 -1
  21. package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js +4 -2
  22. package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
  23. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js +6 -3
  24. package/dist/commonjs/components/Participant/FloatingParticipantView/index.js.map +1 -1
  25. package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js +4 -18
  26. package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
  27. package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js +6 -3
  28. package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
  29. package/dist/commonjs/constants/index.js.map +1 -1
  30. package/dist/commonjs/utils/StreamVideoRN/index.js +1 -2
  31. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  32. package/dist/commonjs/version.js +1 -1
  33. package/dist/commonjs/version.js.map +1 -1
  34. package/dist/module/components/Call/CallContent/CallContent.js +17 -6
  35. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  36. package/dist/module/components/Call/CallControls/CallControls.js +8 -4
  37. package/dist/module/components/Call/CallControls/CallControls.js.map +1 -1
  38. package/dist/module/components/Call/CallControls/{ReactionButton.js → ReactionsButton.js} +6 -6
  39. package/dist/module/components/Call/CallControls/ReactionsButton.js.map +1 -0
  40. package/dist/module/components/Call/CallControls/index.js +1 -1
  41. package/dist/module/components/Call/CallControls/index.js.map +1 -1
  42. package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js +10 -9
  43. package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
  44. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +10 -3
  45. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  46. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +19 -9
  47. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  48. package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +14 -4
  49. package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
  50. package/dist/module/components/Call/CallTopView/CallTopView.js +5 -2
  51. package/dist/module/components/Call/CallTopView/CallTopView.js.map +1 -1
  52. package/dist/module/components/Call/RingingCallContent/RingingCallContent.js +4 -2
  53. package/dist/module/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
  54. package/dist/module/components/Participant/FloatingParticipantView/index.js +6 -3
  55. package/dist/module/components/Participant/FloatingParticipantView/index.js.map +1 -1
  56. package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js +6 -20
  57. package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
  58. package/dist/module/components/Participant/ParticipantView/ParticipantView.js +6 -3
  59. package/dist/module/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
  60. package/dist/module/constants/index.js.map +1 -1
  61. package/dist/module/utils/StreamVideoRN/index.js +1 -2
  62. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  63. package/dist/module/version.js +1 -1
  64. package/dist/module/version.js.map +1 -1
  65. package/dist/typescript/components/Call/CallContent/CallContent.d.ts +20 -6
  66. package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
  67. package/dist/typescript/components/Call/CallControls/CallControls.d.ts +6 -5
  68. package/dist/typescript/components/Call/CallControls/CallControls.d.ts.map +1 -1
  69. package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts +20 -0
  70. package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts.map +1 -0
  71. package/dist/typescript/components/Call/CallControls/index.d.ts +1 -1
  72. package/dist/typescript/components/Call/CallControls/index.d.ts.map +1 -1
  73. package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts +4 -5
  74. package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts.map +1 -1
  75. package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts +10 -8
  76. package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
  77. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts +8 -6
  78. package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
  79. package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts +8 -2
  80. package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
  81. package/dist/typescript/components/Call/CallTopView/CallTopView.d.ts.map +1 -1
  82. package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts +5 -0
  83. package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
  84. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts +3 -3
  85. package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
  86. package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts +3 -2
  87. package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts.map +1 -1
  88. package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts +4 -4
  89. package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts.map +1 -1
  90. package/dist/typescript/constants/index.d.ts +2 -2
  91. package/dist/typescript/constants/index.d.ts.map +1 -1
  92. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  93. package/dist/typescript/utils/StreamVideoRN/types.d.ts +1 -11
  94. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  95. package/dist/typescript/version.d.ts +1 -1
  96. package/dist/typescript/version.d.ts.map +1 -1
  97. package/package.json +1 -1
  98. package/src/components/Call/CallContent/CallContent.tsx +59 -28
  99. package/src/components/Call/CallControls/CallControls.tsx +18 -12
  100. package/src/components/Call/CallControls/{ReactionButton.tsx → ReactionsButton.tsx} +13 -6
  101. package/src/components/Call/CallControls/index.tsx +1 -1
  102. package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +14 -14
  103. package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +24 -12
  104. package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +25 -9
  105. package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +33 -16
  106. package/src/components/Call/CallTopView/CallTopView.tsx +4 -2
  107. package/src/components/Call/RingingCallContent/RingingCallContent.tsx +11 -1
  108. package/src/components/Participant/FloatingParticipantView/index.tsx +9 -2
  109. package/src/components/Participant/ParticipantView/ParticipantReaction.tsx +16 -29
  110. package/src/components/Participant/ParticipantView/ParticipantView.tsx +40 -33
  111. package/src/constants/index.ts +2 -2
  112. package/src/utils/StreamVideoRN/index.ts +1 -2
  113. package/src/utils/StreamVideoRN/types.ts +1 -11
  114. package/src/version.ts +1 -1
  115. package/dist/commonjs/components/Call/CallControls/ReactionButton.js.map +0 -1
  116. package/dist/module/components/Call/CallControls/ReactionButton.js.map +0 -1
  117. package/dist/typescript/components/Call/CallControls/ReactionButton.d.ts +0 -15
  118. package/dist/typescript/components/Call/CallControls/ReactionButton.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC,oBAAoB,CAmBzE,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,EAmBrD,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/StreamVideoRN/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAqB5C,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,MAAM,CAA+B;IACpD;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAO1E;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAUvE,MAAM,CAAC,SAAS;CAGjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/StreamVideoRN/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAoB5C,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,MAAM,CAA+B;IAEpD;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAO1E;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAUvE,MAAM,CAAC,SAAS;CAGjB"}
@@ -1,15 +1,6 @@
1
- import { StreamReaction, StreamVideoClient } from '@stream-io/video-client';
1
+ import { StreamVideoClient } from '@stream-io/video-client';
2
2
  import { AndroidChannel } from '@notifee/react-native';
3
- type StreamReactionType = Required<StreamReaction> & {
4
- icon: string | JSX.Element;
5
- };
6
3
  export type StreamVideoConfig = {
7
- /**
8
- * Reactions that are to be supported in the app.
9
- *
10
- * Note: This is an array of reactions that is rendered in the Reaction list.
11
- */
12
- supportedReactions: StreamReactionType[];
13
4
  /**
14
5
  * The configuration to be used for push notifications.
15
6
  * If undefined, push notifications will not be enabled for the app
@@ -91,5 +82,4 @@ export type StreamVideoConfig = {
91
82
  };
92
83
  };
93
84
  };
94
- export {};
95
85
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/StreamVideoRN/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,KAAK,kBAAkB,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG;IACnD,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;IACzC;;;;OAIG;IACH,IAAI,CAAC,EAAE;QACL,GAAG,EAAE;YACH;;;eAGG;YACH,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,OAAO,EAAE;YACP;;;;;;;;eAQG;YACH,mBAAmB,EAAE,cAAc,CAAC;YACpC;;;;;;;eAOG;YACH,mCAAmC,EAAE;gBACnC,QAAQ,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;gBAC9C,OAAO,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;aAC9C,CAAC;YACF;;;eAGG;YACH,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF;;;;;;;;;;;;;;;;WAgBG;QACH,uBAAuB,EAAE,MAAM,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;QACtE,+EAA+E;QAC/E,kBAAkB,EAAE,MAAM,IAAI,CAAC;QAC/B,mIAAmI;QACnI,sBAAsB,EAAE,MAAM,IAAI,CAAC;KACpC,CAAC;IACF,iBAAiB,EAAE;QACjB,OAAO,EAAE;YACP;;eAEG;YACH,OAAO,EAAE,cAAc,CAAC;YACxB;;eAEG;YACH,iBAAiB,EAAE;gBACjB,KAAK,EAAE,MAAM,CAAC;gBACd,IAAI,EAAE,MAAM,CAAC;aACd,CAAC;SACH,CAAC;KACH,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/StreamVideoRN/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,IAAI,CAAC,EAAE;QACL,GAAG,EAAE;YACH;;;eAGG;YACH,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,OAAO,EAAE;YACP;;;;;;;;eAQG;YACH,mBAAmB,EAAE,cAAc,CAAC;YACpC;;;;;;;eAOG;YACH,mCAAmC,EAAE;gBACnC,QAAQ,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;gBAC9C,OAAO,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;aAC9C,CAAC;YACF;;;eAGG;YACH,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF;;;;;;;;;;;;;;;;WAgBG;QACH,uBAAuB,EAAE,MAAM,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;QACtE,+EAA+E;QAC/E,kBAAkB,EAAE,MAAM,IAAI,CAAC;QAC/B,mIAAmI;QACnI,sBAAsB,EAAE,MAAM,IAAI,CAAC;KACpC,CAAC;IACF,iBAAiB,EAAE;QACjB,OAAO,EAAE;YACP;;eAEG;YACH,OAAO,EAAE,cAAc,CAAC;YACxB;;eAEG;YACH,iBAAiB,EAAE;gBACjB,KAAK,EAAE,MAAM,CAAC;gBACd,IAAI,EAAE,MAAM,CAAC;aACd,CAAC;SACH,CAAC;KACH,CAAC;CACH,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "0.0.27";
1
+ export declare const version = "0.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "0.0.27",
3
+ "version": "0.1.0",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/module/index.js",
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { StyleSheet, View } from 'react-native';
2
+ import { StyleSheet, View, ViewStyle } from 'react-native';
3
3
  import {
4
4
  CallTopView as DefaultCallTopView,
5
5
  CallTopViewProps,
@@ -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,41 +26,57 @@ 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 CallParticipantsComponentProps = Pick<
30
- CallParticipantsGridProps,
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
- export type CallContentProps = Pick<CallControlProps, 'onHangupCallHandler'> &
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
- CallParticipantsComponentProps & {
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';
71
+ /**
72
+ * Reactions that are to be supported in the call
73
+ */
74
+ supportedReactions?: StreamReactionType[];
75
+ /*
76
+ * Check if device is in landscape mode.
77
+ * This will apply the landscape mode styles to the component.
78
+ */
79
+ landscape?: boolean;
63
80
  };
64
81
 
65
82
  export const CallContent = ({
@@ -78,6 +95,8 @@ export const CallContent = ({
78
95
  ParticipantsInfoBadge,
79
96
  VideoRenderer,
80
97
  layout = 'grid',
98
+ supportedReactions,
99
+ landscape = true,
81
100
  }: CallContentProps) => {
82
101
  const [
83
102
  showRemoteParticipantInFloatingView,
@@ -140,19 +159,27 @@ export const CallContent = ({
140
159
 
141
160
  const callParticipantsGridProps: CallParticipantsGridProps = {
142
161
  ...participantViewProps,
162
+ landscape,
143
163
  showLocalParticipant: isRemoteParticipantInFloatingView,
144
164
  ParticipantView,
145
165
  CallParticipantsList,
166
+ supportedReactions,
146
167
  };
147
168
 
148
169
  const callParticipantsSpotlightProps: CallParticipantsSpotlightProps = {
149
170
  ...participantViewProps,
171
+ landscape,
150
172
  ParticipantView,
151
173
  CallParticipantsList,
174
+ supportedReactions,
175
+ };
176
+
177
+ const landScapeStyles: ViewStyle = {
178
+ flexDirection: landscape ? 'row' : 'column',
152
179
  };
153
180
 
154
181
  return (
155
- <View style={[styles.container, callContent.container]}>
182
+ <View style={[styles.container, callContent.container, landScapeStyles]}>
156
183
  <View style={[styles.container, callContent.callParticipantsContainer]}>
157
184
  <View
158
185
  style={[styles.view, callContent.topContainer]}
@@ -175,6 +202,7 @@ export const CallContent = ({
175
202
  : localParticipant
176
203
  }
177
204
  onPressHandler={handleFloatingViewParticipantSwitch}
205
+ supportedReactions={supportedReactions}
178
206
  {...participantViewProps}
179
207
  />
180
208
  )}
@@ -187,7 +215,10 @@ export const CallContent = ({
187
215
  </View>
188
216
 
189
217
  {CallControls && (
190
- <CallControls onHangupCallHandler={onHangupCallHandler} />
218
+ <CallControls
219
+ onHangupCallHandler={onHangupCallHandler}
220
+ landscape={landscape}
221
+ />
191
222
  )}
192
223
  </View>
193
224
  );
@@ -1,22 +1,23 @@
1
1
  import React from 'react';
2
- import { StyleSheet, View, ViewProps } from 'react-native';
2
+ import { StyleSheet, View, ViewProps, ViewStyle } from 'react-native';
3
3
  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
- * Handler to override the hang up handler when the hangup button is pressed.
16
- * @returns void
17
- */
18
- onHangupCallHandler?: () => void;
19
- };
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
+ };
20
21
 
21
22
  /**
22
23
  * A list/row of controls (mute audio/video, toggle front/back camera, hangup call etc.)
@@ -25,17 +26,24 @@ export type CallControlProps = Pick<ViewProps, 'style'> & {
25
26
  export const CallControls = ({
26
27
  style,
27
28
  onHangupCallHandler,
29
+ landscape,
28
30
  }: CallControlProps) => {
29
31
  const {
30
32
  theme: { colors, callControls },
31
33
  } = useTheme();
34
+ const landScapeStyles: ViewStyle = {
35
+ flexDirection: landscape ? 'column-reverse' : 'row',
36
+ paddingHorizontal: landscape ? 12 : 0,
37
+ paddingVertical: landscape ? 0 : 12,
38
+ };
32
39
  return (
33
40
  <View
34
41
  style={[
35
42
  styles.container,
36
43
  { backgroundColor: colors.static_grey },
37
- style,
38
44
  callControls.container,
45
+ landScapeStyles,
46
+ style,
39
47
  ]}
40
48
  >
41
49
  <ToggleVideoPublishingButton />
@@ -48,8 +56,6 @@ export const CallControls = ({
48
56
 
49
57
  const styles = StyleSheet.create({
50
58
  container: {
51
- paddingVertical: 12,
52
- flexDirection: 'row',
53
59
  justifyContent: 'space-evenly',
54
60
  zIndex: Z_INDEX.IN_FRONT,
55
61
  },
@@ -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 ReactionButtonProps = {
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 ReactionButton = ({ onPressHandler }: ReactionButtonProps) => {
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 reactionButtonHandler = () => {
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={reactionButtonHandler}
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
- reactions={StreamVideoRN.getConfig().supportedReactions}
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 './ReactionButton';
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
- interface Props {
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
- reactions,
25
+ supportedReactions = defaultEmojiReactions,
26
26
  reactionsButtonLayoutRectangle,
27
27
  onRequestedClose,
28
- }: Props) => {
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 * reactions.length +
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 * reactions.length;
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
- {reactions.map((reaction) => (
115
+ {supportedReactions.map((supportedReaction) => (
116
116
  <Pressable
117
- key={reaction.emoji_code}
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: reaction.type,
130
- custom: reaction.custom,
131
- emoji_code: reaction.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
- {reaction.icon}
151
+ {supportedReaction.icon}
152
152
  </Animated.Text>
153
153
  </Pressable>
154
154
  ))}
@@ -1,28 +1,32 @@
1
1
  import React from 'react';
2
- import { StyleSheet, View } from 'react-native';
2
+ import { StyleSheet, View, ViewStyle } from 'react-native';
3
3
  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 = CallParticipantsListComponentProps & {
17
- /**
18
- * Component to customize the CallParticipantsList.
19
- */
20
- CallParticipantsList?: React.ComponentType<CallParticipantsListProps> | null;
21
- /**
22
- * Boolean to decide if local participant will be visible in the grid when there is 1:1 call.
23
- */
24
- showLocalParticipant?: boolean;
25
- };
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
+ };
26
30
 
27
31
  /**
28
32
  * Component used to display the list of participants in a grid mode.
@@ -36,6 +40,8 @@ export const CallParticipantsGrid = ({
36
40
  ParticipantView,
37
41
  VideoRenderer,
38
42
  showLocalParticipant = false,
43
+ supportedReactions,
44
+ landscape,
39
45
  }: CallParticipantsGridProps) => {
40
46
  const {
41
47
  theme: { colors, callParticipantsGrid },
@@ -48,6 +54,9 @@ export const CallParticipantsGrid = ({
48
54
  // we debounce the participants arrays to avoid unnecessary rerenders that happen when participant tracks are all subscribed simultaneously
49
55
  const remoteParticipants = useDebouncedValue(_remoteParticipants, 300);
50
56
  const allParticipants = useDebouncedValue(_allParticipants, 300);
57
+ const landScapeStyles: ViewStyle = {
58
+ flexDirection: landscape ? 'row' : 'column',
59
+ };
51
60
 
52
61
  const showFloatingView =
53
62
  remoteParticipants.length > 0 && remoteParticipants.length < 3;
@@ -71,6 +80,7 @@ export const CallParticipantsGrid = ({
71
80
  <View
72
81
  style={[
73
82
  styles.container,
83
+ landScapeStyles,
74
84
  { backgroundColor: colors.dark_gray },
75
85
  callParticipantsGrid.container,
76
86
  ]}
@@ -79,6 +89,8 @@ export const CallParticipantsGrid = ({
79
89
  {CallParticipantsList && (
80
90
  <CallParticipantsList
81
91
  participants={participants}
92
+ supportedReactions={supportedReactions}
93
+ landscape={landscape}
82
94
  {...participantViewProps}
83
95
  />
84
96
  )}
@@ -5,29 +5,31 @@ import {
5
5
  StreamVideoParticipant,
6
6
  } from '@stream-io/video-client';
7
7
  import { useCallStateHooks } from '@stream-io/video-react-bindings';
8
- import { StyleSheet, View } from 'react-native';
8
+ import { StyleSheet, View, ViewStyle } from 'react-native';
9
9
  import { useDebouncedValue } from '../../../utils/hooks/useDebouncedValue';
10
10
  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
- CallParticipantsListComponentProps & {
25
+ export type CallParticipantsSpotlightProps = ParticipantViewComponentProps &
26
+ Pick<CallContentProps, 'supportedReactions' | 'CallParticipantsList'> &
27
+ Pick<CallParticipantsListComponentProps, 'ParticipantView'> & {
27
28
  /**
28
- * Component to customize the CallParticipantsList.
29
+ * Check if device is in landscape mode.
30
+ * This will apply the landscape mode styles to the component.
29
31
  */
30
- CallParticipantsList?: React.ComponentType<CallParticipantsListProps> | null;
32
+ landscape?: boolean;
31
33
  };
32
34
 
33
35
  const hasScreenShare = (p: StreamVideoParticipant) =>
@@ -45,6 +47,8 @@ export const CallParticipantsSpotlight = ({
45
47
  ParticipantVideoFallback,
46
48
  ParticipantView = DefaultParticipantView,
47
49
  VideoRenderer,
50
+ supportedReactions,
51
+ landscape,
48
52
  }: CallParticipantsSpotlightProps) => {
49
53
  const {
50
54
  theme: { colors, callParticipantsSpotlight },
@@ -71,11 +75,20 @@ export const CallParticipantsSpotlight = ({
71
75
  ParticipantView,
72
76
  };
73
77
 
78
+ const landScapeStyles: ViewStyle = {
79
+ flexDirection: landscape ? 'row' : 'column',
80
+ };
81
+
82
+ const spotlightContainerLandscapeStyles: ViewStyle = {
83
+ marginHorizontal: landscape ? 0 : 8,
84
+ };
85
+
74
86
  return (
75
87
  <View
76
88
  testID={ComponentTestIds.CALL_PARTICIPANTS_SPOTLIGHT}
77
89
  style={[
78
90
  styles.container,
91
+ landScapeStyles,
79
92
  {
80
93
  backgroundColor: colors.dark_gray,
81
94
  },
@@ -93,12 +106,14 @@ export const CallParticipantsSpotlight = ({
93
106
  ]
94
107
  : [
95
108
  styles.spotlightContainer,
109
+ spotlightContainerLandscapeStyles,
96
110
  callParticipantsSpotlight.spotlightContainer,
97
111
  ]
98
112
  }
99
113
  trackType={
100
114
  isScreenShareOnSpotlight ? 'screenShareTrack' : 'videoTrack'
101
115
  }
116
+ supportedReactions={supportedReactions}
102
117
  {...participantViewProps}
103
118
  />
104
119
  )}
@@ -114,7 +129,10 @@ export const CallParticipantsSpotlight = ({
114
129
  participants={
115
130
  isScreenShareOnSpotlight ? allParticipants : otherParticipants
116
131
  }
117
- horizontal
132
+ supportedReactions={supportedReactions}
133
+ horizontal={!landscape}
134
+ numberOfColumns={!landscape ? 2 : 1}
135
+ landscape={landscape}
118
136
  {...callParticipantsListProps}
119
137
  />
120
138
  )}
@@ -127,7 +145,6 @@ export const CallParticipantsSpotlight = ({
127
145
  const styles = StyleSheet.create({
128
146
  container: {
129
147
  flex: 1,
130
- paddingVertical: 8,
131
148
  },
132
149
  fullScreenSpotlightContainer: {
133
150
  flex: 1,
@@ -137,7 +154,6 @@ const styles = StyleSheet.create({
137
154
  overflow: 'hidden',
138
155
  borderRadius: 10,
139
156
  marginHorizontal: 8,
140
- marginBottom: 8,
141
157
  },
142
158
  callParticipantsListContainer: {
143
159
  flex: 1,