Skip to content

Commit 187f2e4

Browse files
authored
fix(design-v2): color consolidation and other fixes (#1556)
## Overview - consolidates the theme colors - adds support for Light/Dark theme for the dogfood app - updates the Lobby screen per design-v2 - updates iOS config so that iPad is target device as well - solves issues when the app is shown on iPad is not constrained in smaller screen size - fixes speech indicator issue to be animating only when the user is speaking - fixes participant name, network indicator and reaction position issues - updates the `FLOATING_VIDEO_VIEW_STYLE` width and height to bigger values according to new design-v2 - removes hardcoded Lobby video height const from the SDK `LOBBY_VIDEO_VIEW_HEIGHT` - fixes call recording modal and bottom drawer orientation issues ## Screenshots <kbd> <img src="https://github.com/user-attachments/assets/1872ed71-e9df-40d7-a725-a6b01d094640" alt="ios" width="200" height="440"/> </kbd> <kbd> <img src="https://github.com/user-attachments/assets/f75912fe-01be-45ba-810d-349d2eb6ef84" alt="ios" width="200" height="440" /> </kbd> <kbd> <img src="https://github.com/user-attachments/assets/69e63502-c56f-4b4d-ab95-8e707fcd72d6" alt="ios" width="200" height="440" /> </kbd> <img src="https://github.com/user-attachments/assets/9432eef3-7013-4b88-a9c3-fee172b15691" alt="ios" width="200" height="440" /> </kbd>
1 parent fe8f457 commit 187f2e4

File tree

74 files changed

+644
-665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+644
-665
lines changed

packages/react-native-sdk/src/components/Call/CallControls/AcceptCallButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export const AcceptCallButton = ({
5757
return (
5858
<CallControlsButton
5959
onPress={acceptCallHandler}
60-
color={colors.info}
60+
color={colors.iconAlertSuccess}
6161
size={buttonSizes.lg}
6262
style={acceptCallButton}
6363
>
64-
<Phone color={colors.base1} />
64+
<Phone color={colors.typePrimary} />
6565
</CallControlsButton>
6666
);
6767
};

packages/react-native-sdk/src/components/Call/CallControls/CallControls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const CallControls = ({
4040
<View
4141
style={[
4242
styles.container,
43-
{ backgroundColor: colors.base4 },
43+
{ backgroundColor: colors.sheetPrimary },
4444
callControls.container,
4545
landscapeStyles,
4646
style,

packages/react-native-sdk/src/components/Call/CallControls/CallControlsButton.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,7 @@ export const CallControlsButton = (
108108
const styles = StyleSheet.create({
109109
container: {
110110
justifyContent: 'center',
111-
borderWidth: 1,
112111
alignItems: 'center',
113-
// For iOS
114-
shadowColor: '#000',
115-
shadowOffset: {
116-
width: 0,
117-
height: 2,
118-
},
119-
shadowOpacity: 0.25,
120-
shadowRadius: 8,
121112

122113
// For android
123114
elevation: 6,

packages/react-native-sdk/src/components/Call/CallControls/HangupCallButton.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,13 @@ export const HangUpCallButton = ({
6868
return (
6969
<CallControlsButton
7070
onPress={onPress}
71-
color={colors.error}
71+
color={colors.iconAlertWarning}
7272
style={hangupCallButton}
7373
size={size}
7474
testID={ButtonTestIds.HANG_UP_CALL}
7575
>
7676
<IconWrapper>
77-
<PhoneDown
78-
color={colors.iconPrimaryDefault}
79-
size={variants.iconSizes.md}
80-
/>
77+
<PhoneDown color={colors.typePrimary} size={variants.iconSizes.md} />
8178
</IconWrapper>
8279
</CallControlsButton>
8380
);
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useMemo } from 'react';
22
import { StyleSheet, View } from 'react-native';
33
import { ToggleAudioPreviewButton } from './ToggleAudioPreviewButton';
44
import { ToggleVideoPreviewButton } from './ToggleVideoPreviewButton';
@@ -11,6 +11,7 @@ export const LobbyControls = () => {
1111
const {
1212
theme: { lobbyControls },
1313
} = useTheme();
14+
const styles = useStyles();
1415
return (
1516
<View style={[styles.container, lobbyControls.container]}>
1617
<ToggleAudioPreviewButton />
@@ -19,10 +20,17 @@ export const LobbyControls = () => {
1920
);
2021
};
2122

22-
const styles = StyleSheet.create({
23-
container: {
24-
paddingVertical: 12,
25-
flexDirection: 'row',
26-
justifyContent: 'space-evenly',
27-
},
28-
});
23+
const useStyles = () => {
24+
const { theme } = useTheme();
25+
return useMemo(
26+
() =>
27+
StyleSheet.create({
28+
container: {
29+
paddingTop: theme.variants.spacingSizes.xs,
30+
flexDirection: 'row',
31+
justifyContent: 'space-evenly',
32+
},
33+
}),
34+
[theme]
35+
);
36+
};

packages/react-native-sdk/src/components/Call/CallControls/ReactionsButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
33
import { CallControlsButton } from './CallControlsButton';
44
import { OwnCapability } from '@stream-io/video-client';
55
import { ButtonTestIds } from '../../../constants/TestIds';
6-
import { Reaction } from '../../../icons';
6+
import { IconWrapper, Reaction } from '../../../icons';
77
import { ReactionsPicker } from './internal/ReactionsPicker';
88
import { LayoutChangeEvent, LayoutRectangle } from 'react-native';
99
import { useTheme } from '../../../contexts/ThemeContext';
@@ -71,7 +71,9 @@ export const ReactionsButton = ({
7171
onPress={reactionsButtonHandler}
7272
onLayout={onReactionsButtonLayout}
7373
>
74-
<Reaction color={colors.base5} />
74+
<IconWrapper>
75+
<Reaction color={colors.iconPrimaryDefault} />
76+
</IconWrapper>
7577
</CallControlsButton>
7678
</Restricted>
7779
{showReactionsPicker && (

packages/react-native-sdk/src/components/Call/CallControls/RejectCallButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const RejectCallButton = ({
6363
return (
6464
<CallControlsButton
6565
onPress={rejectCallHandler}
66-
color={colors.error}
66+
color={colors.iconAlertWarning}
6767
size={buttonSizes.lg}
6868
// TODO: check what to do about this random style prop
6969
// svgContainerStyle={theme.icon.lg}

packages/react-native-sdk/src/components/Call/CallControls/ToggleCameraFaceButton.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React from 'react';
44
import { CallControlsButton } from './CallControlsButton';
55
import { CameraSwitch, IconWrapper } from '../../../icons';
66
import { useTheme } from '../../../contexts/ThemeContext';
7+
import { ColorValue } from 'react-native';
78

89
/**
910
* Props for the Toggle Camera face button.
@@ -14,13 +15,19 @@ export type ToggleCameraFaceButtonProps = {
1415
* @returns void
1516
*/
1617
onPressHandler?: () => void;
18+
19+
/**
20+
* Background color of the button.
21+
*/
22+
backgroundColor?: ColorValue;
1723
};
1824

1925
/**
2026
* Button to toggle camera face(front/back) when in the call.
2127
*/
2228
export const ToggleCameraFaceButton = ({
2329
onPressHandler,
30+
backgroundColor,
2431
}: ToggleCameraFaceButtonProps) => {
2532
const { useCameraState, useCallSettings } = useCallStateHooks();
2633
const { camera, optimisticIsMute, direction } = useCameraState();
@@ -46,8 +53,9 @@ export const ToggleCameraFaceButton = ({
4653
return (
4754
<Restricted requiredGrants={[OwnCapability.SEND_VIDEO]}>
4855
<CallControlsButton
56+
size={variants.roundButtonSizes.md}
4957
onPress={onPress}
50-
color={colors.sheetPrimary}
58+
color={backgroundColor || colors.buttonSecondaryDefault}
5159
disabledColor={colors.sheetPrimary}
5260
disabled={optimisticIsMute}
5361
style={toggleCameraFaceButton}

packages/react-native-sdk/src/components/Call/CallControls/ToggleVideoPreviewButton.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export const ToggleVideoPreviewButton = ({
2525
theme: {
2626
colors,
2727
toggleVideoPreviewButton,
28-
variants: { buttonSizes },
29-
defaults,
28+
variants: { buttonSizes, iconSizes },
3029
},
3130
} = useTheme();
3231
const { useCameraState, useCallSettings } = useCallStateHooks();
@@ -61,12 +60,9 @@ export const ToggleVideoPreviewButton = ({
6160
>
6261
<IconWrapper>
6362
{!optimisticIsMute ? (
64-
<Video color={colors.iconPrimaryDefault} size={defaults.iconSize} />
63+
<Video color={colors.iconPrimaryDefault} size={iconSizes.lg} />
6564
) : (
66-
<VideoSlash
67-
color={colors.iconPrimaryDefault}
68-
size={defaults.iconSize}
69-
/>
65+
<VideoSlash color={colors.iconPrimaryDefault} size={iconSizes.lg} />
7066
)}
7167
</IconWrapper>
7268
</CallControlsButton>

packages/react-native-sdk/src/components/Call/CallControls/ToggleVideoPublishingButton.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const ToggleVideoPublishingButton = ({
2727
const callSettings = useCallSettings();
2828
const isVideoEnabledInCall = callSettings?.video.enabled;
2929
const {
30-
theme: { colors, defaults },
30+
theme: { colors, variants },
3131
} = useTheme();
3232
const onPress = async () => {
3333
if (onPressHandler) {
@@ -53,11 +53,14 @@ export const ToggleVideoPublishingButton = ({
5353
>
5454
<IconWrapper>
5555
{!optimisticIsMute ? (
56-
<Video color={colors.iconPrimaryDefault} size={defaults.iconSize} />
56+
<Video
57+
color={colors.iconPrimaryDefault}
58+
size={variants.iconSizes.md}
59+
/>
5760
) : (
5861
<VideoSlash
5962
color={colors.iconPrimaryDefault}
60-
size={defaults.iconSize}
63+
size={variants.iconSizes.md}
6164
/>
6265
)}
6366
</IconWrapper>

0 commit comments

Comments
 (0)