Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { useEffect, useState } from 'react';
import { StyleSheet, View } from 'react-native';
import InCallManager from 'react-native-incall-manager';

import {
CallTopView as DefaultCallTopView,
CallTopViewProps,
} from '../CallTopView';
import {
CallParticipantsGrid,
CallParticipantsGridProps,
Expand Down Expand Up @@ -48,7 +43,7 @@ type CallContentComponentProps = ParticipantViewComponentProps &
/**
* Component to customize the CallTopView component.
*/
CallTopView?: React.ComponentType<CallTopViewProps> | null;
CallTopView?: React.ComponentType<any> | null;
/**
* Component to customize the CallControls component.
*/
Expand All @@ -71,7 +66,6 @@ export type CallContentProps = Pick<
HangUpCallButtonProps,
'onHangupCallHandler'
> &
Pick<CallTopViewProps, 'onBackPressed'> &
CallContentComponentProps & {
/**
* This switches the participant's layout between the grid and the spotlight mode.
Expand All @@ -97,10 +91,9 @@ export type CallContentProps = Pick<
};

export const CallContent = ({
onBackPressed,
onHangupCallHandler,
CallParticipantsList,
CallTopView = DefaultCallTopView,
CallTopView,
CallControls = DefaultCallControls,
FloatingParticipantView = DefaultFloatingParticipantView,
ScreenShareOverlay = DefaultScreenShareOverlay,
Expand Down Expand Up @@ -204,16 +197,16 @@ export const CallContent = ({
/>
)}
<View style={[styles.container, callContent.container]}>
<View style={[styles.content, callContent.callParticipantsContainer]}>
<View style={[styles.container, callContent.callParticipantsContainer]}>
{!isInPiPMode && CallTopView && (
<CallTopView onHangupCallHandler={onHangupCallHandler} />
)}
<View
style={[styles.view, callContent.topContainer]}
// "box-none" disallows the container view to be not take up touches
// and allows only the top and floating view (its child views) to take up the touches
pointerEvents="box-none"
>
{!isInPiPMode && CallTopView && (
<CallTopView onBackPressed={onBackPressed} />
)}
{showFloatingView && FloatingParticipantView && (
<FloatingParticipantView
participant={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ interface CallControlsButtonProps {
* The background color of the button rendered.
*/
color?: ColorValue;
/**
* The background color of the disabled button.
*/
disabledColor?: ColorValue;
/**
* Boolean to enable/disable the button
*/
Expand Down Expand Up @@ -49,6 +53,7 @@ export const CallControlsButton = (
children,
disabled,
color: colorProp,
disabledColor: disabledColorProp,
style: styleProp,
size,
testID,
Expand All @@ -68,7 +73,7 @@ export const CallControlsButton = (
styles.container,
{
backgroundColor: disabled
? colors.buttonPrimaryDisabled
? disabledColorProp || colors.buttonPrimaryDisabled
: colorProp || colors.buttonSecondaryDefault,
opacity: pressed ? 0.2 : 1,
height: size || roundButtonSizes.lg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ButtonTestIds } from '../../../constants/TestIds';
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
import { CallingState } from '@stream-io/video-client';
import { useTheme } from '../../../contexts/ThemeContext';
import { IconWrapper } from '../../../icons/IconWrapper';

/**
* The props for the Hang up call button in the Call Controls.
Expand Down Expand Up @@ -42,7 +43,7 @@ export const HangUpCallButton = ({
const { useCallCallingState } = useCallStateHooks();
const callingState = useCallCallingState();
const {
theme: { colors, hangupCallButton },
theme: { colors, hangupCallButton, variants },
} = useTheme();

const onPress = async () => {
Expand Down Expand Up @@ -72,15 +73,12 @@ export const HangUpCallButton = ({
size={size}
testID={ButtonTestIds.HANG_UP_CALL}
>
<PhoneDown color={colors.base1} />
<IconWrapper>
<PhoneDown
color={colors.iconPrimaryDefault}
size={variants.iconSizes.md}
/>
</IconWrapper>
</CallControlsButton>
);
};

// TODO: Check if this style is needed
// This was passed to CallControlsButton as style prop
// const styles = StyleSheet.create({
// button: {
// shadowColor: theme.light.error,
// },
// });
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const RejectCallButton = ({
theme: {
colors,
rejectCallButton,
variants: { buttonSizes },
variants: { buttonSizes, iconSizes },
},
} = useTheme();
const rejectCallHandler = async () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ export const RejectCallButton = ({
// svgContainerStyle={theme.icon.lg}
style={rejectCallButton}
>
<PhoneDown color={colors.base1} />
<PhoneDown color={colors.iconPrimaryDefault} size={iconSizes.md} />
</CallControlsButton>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OwnCapability } from '@stream-io/video-client';
import { Restricted, useCallStateHooks } from '@stream-io/video-react-bindings';
import React from 'react';
import { CallControlsButton } from './CallControlsButton';
import { CameraSwitch } from '../../../icons';
import { CameraSwitch, IconWrapper } from '../../../icons';
import { useTheme } from '../../../contexts/ThemeContext';

/**
Expand All @@ -28,7 +28,7 @@ export const ToggleCameraFaceButton = ({
const isVideoEnabledInCall = callSettings?.video.enabled;

const {
theme: { colors, toggleCameraFaceButton },
theme: { colors, toggleCameraFaceButton, defaults },
} = useTheme();
const onPress = async () => {
if (onPressHandler) {
Expand All @@ -47,17 +47,23 @@ export const ToggleCameraFaceButton = ({
<Restricted requiredGrants={[OwnCapability.SEND_VIDEO]}>
<CallControlsButton
onPress={onPress}
color={direction === 'back' ? colors.background4 : colors.base1}
color={colors.sheetPrimary}
disabledColor={colors.sheetPrimary}
disabled={optimisticIsMute}
style={toggleCameraFaceButton}
>
<CameraSwitch
color={
direction === 'front' || direction === undefined
? colors.base5
: colors.base1
}
/>
<IconWrapper>
<CameraSwitch
size={defaults.iconSize}
color={
optimisticIsMute
? colors.buttonPrimaryDisabled
: direction === 'front' || direction === undefined
? colors.iconPrimaryDefault
: colors.buttonPrimaryDefault
}
/>
</IconWrapper>
</CallControlsButton>
</Restricted>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const CallParticipantsGrid = ({
style={[
styles.container,
landscapeStyles,
{ backgroundColor: colors.background2 },
{ backgroundColor: colors.sheetPrimary },
callParticipantsGrid.container,
]}
testID={ComponentTestIds.CALL_PARTICIPANTS_GRID}
Expand All @@ -118,7 +118,5 @@ export const CallParticipantsGrid = ({
};

const styles = StyleSheet.create({
container: {
flex: 1,
},
container: { flex: 1 },
});
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ export const CallParticipantsList = ({
};

const styles = StyleSheet.create({
flexed: {
flex: 1,
},
flexed: { flex: 1 },
participantWrapperHorizontal: {
// note: if marginHorizontal is changed, be sure to change the width calculation in calculateParticipantViewSize function
marginHorizontal: 8,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import {
useI18n,
} from '@stream-io/video-react-bindings';
import { UserInfo } from './UserInfo';
import {
CallTopView as DefaultCallTopView,
CallTopViewProps,
} from '../CallTopView';
import {
IncomingCallControls as DefaultIncomingCallControls,
IncomingCallControlsProps,
Expand All @@ -30,7 +26,7 @@ export type IncomingCallProps = IncomingCallControlsProps & {
/**
* Prop to customize the CallTopView component in the IncomingCall component.
*/
CallTopView?: React.ComponentType<CallTopViewProps> | null;
CallTopView?: React.ComponentType<any> | null;
/**
* Prop to customize the IncomingCall controls.
*/
Expand All @@ -49,7 +45,7 @@ export type IncomingCallProps = IncomingCallControlsProps & {
export const IncomingCall = ({
onAcceptCallHandler,
onRejectCallHandler,
CallTopView = DefaultCallTopView,
CallTopView,
IncomingCallControls = DefaultIncomingCallControls,
landscape,
}: IncomingCallProps) => {
Expand Down
Loading
Loading