Skip to content
Draft
1 change: 1 addition & 0 deletions template/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const DefaultConfig = {
STT_AUTO_START: false,
CLOUD_RECORDING_AUTO_START: false,
ENABLE_SPOTLIGHT: false,
ENABLE_LIVE_REACTIONS: true,
AUTO_CONNECT_RTM: false,
ENABLE_CONVERSATIONAL_AI: false,
CUSTOMIZE_AGENT: true,
Expand Down
1 change: 1 addition & 0 deletions template/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ interface ConfigInterface {
STT_AUTO_START: boolean;
CLOUD_RECORDING_AUTO_START: boolean;
ENABLE_SPOTLIGHT: boolean;
ENABLE_LIVE_REACTIONS: boolean;
AUTO_CONNECT_RTM: boolean;
ENABLE_CONVERSATIONAL_AI: boolean;
CUSTOMIZE_AGENT: boolean;
Expand Down
1 change: 1 addition & 0 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"graphql": "15.5.0",
"hark": "^1.2.3",
"jwt-decode": "3.1.2",
"lottie-web": "^5.13.0",
"nanoevents": "7.0.1",
"nanoid": "4.0.0",
"nosleep.js": "0.12.0",
Expand Down
Binary file added template/src/assets/live-reactions/1f389.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f44d.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f44f.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f496.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f602.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f622.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f62e.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added template/src/assets/live-reactions/1f914.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f389.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f44d.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f44f.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f496.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f602.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f622.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f62e.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions template/src/assets/live-reactions/animated/1f914.json

Large diffs are not rendered by default.

26 changes: 21 additions & 5 deletions template/src/components/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import {
ScreenshareToolbarItem,
} from './controls/toolbar-items';
import ViewTextTracksModal from './text-tracks/ViewTextTracksModal';
import LiveReactionButton from './reactions/LiveReactionButton';

export const useToggleWhiteboard = () => {
const {
Expand Down Expand Up @@ -1129,6 +1130,14 @@ export const RecordingToolbarItem = props => {
);
};

export const LiveReactionToolbarItem = props => {
return (
<ToolbarItem testID="liveReaction-btn" toolbarProps={props}>
<LiveReactionButton />
</ToolbarItem>
);
};

export const MoreButtonToolbarItem = (props?: {
fields?: ToolbarMoreButtonCustomFields;
}) => {
Expand Down Expand Up @@ -1324,36 +1333,43 @@ const Controls = (props: ControlsProps) => {
component: LocalVideoToolbarItem,
order: 2,
},
reactions: {
align: 'center',
component: $config.ENABLE_LIVE_REACTIONS
? LiveReactionToolbarItem
: null,
order: 3,
},
'switch-camera': {
align: 'center',
component: SwitchCameraToolbarItem,
order: 3,
order: 4,
},
screenshare: {
align: 'center',
component: canAccessScreenshare ? ScreenshareToolbarItem : null,
order: 4,
order: 5,
hide: w => {
return w < BREAKPOINTS.sm ? true : false;
},
},
recording: {
align: 'center',
component: RecordingToolbarItem,
order: 5,
order: 6,
hide: w => {
return w < BREAKPOINTS.sm ? true : false;
},
},
more: {
align: 'center',
component: MoreButtonToolbarItem,
order: 6,
order: 7,
},
'end-call': {
align: 'center',
component: LocalEndcallToolbarItem,
order: 7,
order: 8,
},
};
}, [canAccessInvite, canAccessScreenshare]);
Expand Down
57 changes: 57 additions & 0 deletions template/src/components/reactions/LiveReactionBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
import {useVideoCall} from '../useVideoCall';

interface LiveReactionBadgeProps {
uid: number | string;
hasLeadingIcon?: boolean;
}

const LiveReactionBadge = ({
uid,
hasLeadingIcon = false,
}: LiveReactionBadgeProps) => {
const {latestReactionByUid} = useVideoCall();
const reaction = latestReactionByUid[String(uid)];

if (!$config.ENABLE_LIVE_REACTIONS || !reaction) {
return null;
}

return (
<View
pointerEvents="none"
style={[
styles.container,
hasLeadingIcon ? styles.containerWithLeadingIcon : null,
]}>
<Text style={styles.emoji}>{reaction.emoji}</Text>
</View>
);
};

const styles = StyleSheet.create({
container: {
position: 'absolute',
top: 8,
left: 8,
zIndex: 1001,
width: 32,
height: 32,
borderRadius: 16,
alignItems: 'center',
justifyContent: 'center',
backgroundColor:
$config.CARD_LAYER_5_COLOR + hexadecimalTransparency['25%'],
},
containerWithLeadingIcon: {
left: 48,
},
emoji: {
fontSize: 24,
lineHeight: 26,
},
});

export default LiveReactionBadge;
Loading