@stream-io/video-react-native-sdk 0.0.1-alpha.360 → 0.0.1-alpha.362
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 +19 -0
- package/dist/__tests__/components/CallControls.test.js +1 -1
- package/dist/__tests__/components/CallControls.test.js.map +1 -1
- package/dist/src/components/call/CallControls.js +26 -7
- package/dist/src/components/call/CallControls.js.map +1 -1
- package/dist/src/components/call/ReactionsPicker.d.ts +9 -0
- package/dist/src/components/call/ReactionsPicker.js +150 -0
- package/dist/src/components/call/ReactionsPicker.js.map +1 -0
- package/dist/src/components/utility/index.d.ts +0 -1
- package/dist/src/components/utility/index.js +0 -1
- package/dist/src/components/utility/index.js.map +1 -1
- package/dist/src/components/utility/internal/CallControlsButton.d.ts +6 -1
- package/dist/src/components/utility/internal/CallControlsButton.js +6 -2
- package/dist/src/components/utility/internal/CallControlsButton.js.map +1 -1
- package/dist/src/components/utility/internal/ToggleCameraFaceButton.js +2 -2
- package/dist/src/components/utility/internal/ToggleCameraFaceButton.js.map +1 -1
- package/dist/src/constants/TestIds.d.ts +1 -1
- package/dist/src/constants/TestIds.js +1 -1
- package/dist/src/constants/TestIds.js.map +1 -1
- package/dist/src/constants/index.d.ts +2 -6
- package/dist/src/constants/index.js.map +1 -1
- package/dist/src/utils/StreamVideoRN/types.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/components/call/CallControls.tsx +46 -12
- package/src/components/call/ReactionsPicker.tsx +165 -0
- package/src/components/utility/index.ts +0 -1
- package/src/components/utility/internal/CallControlsButton.tsx +26 -2
- package/src/components/utility/internal/ToggleCameraFaceButton.tsx +2 -1
- package/src/constants/TestIds.ts +1 -1
- package/src/constants/index.ts +2 -1
- package/src/utils/StreamVideoRN/types.ts +1 -1
- package/dist/src/components/utility/ReactionsModal.d.ts +0 -10
- package/dist/src/components/utility/ReactionsModal.js +0 -89
- package/dist/src/components/utility/ReactionsModal.js.map +0 -1
- package/src/components/utility/ReactionsModal.tsx +0 -91
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.1-alpha.362](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.361...@stream-io/video-react-native-sdk-0.0.1-alpha.362) (2023-08-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **react-native:** avoid usage of image showcase in push notification docs ([b820b94](https://github.com/GetStream/stream-video-js/commit/b820b946131e5cd4f897daf5f2f18fadcd980697))
|
|
11
|
+
* **react-native:** disable camera toggle face button when local video is muted ([#903](https://github.com/GetStream/stream-video-js/issues/903)) ([58150bc](https://github.com/GetStream/stream-video-js/commit/58150bc8d15e6e62654e1f0bc14dc207d51ed1f9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [0.0.1-alpha.361](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.360...@stream-io/video-react-native-sdk-0.0.1-alpha.361) (2023-08-09)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **react-native:** add basic reactions popup ([#913](https://github.com/GetStream/stream-video-js/issues/913)) ([3969000](https://github.com/GetStream/stream-video-js/commit/3969000025faabf8c923c1648bc19475d31e0cfb))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
5
24
|
## [0.0.1-alpha.360](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.359...@stream-io/video-react-native-sdk-0.0.1-alpha.360) (2023-08-08)
|
|
6
25
|
|
|
7
26
|
|
|
@@ -58,7 +58,7 @@ describe('CallControls', () => {
|
|
|
58
58
|
});
|
|
59
59
|
const button = await RNTLTools_1.screen.findByTestId(TestIds_1.ButtonTestIds.REACTION);
|
|
60
60
|
RNTLTools_1.fireEvent.press(button);
|
|
61
|
-
expect(RNTLTools_1.screen.getByTestId(TestIds_1.ComponentTestIds.
|
|
61
|
+
expect(RNTLTools_1.screen.getByTestId(TestIds_1.ComponentTestIds.REACTIONS_PICKER)).toBeVisible();
|
|
62
62
|
});
|
|
63
63
|
it('execute onPressHandler when its passed to hangup call button when its pressed in call controls component', async () => {
|
|
64
64
|
const call = (0, call_1.mockCall)((0, client_1.mockClientWithUser)(), [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallControls.test.js","sourceRoot":"","sources":["../../../__tests__/components/CallControls.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,4CAAqD;AACrD,uEAAmD;AACnD,yDAA8E;AAC9E,wCAAyC;AACzC,kDAAwE;AACxE,qDAAoD;AACpD,0DAAwD;AAExD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACzB,IAAI,CAAC,aAAa,EAAE,CAAC;AAErB,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,4BAAmB,CAAA;AACrB,CAAC,EAFI,KAAK,KAAL,KAAK,QAET;AAED,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,0FAA0F,EAAE,KAAK,IAAI,EAAE;QACxG,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAA,2BAAkB,GAAE,EAAE;YAC1C,IAAA,qBAAe,EAAC;gBACd,kBAAkB,EAAE,IAAI;gBACxB,SAAS,EAAE,KAAK,CAAC,OAAO;gBACxB,MAAM,EAAE,KAAK,CAAC,OAAO;aACtB,CAAC;SACH,CAAC,CAAC;QAEH,IAAA,kBAAM,EACJ,CAAC,yBAAY,CACX,UAAU,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,yBAAyB,EAAE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EAAG,EAAE;YACvB,IAAI;SACL,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,kBAAM,CAAC,YAAY,CAAC,uBAAa,CAAC,QAAQ,CAAC,CAAC;QAEjE,qBAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAExB,MAAM,CAAC,kBAAM,CAAC,WAAW,CAAC,0BAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"CallControls.test.js","sourceRoot":"","sources":["../../../__tests__/components/CallControls.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,4CAAqD;AACrD,uEAAmD;AACnD,yDAA8E;AAC9E,wCAAyC;AACzC,kDAAwE;AACxE,qDAAoD;AACpD,0DAAwD;AAExD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACzB,IAAI,CAAC,aAAa,EAAE,CAAC;AAErB,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,4BAAmB,CAAA;AACrB,CAAC,EAFI,KAAK,KAAL,KAAK,QAET;AAED,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,0FAA0F,EAAE,KAAK,IAAI,EAAE;QACxG,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAA,2BAAkB,GAAE,EAAE;YAC1C,IAAA,qBAAe,EAAC;gBACd,kBAAkB,EAAE,IAAI;gBACxB,SAAS,EAAE,KAAK,CAAC,OAAO;gBACxB,MAAM,EAAE,KAAK,CAAC,OAAO;aACtB,CAAC;SACH,CAAC,CAAC;QAEH,IAAA,kBAAM,EACJ,CAAC,yBAAY,CACX,UAAU,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC,EACxE,EACF;YACE,IAAI;SACL,CACF,CAAC;QAEF,MAAM,SAAS,GAAG,MAAM,kBAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAE/C,MAAM,C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AAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,kBAAM,CAAC,YAAY,CAAC,uBAAa,CAAC,YAAY,CAAC,CAAC;QAErE,qBAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAExB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -31,29 +31,43 @@ const CallControlsButton_1 = require("../utility/internal/CallControlsButton");
|
|
|
31
31
|
const theme_1 = require("../../theme");
|
|
32
32
|
const video_client_1 = require("@stream-io/video-client");
|
|
33
33
|
const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
34
|
-
const ReactionsModal_1 = require("../utility/ReactionsModal");
|
|
35
34
|
const ToggleAudioButton_1 = require("../utility/internal/ToggleAudioButton");
|
|
36
35
|
const ToggleVideoButton_1 = require("../utility/internal/ToggleVideoButton");
|
|
37
36
|
const TestIds_1 = require("../../constants/TestIds");
|
|
38
37
|
const constants_1 = require("../../constants");
|
|
39
38
|
const ToggleCameraFaceButton_1 = require("../utility/internal/ToggleCameraFaceButton");
|
|
40
39
|
const HangupCallButton_1 = require("../utility/internal/HangupCallButton");
|
|
40
|
+
const ReactionsPicker_1 = require("./ReactionsPicker");
|
|
41
|
+
const utils_1 = require("../../utils");
|
|
41
42
|
/**
|
|
42
43
|
* A list/row of controls (mute audio/video, toggle front/back camera, hangup call etc.)
|
|
43
44
|
* the user can trigger within an active call.
|
|
44
45
|
*/
|
|
45
46
|
const CallControls = ({ chatButton, hangUpCallButton, style, }) => {
|
|
46
|
-
const [
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const [showReactionsPicker, setShowReactionsPicker] = (0, react_1.useState)(false);
|
|
48
|
+
const [reactionsButtonLayoutRectangle, setReactionsButtonLayoutRectangle] = (0, react_1.useState)();
|
|
49
|
+
// This is for the reaction popup
|
|
50
|
+
const onReactionsButtonLayout = (event) => {
|
|
51
|
+
const layout = event.nativeEvent.layout;
|
|
52
|
+
setReactionsButtonLayoutRectangle((prev) => {
|
|
53
|
+
if (prev &&
|
|
54
|
+
prev.width === layout.width &&
|
|
55
|
+
prev.height === layout.height &&
|
|
56
|
+
prev.x === layout.x &&
|
|
57
|
+
prev.y === layout.y) {
|
|
58
|
+
return prev;
|
|
59
|
+
}
|
|
60
|
+
return layout;
|
|
61
|
+
});
|
|
62
|
+
};
|
|
50
63
|
return (<react_native_1.View style={[styles.container, style]}>
|
|
51
64
|
<video_react_bindings_1.Restricted requiredGrants={[video_client_1.OwnCapability.CREATE_REACTION]}>
|
|
52
|
-
<CallControlsButton_1.CallControlsButton testID={TestIds_1.ButtonTestIds.REACTION} onPress={
|
|
65
|
+
<CallControlsButton_1.CallControlsButton testID={TestIds_1.ButtonTestIds.REACTION} onPress={() => {
|
|
66
|
+
setShowReactionsPicker(true);
|
|
67
|
+
}} color={theme_1.theme.light.static_white} style={styles.button} onLayout={onReactionsButtonLayout}>
|
|
53
68
|
<icons_1.Reaction color={theme_1.theme.light.static_black}/>
|
|
54
69
|
</CallControlsButton_1.CallControlsButton>
|
|
55
70
|
</video_react_bindings_1.Restricted>
|
|
56
|
-
<ReactionsModal_1.ReactionModal isReactionModalActive={isReactionModalActive} setIsReactionModalActive={setIsReactionModalActive}/>
|
|
57
71
|
{chatButton && (<react_native_1.View>
|
|
58
72
|
<CallControlsButton_1.CallControlsButton color={theme_1.theme.light.static_white} onPress={chatButton.onPressHandler} svgContainerStyle={styles.svgContainerStyle} style={styles.button}>
|
|
59
73
|
<UnreadBadgeCountIndicator count={chatButton.unreadBadgeCountIndicator}/>
|
|
@@ -64,6 +78,10 @@ const CallControls = ({ chatButton, hangUpCallButton, style, }) => {
|
|
|
64
78
|
<ToggleAudioButton_1.ToggleAudioButton />
|
|
65
79
|
<ToggleCameraFaceButton_1.ToggleCameraFaceButton />
|
|
66
80
|
<HangupCallButton_1.HangUpCallButton onPressHandler={hangUpCallButton?.onPressHandler}/>
|
|
81
|
+
|
|
82
|
+
{showReactionsPicker && (<ReactionsPicker_1.ReactionsPicker reactions={utils_1.StreamVideoRN.getConfig().supportedReactions} reactionsButtonLayoutRectangle={reactionsButtonLayoutRectangle} onRequestedClose={() => {
|
|
83
|
+
setShowReactionsPicker(false);
|
|
84
|
+
}}/>)}
|
|
67
85
|
</react_native_1.View>);
|
|
68
86
|
};
|
|
69
87
|
exports.CallControls = CallControls;
|
|
@@ -82,6 +100,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
82
100
|
flexDirection: 'row',
|
|
83
101
|
justifyContent: 'space-between',
|
|
84
102
|
zIndex: constants_1.Z_INDEX.IN_FRONT,
|
|
103
|
+
backgroundColor: theme_1.theme.light.static_black,
|
|
85
104
|
},
|
|
86
105
|
button: {
|
|
87
106
|
// For iOS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallControls.js","sourceRoot":"","sources":["../../../../src/components/call/CallControls.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"CallControls.js","sourceRoot":"","sources":["../../../../src/components/call/CallControls.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,+CAOsB;AACtB,uCAA6C;AAC7C,+EAA4E;AAC5E,uCAAoC;AACpC,0DAAwD;AACxD,0EAA6D;AAC7D,6EAA0E;AAC1E,6EAA0E;AAC1E,qDAA0E;AAC1E,+CAA0C;AAC1C,uFAAoF;AACpF,2EAG8C;AAC9C,uDAAoD;AACpD,uCAA4C;AA+B5C;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,UAAU,EACV,gBAAgB,EAChB,KAAK,GACY,EAAE,EAAE;IACrB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GACjD,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAE3B,MAAM,CAAC,8BAA8B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
+
import { LayoutRectangle } from 'react-native';
|
|
2
|
+
import { StreamVideoConfig } from '../../utils/StreamVideoRN/types';
|
|
3
|
+
interface Props {
|
|
4
|
+
reactions: StreamVideoConfig['supportedReactions'];
|
|
5
|
+
reactionsButtonLayoutRectangle?: LayoutRectangle;
|
|
6
|
+
onRequestedClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ReactionsPicker: ({ reactions, reactionsButtonLayoutRectangle, onRequestedClose, }: Props) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ReactionsPicker = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
30
|
+
const theme_1 = require("../../theme");
|
|
31
|
+
const TestIds_1 = require("../../constants/TestIds");
|
|
32
|
+
const TOP_PADDING = 4;
|
|
33
|
+
const REACTION_MARGIN_BOTTOM = 4;
|
|
34
|
+
const ReactionsPicker = ({ reactions, reactionsButtonLayoutRectangle, onRequestedClose, }) => {
|
|
35
|
+
const call = (0, video_react_bindings_1.useCall)();
|
|
36
|
+
const size = reactionsButtonLayoutRectangle?.width ?? 0;
|
|
37
|
+
const reactionItemSize = size * 0.8;
|
|
38
|
+
const popupHeight =
|
|
39
|
+
// the top padding
|
|
40
|
+
TOP_PADDING +
|
|
41
|
+
// take margins into account
|
|
42
|
+
REACTION_MARGIN_BOTTOM * reactions.length +
|
|
43
|
+
// the size of the reaction icon items (same size as reactions button * amount of reactions)
|
|
44
|
+
reactionItemSize * reactions.length;
|
|
45
|
+
const reactionsPopupStyle = {
|
|
46
|
+
// we should show the popup right above the reactions button and not top of it
|
|
47
|
+
top: (reactionsButtonLayoutRectangle?.y ?? 0) - popupHeight,
|
|
48
|
+
// from the same side horizontal coordinate of the reactions button
|
|
49
|
+
left: reactionsButtonLayoutRectangle?.x,
|
|
50
|
+
// the width of the popup should be the same as the reactions button
|
|
51
|
+
width: size,
|
|
52
|
+
height: popupHeight,
|
|
53
|
+
// the popup should be rounded as the reactions button
|
|
54
|
+
borderTopStartRadius: size / 2,
|
|
55
|
+
borderTopEndRadius: size / 2,
|
|
56
|
+
};
|
|
57
|
+
const elasticAnimRef = (0, react_1.useRef)(new react_native_1.Animated.Value(0.5)); // Initial value for scale: 0.5
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
|
+
react_native_1.Animated.timing(elasticAnimRef.current, {
|
|
60
|
+
toValue: 1,
|
|
61
|
+
duration: 800,
|
|
62
|
+
useNativeDriver: true,
|
|
63
|
+
easing: react_native_1.Easing.elastic(3),
|
|
64
|
+
}).start();
|
|
65
|
+
}, []);
|
|
66
|
+
const reactionItemStyle = {
|
|
67
|
+
height: reactionItemSize,
|
|
68
|
+
width: reactionItemSize,
|
|
69
|
+
borderRadius: reactionItemSize / 2,
|
|
70
|
+
};
|
|
71
|
+
const reactionsButtonDimmerStyle = {
|
|
72
|
+
...styles.reactionsButtonDimmer,
|
|
73
|
+
height: size,
|
|
74
|
+
width: size,
|
|
75
|
+
// we should show the popup right on top of the reactions button
|
|
76
|
+
top: reactionsButtonLayoutRectangle?.y ?? 0 - popupHeight + size,
|
|
77
|
+
// from the same side horizontal coordinate of the reactions button
|
|
78
|
+
left: reactionsButtonLayoutRectangle?.x,
|
|
79
|
+
};
|
|
80
|
+
const onClose = (reaction) => {
|
|
81
|
+
if (reaction) {
|
|
82
|
+
call?.sendReaction(reaction).catch((e) => {
|
|
83
|
+
console.error(e, reaction);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
react_native_1.Animated.timing(elasticAnimRef.current, {
|
|
87
|
+
toValue: 0.2,
|
|
88
|
+
duration: 150,
|
|
89
|
+
useNativeDriver: true,
|
|
90
|
+
easing: react_native_1.Easing.linear,
|
|
91
|
+
}).start(onRequestedClose);
|
|
92
|
+
};
|
|
93
|
+
return (<>
|
|
94
|
+
<react_native_1.Pressable testID={TestIds_1.ComponentTestIds.REACTIONS_PICKER} style={[styles.reactionsPopup, reactionsPopupStyle]} onPress={() => {
|
|
95
|
+
onClose();
|
|
96
|
+
}}>
|
|
97
|
+
{/* all the reactions */}
|
|
98
|
+
{reactions.map((reaction) => (<react_native_1.Pressable key={reaction.emoji_code} style={[styles.reactionItem, reactionItemStyle]} onPress={() => {
|
|
99
|
+
onClose({
|
|
100
|
+
type: reaction.type,
|
|
101
|
+
custom: reaction.custom,
|
|
102
|
+
emoji_code: reaction.emoji_code,
|
|
103
|
+
});
|
|
104
|
+
}}>
|
|
105
|
+
<react_native_1.Animated.Text style={[
|
|
106
|
+
styles.reactionText,
|
|
107
|
+
{
|
|
108
|
+
transform: [
|
|
109
|
+
{
|
|
110
|
+
scaleY: elasticAnimRef.current,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
scaleX: elasticAnimRef.current,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
]}>
|
|
118
|
+
{reaction.icon}
|
|
119
|
+
</react_native_1.Animated.Text>
|
|
120
|
+
</react_native_1.Pressable>))}
|
|
121
|
+
</react_native_1.Pressable>
|
|
122
|
+
{/* a square view with 50% opacity that semi hides the reactions button */}
|
|
123
|
+
<react_native_1.Pressable style={reactionsButtonDimmerStyle} onPress={() => onClose()}/>
|
|
124
|
+
</>);
|
|
125
|
+
};
|
|
126
|
+
exports.ReactionsPicker = ReactionsPicker;
|
|
127
|
+
const styles = react_native_1.StyleSheet.create({
|
|
128
|
+
reactionsPopup: {
|
|
129
|
+
position: 'absolute',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
backgroundColor: theme_1.theme.light.static_black,
|
|
132
|
+
paddingTop: TOP_PADDING,
|
|
133
|
+
},
|
|
134
|
+
reactionsButtonDimmer: {
|
|
135
|
+
position: 'absolute',
|
|
136
|
+
backgroundColor: theme_1.theme.light.static_black,
|
|
137
|
+
opacity: 0.5,
|
|
138
|
+
},
|
|
139
|
+
reactionItem: {
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
justifyContent: 'center',
|
|
142
|
+
marginBottom: REACTION_MARGIN_BOTTOM,
|
|
143
|
+
// temporary background color until we have theming
|
|
144
|
+
backgroundColor: theme_1.theme.light.static_grey,
|
|
145
|
+
},
|
|
146
|
+
reactionText: {
|
|
147
|
+
fontSize: 18.5,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
//# sourceMappingURL=ReactionsPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactionsPicker.js","sourceRoot":"","sources":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aAAK,CAAC,KAAK,CAAC,YAAY;QACzC,UAAU,EAAE,WAAW;KACxB;IACD,qBAAqB,EAAE;QACrB,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,YAAY;QACzC,OAAO,EAAE,GAAG;KACb;IACD,YAAY,EAAE;QACZ,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,sBAAsB;QACpC,mDAAmD;QACnD,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,WAAW;KACzC;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,IAAI;KACf;CACF,CAAC,CAAC"}
|
|
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Avatar"), exports);
|
|
18
|
-
__exportStar(require("./ReactionsModal"), exports);
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/utility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/utility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { PressableProps, StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
interface CallControlsButtonProps {
|
|
4
4
|
/**
|
|
5
5
|
* `onPress` handler called when a single tap gesture is detected.
|
|
@@ -9,6 +9,10 @@ interface CallControlsButtonProps {
|
|
|
9
9
|
* The background color of the button rendered.
|
|
10
10
|
*/
|
|
11
11
|
color?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Boolean to enable/enable the button
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
12
16
|
/**
|
|
13
17
|
* Style to the Pressable button.
|
|
14
18
|
*/
|
|
@@ -21,6 +25,7 @@ interface CallControlsButtonProps {
|
|
|
21
25
|
* Accessibility label for the button.
|
|
22
26
|
*/
|
|
23
27
|
testID?: string;
|
|
28
|
+
onLayout?: View['props']['onLayout'];
|
|
24
29
|
}
|
|
25
30
|
export declare const CallControlsButton: (props: React.PropsWithChildren<CallControlsButtonProps>) => JSX.Element;
|
|
26
31
|
export {};
|
|
@@ -10,7 +10,7 @@ const theme_1 = require("../../../theme");
|
|
|
10
10
|
const DEFAULT_ICON_SIZE = theme_1.theme.icon.md;
|
|
11
11
|
const DEFAULT_BUTTON_SIZE = theme_1.theme.button.sm;
|
|
12
12
|
const CallControlsButton = (props) => {
|
|
13
|
-
const { onPress, children, color, style, svgContainerStyle, testID } = props;
|
|
13
|
+
const { onPress, children, disabled, color, style, svgContainerStyle, testID, onLayout, } = props;
|
|
14
14
|
const pressableStyle = ({ pressed }) => [
|
|
15
15
|
DEFAULT_BUTTON_SIZE,
|
|
16
16
|
styles.container,
|
|
@@ -19,8 +19,9 @@ const CallControlsButton = (props) => {
|
|
|
19
19
|
opacity: pressed ? 0.2 : 1,
|
|
20
20
|
},
|
|
21
21
|
style ? style : null,
|
|
22
|
+
disabled ? styles.disabledStyle : null,
|
|
22
23
|
];
|
|
23
|
-
return (<react_native_1.Pressable style={pressableStyle} onPress={onPress} testID={testID}>
|
|
24
|
+
return (<react_native_1.Pressable disabled={disabled} style={pressableStyle} onPress={onPress} testID={testID} onLayout={onLayout}>
|
|
24
25
|
<react_native_1.View style={[
|
|
25
26
|
styles.svgContainerStyle,
|
|
26
27
|
DEFAULT_ICON_SIZE,
|
|
@@ -39,5 +40,8 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
39
40
|
alignItems: 'center',
|
|
40
41
|
},
|
|
41
42
|
svgContainerStyle: {},
|
|
43
|
+
disabledStyle: {
|
|
44
|
+
backgroundColor: theme_1.theme.light.disabled,
|
|
45
|
+
},
|
|
42
46
|
});
|
|
43
47
|
//# sourceMappingURL=CallControlsButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallControlsButton.js","sourceRoot":"","sources":["../../../../../src/components/utility/internal/CallControlsButton.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAOsB;AACtB,0CAAuC;
|
|
1
|
+
{"version":3,"file":"CallControlsButton.js","sourceRoot":"","sources":["../../../../../src/components/utility/internal/CallControlsButton.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAOsB;AACtB,0CAAuC;AA8BvC,MAAM,iBAAiB,GAAG,aAAK,CAAC,IAAI,CAAC,EAAE,CAAC;AACxC,MAAM,mBAAmB,GAAG,aAAK,CAAC,MAAM,CAAC,EAAE,CAAC;AAErC,MAAM,kBAAkB,GAAG,CAChC,KAAuD,EACvD,EAAE;IACF,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,EACL,iBAAiB,EACjB,MAAM,EACN,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,MAAM,cAAc,GAA4B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAC/D,mBAAmB;QACnB,MAAM,CAAC,SAAS;QAChB;YACE,eAAe,EAAE,KAAK;YACtB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAC3B;QACD,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QACpB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI;KACvC,CAAC;IAEF,OAAO,CACL,CAAC,wBAAS,CACR,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,KAAK,CAAC,CAAC,cAAc,CAAC,CACtB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAEnB;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,iBAAiB;YACxB,iBAAiB;YACjB,iBAAiB,IAAI,IAAI;SAC1B,CAAC,CAEF;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,kBAAkB,sBA4C7B;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,aAAK,CAAC,KAAK,CAAC,UAAU;QACnC,UAAU,EAAE,QAAQ;KACrB;IACD,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE;QACb,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,QAAQ;KACtC;CACF,CAAC,CAAC"}
|
|
@@ -14,9 +14,9 @@ const icons_1 = require("../../../icons");
|
|
|
14
14
|
const theme_1 = require("../../../theme");
|
|
15
15
|
const react_native_1 = require("react-native");
|
|
16
16
|
const ToggleCameraFaceButton = () => {
|
|
17
|
-
const { isCameraOnFrontFacingMode, toggleCameraFacingMode } = (0, MediaStreamManagement_1.useMediaStreamManagement)();
|
|
17
|
+
const { isVideoMuted, isCameraOnFrontFacingMode, toggleCameraFacingMode } = (0, MediaStreamManagement_1.useMediaStreamManagement)();
|
|
18
18
|
return (<video_react_bindings_1.Restricted requiredGrants={[video_client_1.OwnCapability.SEND_VIDEO]}>
|
|
19
|
-
<CallControlsButton_1.CallControlsButton onPress={toggleCameraFacingMode} color={(0, utils_1.muteStatusColor)(!isCameraOnFrontFacingMode)} style={isCameraOnFrontFacingMode ? styles.button : null}>
|
|
19
|
+
<CallControlsButton_1.CallControlsButton disabled={isVideoMuted} onPress={toggleCameraFacingMode} color={(0, utils_1.muteStatusColor)(!isCameraOnFrontFacingMode)} style={isCameraOnFrontFacingMode ? styles.button : null}>
|
|
20
20
|
<icons_1.CameraSwitch color={isCameraOnFrontFacingMode
|
|
21
21
|
? theme_1.theme.light.static_black
|
|
22
22
|
: theme_1.theme.light.static_white}/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleCameraFaceButton.js","sourceRoot":"","sources":["../../../../../src/components/utility/internal/ToggleCameraFaceButton.tsx"],"names":[],"mappings":";;;;;;AAAA,0DAAwD;AACxD,0EAA6D;AAC7D,kDAA0B;AAC1B,6DAA0D;AAC1D,oFAAoF;AACpF,0CAAiD;AACjD,0CAA8C;AAC9C,0CAAuC;AACvC,+CAA0C;AAEnC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"ToggleCameraFaceButton.js","sourceRoot":"","sources":["../../../../../src/components/utility/internal/ToggleCameraFaceButton.tsx"],"names":[],"mappings":";;;;;;AAAA,0DAAwD;AACxD,0EAA6D;AAC7D,kDAA0B;AAC1B,6DAA0D;AAC1D,oFAAoF;AACpF,0CAAiD;AACjD,0CAA8C;AAC9C,0CAAuC;AACvC,+CAA0C;AAEnC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,EAAE,YAAY,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,GACvE,IAAA,gDAAwB,GAAE,CAAC;IAE7B,OAAO,CACL,CAAC,iCAAU,CAAC,cAAc,CAAC,CAAC,CAAC,4BAAa,CAAC,UAAU,CAAC,CAAC,CACrD;MAAA,CAAC,uCAAkB,CACjB,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAChC,KAAK,CAAC,CAAC,IAAA,uBAAe,EAAC,CAAC,yBAAyB,CAAC,CAAC,CACnD,KAAK,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAExD;QAAA,CAAC,oBAAY,CACX,KAAK,CAAC,CACJ,yBAAyB;YACvB,CAAC,CAAC,aAAK,CAAC,KAAK,CAAC,YAAY;YAC1B,CAAC,CAAC,aAAK,CAAC,KAAK,CAAC,YAAY,CAC7B,EAEL;MAAA,EAAE,uCAAkB,CACtB;IAAA,EAAE,iCAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,sBAAsB,0BAsBjC;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,UAAU;QACV,YAAY,EAAE;YACZ,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACV;QACD,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI;QAElB,cAAc;QACd,SAAS,EAAE,CAAC;KACb;CACF,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare enum ComponentTestIds {
|
|
|
13
13
|
PARTICIPANT_MEDIA_STREAM = "participant-media-stream",
|
|
14
14
|
PARTICIPANTS_INFO = "participants-info",
|
|
15
15
|
PARTICIPANT_SCREEN_SHARING = "participant-screen-sharing",
|
|
16
|
-
|
|
16
|
+
REACTIONS_PICKER = "reactions-picker",
|
|
17
17
|
CHAT_UNREAD_BADGE_COUNT_INDICATOR = "chat-unread-badge-count-indicator"
|
|
18
18
|
}
|
|
19
19
|
export declare enum ButtonTestIds {
|
|
@@ -18,7 +18,7 @@ var ComponentTestIds;
|
|
|
18
18
|
ComponentTestIds["PARTICIPANT_MEDIA_STREAM"] = "participant-media-stream";
|
|
19
19
|
ComponentTestIds["PARTICIPANTS_INFO"] = "participants-info";
|
|
20
20
|
ComponentTestIds["PARTICIPANT_SCREEN_SHARING"] = "participant-screen-sharing";
|
|
21
|
-
ComponentTestIds["
|
|
21
|
+
ComponentTestIds["REACTIONS_PICKER"] = "reactions-picker";
|
|
22
22
|
ComponentTestIds["CHAT_UNREAD_BADGE_COUNT_INDICATOR"] = "chat-unread-badge-count-indicator";
|
|
23
23
|
})(ComponentTestIds = exports.ComponentTestIds || (exports.ComponentTestIds = {}));
|
|
24
24
|
var ButtonTestIds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestIds.js","sourceRoot":"","sources":["../../../src/constants/TestIds.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,iDAAkC,CAAA;AACpC,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC1B,6DAAyC,CAAA;IACzC,qEAAiD,CAAA;IACjD,+EAA2D,CAAA;IAC3D,qEAAiD,CAAA;IACjD,2DAAuC,CAAA;IACvC,kFAA8D,CAAA;IAC9D,yEAAqD,CAAA;IACrD,2DAAuC,CAAA;IACvC,6EAAyD,CAAA;IACzD,
|
|
1
|
+
{"version":3,"file":"TestIds.js","sourceRoot":"","sources":["../../../src/constants/TestIds.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,iDAAkC,CAAA;AACpC,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IAC1B,6DAAyC,CAAA;IACzC,qEAAiD,CAAA;IACjD,+EAA2D,CAAA;IAC3D,qEAAiD,CAAA;IACjD,2DAAuC,CAAA;IACvC,kFAA8D,CAAA;IAC9D,yEAAqD,CAAA;IACrD,2DAAuC,CAAA;IACvC,6EAAyD,CAAA;IACzD,yDAAqC,CAAA;IACrC,2FAAuE,CAAA;AACzE,CAAC,EAZW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAY3B;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,+DAA8C,CAAA;IAC9C,kEAAiD,CAAA;IACjD,8CAA6B,CAAA;IAC7B,oDAAmC,CAAA;AACrC,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAED,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,oEAAoD,CAAA;AACtD,CAAC,EAFW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAEvB;AAED,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,uCAAuB,CAAA;AACzB,CAAC,EAFW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAEvB"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import { StreamVideoConfig } from '../utils/StreamVideoRN/types';
|
|
1
2
|
export declare const LOCAL_VIDEO_VIEW_STYLE: {
|
|
2
3
|
height: number;
|
|
3
4
|
width: number;
|
|
4
5
|
borderRadius: number;
|
|
5
6
|
};
|
|
6
|
-
export declare const defaultEmojiReactions:
|
|
7
|
-
type: string;
|
|
8
|
-
emoji_code: string;
|
|
9
|
-
custom: {};
|
|
10
|
-
icon: string;
|
|
11
|
-
}[];
|
|
7
|
+
export declare const defaultEmojiReactions: StreamVideoConfig['supportedReactions'];
|
|
12
8
|
export declare const Z_INDEX: {
|
|
13
9
|
IN_BACK: number;
|
|
14
10
|
IN_MIDDLE: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAGpB,QAAA,sBAAsB,GAAG;IACpC,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,EAAE;IACT,YAAY,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;CAC/B,CAAC;AAEW,QAAA,qBAAqB,GAA4C;IAC5E;QACE,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,IAAI;KACX;IACD;QACE,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,cAAc;QAC1B,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,GAAG;KACV;IACD;QACE,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,IAAI;KACX;CACF,CAAC;AAEW,QAAA,OAAO,GAAG;IACrB,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;CACZ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StreamReaction, StreamVideoClient } from '@stream-io/video-client';
|
|
2
2
|
import { AndroidChannel } from '@notifee/react-native';
|
|
3
|
-
type StreamReactionType = StreamReaction & {
|
|
3
|
+
type StreamReactionType = Required<StreamReaction> & {
|
|
4
4
|
icon: string | JSX.Element;
|
|
5
5
|
};
|
|
6
6
|
export type StreamVideoConfig = {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.1-alpha.
|
|
1
|
+
export declare const version = "0.0.1-alpha.362";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
LayoutChangeEvent,
|
|
4
|
+
LayoutRectangle,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
View,
|
|
8
|
+
ViewProps,
|
|
9
|
+
} from 'react-native';
|
|
3
10
|
import { Chat, Reaction } from '../../icons';
|
|
4
11
|
import { CallControlsButton } from '../utility/internal/CallControlsButton';
|
|
5
12
|
import { theme } from '../../theme';
|
|
6
13
|
import { OwnCapability } from '@stream-io/video-client';
|
|
7
14
|
import { Restricted } from '@stream-io/video-react-bindings';
|
|
8
|
-
import { ReactionModal } from '../utility/ReactionsModal';
|
|
9
15
|
import { ToggleAudioButton } from '../utility/internal/ToggleAudioButton';
|
|
10
16
|
import { ToggleVideoButton } from '../utility/internal/ToggleVideoButton';
|
|
11
17
|
import { ButtonTestIds, ComponentTestIds } from '../../constants/TestIds';
|
|
@@ -15,6 +21,8 @@ import {
|
|
|
15
21
|
HangUpCallButton,
|
|
16
22
|
HangUpCallButtonProps,
|
|
17
23
|
} from '../utility/internal/HangupCallButton';
|
|
24
|
+
import { ReactionsPicker } from './ReactionsPicker';
|
|
25
|
+
import { StreamVideoRN } from '../../utils';
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* The props for the Chat Button in the Call Controls.
|
|
@@ -54,29 +62,44 @@ export const CallControls = ({
|
|
|
54
62
|
hangUpCallButton,
|
|
55
63
|
style,
|
|
56
64
|
}: CallControlsType) => {
|
|
57
|
-
const [
|
|
65
|
+
const [showReactionsPicker, setShowReactionsPicker] =
|
|
58
66
|
useState<boolean>(false);
|
|
59
67
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
const [reactionsButtonLayoutRectangle, setReactionsButtonLayoutRectangle] =
|
|
69
|
+
useState<LayoutRectangle>();
|
|
70
|
+
|
|
71
|
+
// This is for the reaction popup
|
|
72
|
+
const onReactionsButtonLayout = (event: LayoutChangeEvent) => {
|
|
73
|
+
const layout = event.nativeEvent.layout;
|
|
74
|
+
setReactionsButtonLayoutRectangle((prev) => {
|
|
75
|
+
if (
|
|
76
|
+
prev &&
|
|
77
|
+
prev.width === layout.width &&
|
|
78
|
+
prev.height === layout.height &&
|
|
79
|
+
prev.x === layout.x &&
|
|
80
|
+
prev.y === layout.y
|
|
81
|
+
) {
|
|
82
|
+
return prev;
|
|
83
|
+
}
|
|
84
|
+
return layout;
|
|
85
|
+
});
|
|
86
|
+
};
|
|
63
87
|
|
|
64
88
|
return (
|
|
65
89
|
<View style={[styles.container, style]}>
|
|
66
90
|
<Restricted requiredGrants={[OwnCapability.CREATE_REACTION]}>
|
|
67
91
|
<CallControlsButton
|
|
68
92
|
testID={ButtonTestIds.REACTION}
|
|
69
|
-
onPress={
|
|
93
|
+
onPress={() => {
|
|
94
|
+
setShowReactionsPicker(true);
|
|
95
|
+
}}
|
|
70
96
|
color={theme.light.static_white}
|
|
71
97
|
style={styles.button}
|
|
98
|
+
onLayout={onReactionsButtonLayout}
|
|
72
99
|
>
|
|
73
100
|
<Reaction color={theme.light.static_black} />
|
|
74
101
|
</CallControlsButton>
|
|
75
102
|
</Restricted>
|
|
76
|
-
<ReactionModal
|
|
77
|
-
isReactionModalActive={isReactionModalActive}
|
|
78
|
-
setIsReactionModalActive={setIsReactionModalActive}
|
|
79
|
-
/>
|
|
80
103
|
{chatButton && (
|
|
81
104
|
<View>
|
|
82
105
|
<CallControlsButton
|
|
@@ -96,6 +119,16 @@ export const CallControls = ({
|
|
|
96
119
|
<ToggleAudioButton />
|
|
97
120
|
<ToggleCameraFaceButton />
|
|
98
121
|
<HangUpCallButton onPressHandler={hangUpCallButton?.onPressHandler} />
|
|
122
|
+
|
|
123
|
+
{showReactionsPicker && (
|
|
124
|
+
<ReactionsPicker
|
|
125
|
+
reactions={StreamVideoRN.getConfig().supportedReactions}
|
|
126
|
+
reactionsButtonLayoutRectangle={reactionsButtonLayoutRectangle}
|
|
127
|
+
onRequestedClose={() => {
|
|
128
|
+
setShowReactionsPicker(false);
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
)}
|
|
99
132
|
</View>
|
|
100
133
|
);
|
|
101
134
|
};
|
|
@@ -126,6 +159,7 @@ const styles = StyleSheet.create({
|
|
|
126
159
|
flexDirection: 'row',
|
|
127
160
|
justifyContent: 'space-between',
|
|
128
161
|
zIndex: Z_INDEX.IN_FRONT,
|
|
162
|
+
backgroundColor: theme.light.static_black,
|
|
129
163
|
},
|
|
130
164
|
button: {
|
|
131
165
|
// For iOS
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
LayoutRectangle,
|
|
4
|
+
Pressable,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Animated,
|
|
7
|
+
Easing,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { StreamVideoConfig } from '../../utils/StreamVideoRN/types';
|
|
10
|
+
import { useCall } from '@stream-io/video-react-bindings';
|
|
11
|
+
import { SendReactionRequest } from '@stream-io/video-client';
|
|
12
|
+
import { theme } from '../../theme';
|
|
13
|
+
import { ComponentTestIds } from '../../constants/TestIds';
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
reactions: StreamVideoConfig['supportedReactions'];
|
|
17
|
+
reactionsButtonLayoutRectangle?: LayoutRectangle;
|
|
18
|
+
onRequestedClose: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const TOP_PADDING = 4;
|
|
22
|
+
const REACTION_MARGIN_BOTTOM = 4;
|
|
23
|
+
|
|
24
|
+
export const ReactionsPicker = ({
|
|
25
|
+
reactions,
|
|
26
|
+
reactionsButtonLayoutRectangle,
|
|
27
|
+
onRequestedClose,
|
|
28
|
+
}: Props) => {
|
|
29
|
+
const call = useCall();
|
|
30
|
+
const size = reactionsButtonLayoutRectangle?.width ?? 0;
|
|
31
|
+
const reactionItemSize = size * 0.8;
|
|
32
|
+
|
|
33
|
+
const popupHeight =
|
|
34
|
+
// the top padding
|
|
35
|
+
TOP_PADDING +
|
|
36
|
+
// take margins into account
|
|
37
|
+
REACTION_MARGIN_BOTTOM * reactions.length +
|
|
38
|
+
// the size of the reaction icon items (same size as reactions button * amount of reactions)
|
|
39
|
+
reactionItemSize * reactions.length;
|
|
40
|
+
|
|
41
|
+
const reactionsPopupStyle = {
|
|
42
|
+
// we should show the popup right above the reactions button and not top of it
|
|
43
|
+
top: (reactionsButtonLayoutRectangle?.y ?? 0) - popupHeight,
|
|
44
|
+
// from the same side horizontal coordinate of the reactions button
|
|
45
|
+
left: reactionsButtonLayoutRectangle?.x,
|
|
46
|
+
// the width of the popup should be the same as the reactions button
|
|
47
|
+
width: size,
|
|
48
|
+
height: popupHeight,
|
|
49
|
+
// the popup should be rounded as the reactions button
|
|
50
|
+
borderTopStartRadius: size / 2,
|
|
51
|
+
borderTopEndRadius: size / 2,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const elasticAnimRef = useRef(new Animated.Value(0.5)); // Initial value for scale: 0.5
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
Animated.timing(elasticAnimRef.current, {
|
|
58
|
+
toValue: 1,
|
|
59
|
+
duration: 800,
|
|
60
|
+
useNativeDriver: true,
|
|
61
|
+
easing: Easing.elastic(3),
|
|
62
|
+
}).start();
|
|
63
|
+
}, []);
|
|
64
|
+
|
|
65
|
+
const reactionItemStyle = {
|
|
66
|
+
height: reactionItemSize,
|
|
67
|
+
width: reactionItemSize,
|
|
68
|
+
borderRadius: reactionItemSize / 2,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const reactionsButtonDimmerStyle = {
|
|
72
|
+
...styles.reactionsButtonDimmer,
|
|
73
|
+
height: size,
|
|
74
|
+
width: size,
|
|
75
|
+
// we should show the popup right on top of the reactions button
|
|
76
|
+
top: reactionsButtonLayoutRectangle?.y ?? 0 - popupHeight + size,
|
|
77
|
+
// from the same side horizontal coordinate of the reactions button
|
|
78
|
+
left: reactionsButtonLayoutRectangle?.x,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const onClose = (reaction?: SendReactionRequest) => {
|
|
82
|
+
if (reaction) {
|
|
83
|
+
call?.sendReaction(reaction).catch((e) => {
|
|
84
|
+
console.error(e, reaction);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
Animated.timing(elasticAnimRef.current, {
|
|
88
|
+
toValue: 0.2,
|
|
89
|
+
duration: 150,
|
|
90
|
+
useNativeDriver: true,
|
|
91
|
+
easing: Easing.linear,
|
|
92
|
+
}).start(onRequestedClose);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<Pressable
|
|
98
|
+
testID={ComponentTestIds.REACTIONS_PICKER}
|
|
99
|
+
style={[styles.reactionsPopup, reactionsPopupStyle]}
|
|
100
|
+
onPress={() => {
|
|
101
|
+
onClose();
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
{/* all the reactions */}
|
|
105
|
+
{reactions.map((reaction) => (
|
|
106
|
+
<Pressable
|
|
107
|
+
key={reaction.emoji_code}
|
|
108
|
+
style={[styles.reactionItem, reactionItemStyle]}
|
|
109
|
+
onPress={() => {
|
|
110
|
+
onClose({
|
|
111
|
+
type: reaction.type,
|
|
112
|
+
custom: reaction.custom,
|
|
113
|
+
emoji_code: reaction.emoji_code,
|
|
114
|
+
});
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<Animated.Text
|
|
118
|
+
style={[
|
|
119
|
+
styles.reactionText,
|
|
120
|
+
{
|
|
121
|
+
transform: [
|
|
122
|
+
{
|
|
123
|
+
scaleY: elasticAnimRef.current,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
scaleX: elasticAnimRef.current,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
]}
|
|
131
|
+
>
|
|
132
|
+
{reaction.icon}
|
|
133
|
+
</Animated.Text>
|
|
134
|
+
</Pressable>
|
|
135
|
+
))}
|
|
136
|
+
</Pressable>
|
|
137
|
+
{/* a square view with 50% opacity that semi hides the reactions button */}
|
|
138
|
+
<Pressable style={reactionsButtonDimmerStyle} onPress={() => onClose()} />
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const styles = StyleSheet.create({
|
|
144
|
+
reactionsPopup: {
|
|
145
|
+
position: 'absolute',
|
|
146
|
+
alignItems: 'center',
|
|
147
|
+
backgroundColor: theme.light.static_black,
|
|
148
|
+
paddingTop: TOP_PADDING,
|
|
149
|
+
},
|
|
150
|
+
reactionsButtonDimmer: {
|
|
151
|
+
position: 'absolute',
|
|
152
|
+
backgroundColor: theme.light.static_black,
|
|
153
|
+
opacity: 0.5,
|
|
154
|
+
},
|
|
155
|
+
reactionItem: {
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
marginBottom: REACTION_MARGIN_BOTTOM,
|
|
159
|
+
// temporary background color until we have theming
|
|
160
|
+
backgroundColor: theme.light.static_grey,
|
|
161
|
+
},
|
|
162
|
+
reactionText: {
|
|
163
|
+
fontSize: 18.5,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
@@ -18,6 +18,10 @@ interface CallControlsButtonProps {
|
|
|
18
18
|
* The background color of the button rendered.
|
|
19
19
|
*/
|
|
20
20
|
color?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Boolean to enable/enable the button
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
21
25
|
/**
|
|
22
26
|
* Style to the Pressable button.
|
|
23
27
|
*/
|
|
@@ -30,6 +34,7 @@ interface CallControlsButtonProps {
|
|
|
30
34
|
* Accessibility label for the button.
|
|
31
35
|
*/
|
|
32
36
|
testID?: string;
|
|
37
|
+
onLayout?: View['props']['onLayout'];
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
const DEFAULT_ICON_SIZE = theme.icon.md;
|
|
@@ -38,7 +43,16 @@ const DEFAULT_BUTTON_SIZE = theme.button.sm;
|
|
|
38
43
|
export const CallControlsButton = (
|
|
39
44
|
props: React.PropsWithChildren<CallControlsButtonProps>,
|
|
40
45
|
) => {
|
|
41
|
-
const {
|
|
46
|
+
const {
|
|
47
|
+
onPress,
|
|
48
|
+
children,
|
|
49
|
+
disabled,
|
|
50
|
+
color,
|
|
51
|
+
style,
|
|
52
|
+
svgContainerStyle,
|
|
53
|
+
testID,
|
|
54
|
+
onLayout,
|
|
55
|
+
} = props;
|
|
42
56
|
|
|
43
57
|
const pressableStyle: PressableProps['style'] = ({ pressed }) => [
|
|
44
58
|
DEFAULT_BUTTON_SIZE,
|
|
@@ -48,10 +62,17 @@ export const CallControlsButton = (
|
|
|
48
62
|
opacity: pressed ? 0.2 : 1,
|
|
49
63
|
},
|
|
50
64
|
style ? style : null,
|
|
65
|
+
disabled ? styles.disabledStyle : null,
|
|
51
66
|
];
|
|
52
67
|
|
|
53
68
|
return (
|
|
54
|
-
<Pressable
|
|
69
|
+
<Pressable
|
|
70
|
+
disabled={disabled}
|
|
71
|
+
style={pressableStyle}
|
|
72
|
+
onPress={onPress}
|
|
73
|
+
testID={testID}
|
|
74
|
+
onLayout={onLayout}
|
|
75
|
+
>
|
|
55
76
|
<View
|
|
56
77
|
style={[
|
|
57
78
|
styles.svgContainerStyle,
|
|
@@ -73,4 +94,7 @@ const styles = StyleSheet.create({
|
|
|
73
94
|
alignItems: 'center',
|
|
74
95
|
},
|
|
75
96
|
svgContainerStyle: {},
|
|
97
|
+
disabledStyle: {
|
|
98
|
+
backgroundColor: theme.light.disabled,
|
|
99
|
+
},
|
|
76
100
|
});
|
|
@@ -9,12 +9,13 @@ import { theme } from '../../../theme';
|
|
|
9
9
|
import { StyleSheet } from 'react-native';
|
|
10
10
|
|
|
11
11
|
export const ToggleCameraFaceButton = () => {
|
|
12
|
-
const { isCameraOnFrontFacingMode, toggleCameraFacingMode } =
|
|
12
|
+
const { isVideoMuted, isCameraOnFrontFacingMode, toggleCameraFacingMode } =
|
|
13
13
|
useMediaStreamManagement();
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<Restricted requiredGrants={[OwnCapability.SEND_VIDEO]}>
|
|
17
17
|
<CallControlsButton
|
|
18
|
+
disabled={isVideoMuted}
|
|
18
19
|
onPress={toggleCameraFacingMode}
|
|
19
20
|
color={muteStatusColor(!isCameraOnFrontFacingMode)}
|
|
20
21
|
style={isCameraOnFrontFacingMode ? styles.button : null}
|
package/src/constants/TestIds.ts
CHANGED
|
@@ -14,7 +14,7 @@ export enum ComponentTestIds {
|
|
|
14
14
|
PARTICIPANT_MEDIA_STREAM = 'participant-media-stream',
|
|
15
15
|
PARTICIPANTS_INFO = 'participants-info',
|
|
16
16
|
PARTICIPANT_SCREEN_SHARING = 'participant-screen-sharing',
|
|
17
|
-
|
|
17
|
+
REACTIONS_PICKER = 'reactions-picker',
|
|
18
18
|
CHAT_UNREAD_BADGE_COUNT_INDICATOR = 'chat-unread-badge-count-indicator',
|
|
19
19
|
}
|
|
20
20
|
|
package/src/constants/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { theme } from '../theme';
|
|
2
|
+
import { StreamVideoConfig } from '../utils/StreamVideoRN/types';
|
|
2
3
|
|
|
3
4
|
export const LOCAL_VIDEO_VIEW_STYLE = {
|
|
4
5
|
height: 140,
|
|
@@ -6,7 +7,7 @@ export const LOCAL_VIDEO_VIEW_STYLE = {
|
|
|
6
7
|
borderRadius: theme.rounded.sm,
|
|
7
8
|
};
|
|
8
9
|
|
|
9
|
-
export const defaultEmojiReactions = [
|
|
10
|
+
export const defaultEmojiReactions: StreamVideoConfig['supportedReactions'] = [
|
|
10
11
|
{
|
|
11
12
|
type: 'reaction',
|
|
12
13
|
emoji_code: ':like:',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StreamReaction, StreamVideoClient } from '@stream-io/video-client';
|
|
2
2
|
import { AndroidChannel } from '@notifee/react-native';
|
|
3
3
|
|
|
4
|
-
type StreamReactionType = StreamReaction & {
|
|
4
|
+
type StreamReactionType = Required<StreamReaction> & {
|
|
5
5
|
icon: string | JSX.Element;
|
|
6
6
|
};
|
|
7
7
|
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type ReactionModalProps = {
|
|
3
|
-
isReactionModalActive: boolean;
|
|
4
|
-
setIsReactionModalActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* A component that shows a list of reactions that can be sent in a call.
|
|
8
|
-
*/
|
|
9
|
-
export declare const ReactionModal: (props: ReactionModalProps) => JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ReactionModal = void 0;
|
|
27
|
-
const react_native_1 = require("react-native");
|
|
28
|
-
const theme_1 = require("../../theme");
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const video_react_bindings_1 = require("@stream-io/video-react-bindings");
|
|
31
|
-
const utils_1 = require("../../utils");
|
|
32
|
-
const TestIds_1 = require("../../constants/TestIds");
|
|
33
|
-
/**
|
|
34
|
-
* A component that shows a list of reactions that can be sent in a call.
|
|
35
|
-
*/
|
|
36
|
-
const ReactionModal = (props) => {
|
|
37
|
-
const { isReactionModalActive, setIsReactionModalActive } = props;
|
|
38
|
-
const onCloseReactionsModal = (0, react_1.useCallback)(() => {
|
|
39
|
-
setIsReactionModalActive(false);
|
|
40
|
-
}, [setIsReactionModalActive]);
|
|
41
|
-
const call = (0, video_react_bindings_1.useCall)();
|
|
42
|
-
const { supportedReactions } = utils_1.StreamVideoRN.getConfig();
|
|
43
|
-
const sendReaction = async (reaction) => {
|
|
44
|
-
await call?.sendReaction(reaction);
|
|
45
|
-
setIsReactionModalActive(false);
|
|
46
|
-
};
|
|
47
|
-
return (<react_native_1.Modal testID={TestIds_1.ComponentTestIds.REACTIONS_MODAL} animationType="slide" transparent={true} visible={isReactionModalActive} onRequestClose={onCloseReactionsModal}>
|
|
48
|
-
<react_native_1.Pressable style={styles.container} onPress={() => setIsReactionModalActive(false)}>
|
|
49
|
-
<react_native_1.View style={styles.menu} onStartShouldSetResponder={() => true}>
|
|
50
|
-
<react_native_1.View style={styles.reactions}>
|
|
51
|
-
{supportedReactions.map((reaction) => (<react_native_1.Pressable onPress={() => sendReaction(reaction)} key={reaction.emoji_code} style={styles.reaction}>
|
|
52
|
-
<react_native_1.Text>
|
|
53
|
-
{reaction.emoji_code &&
|
|
54
|
-
supportedReactions.find((supportedReaction) => supportedReaction.emoji_code === reaction.emoji_code)?.icon}
|
|
55
|
-
</react_native_1.Text>
|
|
56
|
-
</react_native_1.Pressable>))}
|
|
57
|
-
</react_native_1.View>
|
|
58
|
-
</react_native_1.View>
|
|
59
|
-
</react_native_1.Pressable>
|
|
60
|
-
</react_native_1.Modal>);
|
|
61
|
-
};
|
|
62
|
-
exports.ReactionModal = ReactionModal;
|
|
63
|
-
const styles = react_native_1.StyleSheet.create({
|
|
64
|
-
container: {
|
|
65
|
-
flex: 1,
|
|
66
|
-
justifyContent: 'center',
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
backgroundColor: theme_1.theme.light.overlay,
|
|
69
|
-
},
|
|
70
|
-
menu: {
|
|
71
|
-
backgroundColor: theme_1.theme.light.bars,
|
|
72
|
-
borderRadius: theme_1.theme.rounded.md,
|
|
73
|
-
},
|
|
74
|
-
reactions: {
|
|
75
|
-
display: 'flex',
|
|
76
|
-
flexDirection: 'row',
|
|
77
|
-
alignItems: 'center',
|
|
78
|
-
justifyContent: 'space-between',
|
|
79
|
-
padding: theme_1.theme.padding.md,
|
|
80
|
-
},
|
|
81
|
-
reaction: {
|
|
82
|
-
marginHorizontal: theme_1.theme.margin.md,
|
|
83
|
-
},
|
|
84
|
-
svgContainerStyle: {},
|
|
85
|
-
closeIcon: {
|
|
86
|
-
marginLeft: theme_1.theme.margin.md,
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=ReactionsModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactionsModal.js","sourceRoot":"","sources":["../../../../src/components/utility/ReactionsModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAwE;AACxE,uCAAoC;AACpC,+CAA2C;AAC3C,0EAA0D;AAC1D,uCAA4C;AAC5C,qDAA2D;AAO3D;;GAEG;AACI,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,EAAE;IACzD,MAAM,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,GAAG,KAAK,CAAC;IAClE,MAAM,qBAAqB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC7C,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAA,8BAAO,GAAE,CAAC;IACvB,MAAM,EAAE,kBAAkB,EAAE,GAAG,qBAAa,C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BAAA,EAAE,mBAAI,CACR;cAAA,EAAE,wBAAS,CAAC,CACb,CAAC,CACJ;UAAA,EAAE,mBAAI,CACR;QAAA,EAAE,mBAAI,CACR;MAAA,EAAE,wBAAS,CACb;IAAA,EAAE,oBAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,aAAa,iBA+CxB;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,OAAO;KACrC;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,aAAK,CAAC,KAAK,CAAC,IAAI;QACjC,YAAY,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;KAC/B;IACD,SAAS,EAAE;QACT,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,eAAe;QAC/B,OAAO,EAAE,aAAK,CAAC,OAAO,CAAC,EAAE;KAC1B;IACD,QAAQ,EAAE;QACR,gBAAgB,EAAE,aAAK,CAAC,MAAM,CAAC,EAAE;KAClC;IACD,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE;QACT,UAAU,EAAE,aAAK,CAAC,MAAM,CAAC,EAAE;KAC5B;CACF,CAAC,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { StreamReaction } from '@stream-io/video-client';
|
|
2
|
-
import { Pressable, StyleSheet, View, Text, Modal } from 'react-native';
|
|
3
|
-
import { theme } from '../../theme';
|
|
4
|
-
import React, { useCallback } from 'react';
|
|
5
|
-
import { useCall } from '@stream-io/video-react-bindings';
|
|
6
|
-
import { StreamVideoRN } from '../../utils';
|
|
7
|
-
import { ComponentTestIds } from '../../constants/TestIds';
|
|
8
|
-
|
|
9
|
-
type ReactionModalProps = {
|
|
10
|
-
isReactionModalActive: boolean;
|
|
11
|
-
setIsReactionModalActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A component that shows a list of reactions that can be sent in a call.
|
|
16
|
-
*/
|
|
17
|
-
export const ReactionModal = (props: ReactionModalProps) => {
|
|
18
|
-
const { isReactionModalActive, setIsReactionModalActive } = props;
|
|
19
|
-
const onCloseReactionsModal = useCallback(() => {
|
|
20
|
-
setIsReactionModalActive(false);
|
|
21
|
-
}, [setIsReactionModalActive]);
|
|
22
|
-
const call = useCall();
|
|
23
|
-
const { supportedReactions } = StreamVideoRN.getConfig();
|
|
24
|
-
|
|
25
|
-
const sendReaction = async (reaction: StreamReaction) => {
|
|
26
|
-
await call?.sendReaction(reaction);
|
|
27
|
-
setIsReactionModalActive(false);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Modal
|
|
32
|
-
testID={ComponentTestIds.REACTIONS_MODAL}
|
|
33
|
-
animationType="slide"
|
|
34
|
-
transparent={true}
|
|
35
|
-
visible={isReactionModalActive}
|
|
36
|
-
onRequestClose={onCloseReactionsModal}
|
|
37
|
-
>
|
|
38
|
-
<Pressable
|
|
39
|
-
style={styles.container}
|
|
40
|
-
onPress={() => setIsReactionModalActive(false)}
|
|
41
|
-
>
|
|
42
|
-
<View style={styles.menu} onStartShouldSetResponder={() => true}>
|
|
43
|
-
<View style={styles.reactions}>
|
|
44
|
-
{supportedReactions.map((reaction) => (
|
|
45
|
-
<Pressable
|
|
46
|
-
onPress={() => sendReaction(reaction)}
|
|
47
|
-
key={reaction.emoji_code}
|
|
48
|
-
style={styles.reaction}
|
|
49
|
-
>
|
|
50
|
-
<Text>
|
|
51
|
-
{reaction.emoji_code &&
|
|
52
|
-
supportedReactions.find(
|
|
53
|
-
(supportedReaction) =>
|
|
54
|
-
supportedReaction.emoji_code === reaction.emoji_code,
|
|
55
|
-
)?.icon}
|
|
56
|
-
</Text>
|
|
57
|
-
</Pressable>
|
|
58
|
-
))}
|
|
59
|
-
</View>
|
|
60
|
-
</View>
|
|
61
|
-
</Pressable>
|
|
62
|
-
</Modal>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const styles = StyleSheet.create({
|
|
67
|
-
container: {
|
|
68
|
-
flex: 1,
|
|
69
|
-
justifyContent: 'center',
|
|
70
|
-
alignItems: 'center',
|
|
71
|
-
backgroundColor: theme.light.overlay,
|
|
72
|
-
},
|
|
73
|
-
menu: {
|
|
74
|
-
backgroundColor: theme.light.bars,
|
|
75
|
-
borderRadius: theme.rounded.md,
|
|
76
|
-
},
|
|
77
|
-
reactions: {
|
|
78
|
-
display: 'flex',
|
|
79
|
-
flexDirection: 'row',
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
justifyContent: 'space-between',
|
|
82
|
-
padding: theme.padding.md,
|
|
83
|
-
},
|
|
84
|
-
reaction: {
|
|
85
|
-
marginHorizontal: theme.margin.md,
|
|
86
|
-
},
|
|
87
|
-
svgContainerStyle: {},
|
|
88
|
-
closeIcon: {
|
|
89
|
-
marginLeft: theme.margin.md,
|
|
90
|
-
},
|
|
91
|
-
});
|