Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(design-v2): sdk and dogfood app design-v2 changes #1549

Merged
merged 56 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e7b86b6
feat: improvements for the theming scheme of the SDK (#1499)
kristian-mkd Oct 7, 2024
438251d
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 10, 2024
00a6373
feat(design-v2): Call control buttons (#1514)
kristian-mkd Oct 16, 2024
3f48b9a
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 16, 2024
4f36656
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 16, 2024
a0fbc0e
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 22, 2024
d5c0474
feat(design-v2): call scene container and top call components (#1519)
kristian-mkd Oct 24, 2024
d8f59c1
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 29, 2024
4e8826a
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 30, 2024
824bd96
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Oct 31, 2024
7b14fb0
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 1, 2024
d87eb42
feat(design-v2): new layouts (#1529)
kristian-mkd Nov 1, 2024
0235d95
fix: camera not enabled on foreground notifications (#1546)
santhoshvai Nov 1, 2024
68e119f
chore(@stream-io/video-client): release version 1.10.2
Nov 1, 2024
12935e6
chore(@stream-io/video-react-bindings): release version 1.1.12
Nov 1, 2024
0ebbba8
chore(@stream-io/video-react-sdk): release version 1.7.7
Nov 1, 2024
5fe1b87
chore(@stream-io/video-react-native-sdk): release version 1.2.9
Nov 1, 2024
7ed7033
chore(@stream-io/video-react-native-dogfood): release version 4.4.9
Nov 1, 2024
bdc4a86
fix: imports for useToggleCallRecording (#1548)
kristian-mkd Nov 1, 2024
8ecb5b9
chore(@stream-io/video-react-bindings): release version 1.1.13
Nov 1, 2024
1e2d9d1
chore(@stream-io/video-react-sdk): release version 1.7.8
Nov 1, 2024
b4e7153
chore(@stream-io/video-react-native-sdk): release version 1.2.10
Nov 1, 2024
f43e394
chore(@stream-io/video-react-native-dogfood): release version 4.4.10
Nov 1, 2024
ee59942
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 1, 2024
57c88b2
feat(design-v2): call recording flow (#1535)
kristian-mkd Nov 1, 2024
f29756d
feat(design-v2): bottom controls drawer component with reactions flow…
kristian-mkd Nov 1, 2024
a3a95ca
feat: add feedback flow
kristian-mkd Nov 2, 2024
d36c76a
fix: revert changes
kristian-mkd Nov 2, 2024
442850e
feat(design-v2): screen share flow (#1552)
kristian-mkd Nov 4, 2024
4d20f44
feat(design-v2): add feedback flow in react native dogfood (#1551)
kristian-mkd Nov 4, 2024
b31cc6f
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 4, 2024
0b10d27
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 5, 2024
4f39ec5
fix: bump webrtc version (#1558)
kristian-mkd Nov 6, 2024
f420d91
fix: yarn lock issue
kristian-mkd Nov 6, 2024
9ae9718
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 7, 2024
ff7752b
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 7, 2024
fe8f457
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 12, 2024
187f2e4
fix(design-v2): color consolidation and other fixes (#1556)
kristian-mkd Nov 12, 2024
c502a06
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 14, 2024
61830ab
update webrtc version
kristian-mkd Nov 14, 2024
0feb527
yarn lock update
kristian-mkd Nov 14, 2024
bc06a89
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 14, 2024
64280b2
fix(design-v2): review remarks for the design-v2 umbrella branch (#1572)
kristian-mkd Nov 15, 2024
a909fae
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 15, 2024
30c4781
fix: deploy errors for iPad support related with missing icons and su…
kristian-mkd Nov 16, 2024
6e78549
fix: ios icons for deploy of dogfood app
kristian-mkd Nov 16, 2024
5ac13d2
fix: issues discovered when fixing docs
kristian-mkd Nov 18, 2024
6e551e7
fix: use theme insets in the SDK screen like components
kristian-mkd Nov 19, 2024
f95851a
remove unused imports
kristian-mkd Nov 19, 2024
7592d16
remove unused variable
kristian-mkd Nov 20, 2024
8251322
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 20, 2024
94c5018
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 21, 2024
5fc43aa
fix chat dark theme in dogfood app
kristian-mkd Nov 21, 2024
d976270
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
kristian-mkd Nov 22, 2024
db30beb
fix(design-v2): Bug fixes for iPad reported issues (#1586)
kristian-mkd Nov 22, 2024
a5a8189
Merge branch 'main' into PBE-5855-feat/react-native-video-design-v2
oliverlaz Nov 25, 2024
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
1 change: 1 addition & 0 deletions packages/react-bindings/src/hooks/callUtilHooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import { useCall } from '../contexts';
import { useIsCallRecordingInProgress } from './callStateHooks';

/**
* Custom hook for toggling call recording in a video call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { mockClientWithUser } from '../mocks/client';
import mockParticipant from '../mocks/participant';
import { ButtonTestIds, ComponentTestIds } from '../../src/constants/TestIds';
import { mockCall } from '../mocks/call';
import { fireEvent, render, screen, waitFor } from '../utils/RNTLTools';
import { fireEvent, render, screen } from '../utils/RNTLTools';
import { OwnCapability } from '@stream-io/video-client';
import { defaultEmojiReactions } from '../../src/constants';
import { CallControls } from '../../src/components/Call/CallControls/CallControls';
import { ChatButton } from '../../src/components/Call/CallControls/ChatButton';
import { CallControls } from '../../src';
import { HangUpCallButton } from '../../src/components/Call/CallControls/HangupCallButton';
import { ReactionsButton } from '../../src/components/Call/CallControls/ReactionsButton';

Expand All @@ -18,48 +17,6 @@ enum P_IDS {
LOCAL_1 = 'local-1',
}

describe('ChatButton', () => {
it('should render an unread badge indicator when the value is defined in the chatButton prop', async () => {
const call = mockCall(mockClientWithUser(), [
mockParticipant({
isLocalParticipant: true,
sessionId: P_IDS.LOCAL_1,
userId: P_IDS.LOCAL_1,
}),
]);

render(<ChatButton onPressHandler={jest.fn()} unreadBadgeCount={1} />, {
call,
});

const indicator = await screen.findByText('1');

expect(indicator).toBeVisible();
});

it('should not render an unread badge indicator when the value is 0 in the chatButton prop', async () => {
const call = mockCall(mockClientWithUser(), [
mockParticipant({
isLocalParticipant: true,
sessionId: P_IDS.LOCAL_1,
userId: P_IDS.LOCAL_1,
}),
]);

render(<ChatButton onPressHandler={jest.fn()} unreadBadgeCount={0} />, {
call,
});

await waitFor(() =>
expect(() =>
screen.getByTestId(ComponentTestIds.CHAT_UNREAD_BADGE_COUNT_INDICATOR)
).toThrow(
/Unable to find an element with testID: chat-unread-badge-count-indicator/i
)
);
});
});

describe('ReactionsButton', () => {
it('render reaction button in call controls component', async () => {
const call = mockCall(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ describe('ParticipantView', () => {
expect(
await screen.findByTestId(ComponentTestIds.PARTICIPANT_AVATAR)
).toBeOnTheScreen();
expect(screen.getByTestId(IconTestIds.MUTED_VIDEO)).toBeOnTheScreen();
expect(screen.getByText(testParticipant.name)).toBeOnTheScreen();
// reaction is visible and then disappears after 5500 ms
expect(screen.getByText('πŸŽ‰')).toBeOnTheScreen();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import CallContentSpotlight from '../../assets/04-ui-components/call/call-conten

import CallTopView from '../../common-content/ui-components/call/call-content/call-top-view.mdx';
import CallControls from '../../common-content/ui-components/call/call-content/call-controls.mdx';
import ParticipantsInfoBadge from '../../common-content/ui-components/call/call-content/participants-info-badge.mdx';
import Landscape from '../../common-content/ui-components/call/call-content/landscape.mdx';
import OnBackPressed from '../../common-content/ui-components/call/call-content/on-back-pressed.mdx';
import OnParticipantInfoPress from '../../common-content/ui-components/call/call-content/on-participant-info-press.mdx';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ id: call-top-view
title: CallTopView
---

import ParticipantsInfoBadge from '../../common-content/ui-components/call/call-content/participants-info-badge.mdx';
import OnBackPressed from '../../common-content/ui-components/call/call-content/on-back-pressed.mdx';
import OnParticipantInfoPress from '../../common-content/ui-components/call/call-content/on-participant-info-press.mdx';

Expand Down Expand Up @@ -60,10 +59,6 @@ Style to override the container of the `CallTopView`.
| ---------------------------------------------------------- |
| [ViewStyle](https://reactnative.dev/docs/view-style-props) |

### `ParticipantsInfoBadge`

<ParticipantsInfoBadge />

## Customization

You can create your own custom `CallTopView` using the [Call Top View UI Cookbook guide](../../../ui-cookbook/replacing-call-top-view/).
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const FeedbackModal: = () => {
<TouchableOpacity onPress={onClose} style={[styles.closeButton]}>
<IconWrapper>
<Close
color={colors.typeSecondary}
color={colors.iconPrimary}
size={variants.roundButtonSizes.sm}
/>
</IconWrapper>
Expand All @@ -93,8 +93,8 @@ const FeedbackModal: = () => {
<Star
color={
selectedRating && selectedRating >= rating
? colors.iconAlertSuccess
: colors.typeSecondary
? colors.iconSuccess
: colors.iconPrimary
}
/>
</TouchableOpacity>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState, useMemo } from 'react';
import { StyleSheet, View, ViewStyle } from 'react-native';
import InCallManager from 'react-native-incall-manager';

import {
CallTopView as DefaultCallTopView,
CallTopViewProps,
} from '../CallTopView';
import {
CallParticipantsGrid,
CallParticipantsGridProps,
Expand Down Expand Up @@ -45,10 +40,6 @@ export type StreamReactionType = StreamReaction & {

type CallContentComponentProps = ParticipantViewComponentProps &
Pick<CallParticipantsListComponentProps, 'ParticipantView'> & {
/**
* Component to customize the CallTopView component.
*/
CallTopView?: React.ComponentType<CallTopViewProps> | null;
/**
* Component to customize the CallControls component.
*/
Expand All @@ -71,10 +62,6 @@ export type CallContentProps = Pick<
HangUpCallButtonProps,
'onHangupCallHandler'
> &
Pick<
CallTopViewProps,
'onBackPressed' | 'onParticipantInfoPress' | 'ParticipantsInfoBadge'
> &
CallContentComponentProps & {
/**
* This switches the participant's layout between the grid and the spotlight mode.
Expand All @@ -100,11 +87,8 @@ export type CallContentProps = Pick<
};

export const CallContent = ({
onBackPressed,
onParticipantInfoPress,
onHangupCallHandler,
CallParticipantsList,
CallTopView = DefaultCallTopView,
CallControls = DefaultCallControls,
FloatingParticipantView = DefaultFloatingParticipantView,
ScreenShareOverlay = DefaultScreenShareOverlay,
Expand All @@ -113,7 +97,6 @@ export const CallContent = ({
ParticipantReaction,
ParticipantVideoFallback,
ParticipantView,
ParticipantsInfoBadge,
VideoRenderer,
layout = 'grid',
landscape = false,
Expand All @@ -125,6 +108,7 @@ export const CallContent = ({
showRemoteParticipantInFloatingView,
setShowRemoteParticipantInFloatingView,
] = useState<boolean>(false);
const styles = useStyles();
const {
theme: { callContent },
} = useTheme();
Expand Down Expand Up @@ -213,20 +197,13 @@ export const CallContent = ({
/>
)}
<View style={[styles.container, landscapeStyles, callContent.container]}>
<View style={[styles.container, callContent.callParticipantsContainer]}>
<View style={[styles.content, callContent.callParticipantsContainer]}>
<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}
onParticipantInfoPress={onParticipantInfoPress}
ParticipantsInfoBadge={ParticipantsInfoBadge}
/>
)}
{showFloatingView && FloatingParticipantView && (
<FloatingParticipantView
participant={
Expand Down Expand Up @@ -258,10 +235,25 @@ export const CallContent = ({
);
};

const styles = StyleSheet.create({
container: { flex: 1 },
view: {
...StyleSheet.absoluteFillObject,
zIndex: Z_INDEX.IN_FRONT,
},
});
const useStyles = () => {
const { theme } = useTheme();
return useMemo(
() =>
StyleSheet.create({
container: {
flex: 1,
paddingBottom: theme.variants.insets.bottom,
paddingLeft: theme.variants.insets.left,
paddingRight: theme.variants.insets.right,
paddingTop: theme.variants.insets.top,
backgroundColor: theme.colors.sheetPrimary,
},
content: { flex: 1 },
view: {
...StyleSheet.absoluteFillObject,
zIndex: Z_INDEX.IN_FRONT,
},
}),
[theme]
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCall } from '@stream-io/video-react-bindings';
import { getLogger } from '@stream-io/video-client';
import React from 'react';
import { CallControlsButton } from './CallControlsButton';
import { Phone } from '../../../icons';
import { IconWrapper, Phone } from '../../../icons';
import { useTheme } from '../../../contexts/ThemeContext';

/**
Expand Down Expand Up @@ -34,7 +34,7 @@ export const AcceptCallButton = ({
const {
theme: {
colors,
variants: { buttonSizes },
variants: { buttonSizes, iconSizes },
acceptCallButton,
},
} = useTheme();
Expand All @@ -57,11 +57,13 @@ export const AcceptCallButton = ({
return (
<CallControlsButton
onPress={acceptCallHandler}
color={colors.info}
size={buttonSizes.lg}
color={colors.buttonSuccess}
size={buttonSizes.md}
style={acceptCallButton}
>
<Phone color={colors.static_white} />
<IconWrapper>
<Phone color={colors.iconPrimary} size={iconSizes.lg} />
</IconWrapper>
</CallControlsButton>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const CallControls = ({
<View
style={[
styles.container,
{ backgroundColor: colors.static_grey },
{ backgroundColor: colors.sheetPrimary },
callControls.container,
landscapeStyles,
style,
Expand All @@ -49,7 +49,7 @@ export const CallControls = ({
<ToggleVideoPublishingButton />
<ToggleAudioPublishingButton />
<ToggleCameraFaceButton />
<HangUpCallButton onHangupCallHandler={onHangupCallHandler} />
<HangUpCallButton onPressHandler={onHangupCallHandler} />
</View>
);
};
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 @@ -57,8 +62,9 @@ export const CallControlsButton = (

const {
theme: {
variants: { buttonSizes },
colors,
defaults,
variants: { roundButtonSizes },
callControlsButton: { container },
},
} = useTheme();
Expand All @@ -67,18 +73,18 @@ export const CallControlsButton = (
styles.container,
{
backgroundColor: disabled
? colors.disabled
: colorProp || colors.static_white,
? disabledColorProp || colors.buttonDisabled
: colorProp || colors.buttonSecondary,
opacity: pressed ? 0.2 : 1,
height: size || buttonSizes.sm,
width: size || buttonSizes.sm,
borderRadius: (size || buttonSizes.sm) / 2,
borderColor: colors.content_bg,
height: size || roundButtonSizes.lg,
width: size || roundButtonSizes.lg,
borderRadius: defaults.borderRadius,
},
styleProp?.container ?? null,
container,
];

const childrenSize = (size || roundButtonSizes.lg) / 2 - 5;
return (
<Pressable
disabled={disabled}
Expand All @@ -89,10 +95,7 @@ export const CallControlsButton = (
>
<View
style={[
{
height: (size || buttonSizes.sm) / 2 - 5,
width: (size || buttonSizes.sm) / 2 - 5,
},
{ height: childrenSize, width: childrenSize },
styleProp?.svgContainer ?? null,
]}
>
Expand All @@ -105,16 +108,7 @@ export const CallControlsButton = (
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
borderWidth: 1,
alignItems: 'center',
// For iOS
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 8,

// For android
elevation: 6,
Expand Down
Loading
Loading