cosmetic changes for calling buttons

pull/1969/head
Audric Ackermann 4 years ago
parent ce79ce1f8b
commit 3a864b16ca
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -54,7 +54,7 @@ export const InConvoCallWindow = styled.div`
display: flex; display: flex;
height: 50%; height: 50%;
background: radial-gradient(black, #505050); background-color: hsl(0, 0%, 15.7%);
flex-shrink: 0; flex-shrink: 0;
min-height: 200px; min-height: 200px;
@ -65,10 +65,11 @@ const InConvoCallWindowControls = styled.div`
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
width: fit-content; width: 100%;
height: 100%;
align-items: flex-end;
padding: 10px; padding: 10px;
border-radius: 10px; border-radius: 10px;
height: 60px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
left: 0; left: 0;
@ -77,7 +78,6 @@ const InConvoCallWindowControls = styled.div`
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
opacity: 0; opacity: 0;
&:hover { &:hover {
@ -182,8 +182,10 @@ export const DraggableCallContainer = () => {
const VideoInputMenu = ({ const VideoInputMenu = ({
triggerId, triggerId,
camerasList, camerasList,
onUnmute,
}: { }: {
triggerId: string; triggerId: string;
onUnmute: () => void;
camerasList: Array<InputItem>; camerasList: Array<InputItem>;
}) => { }) => {
return ( return (
@ -193,6 +195,7 @@ const VideoInputMenu = ({
<Item <Item
key={m.deviceId} key={m.deviceId}
onClick={() => { onClick={() => {
onUnmute();
void CallManager.selectCameraByDeviceId(m.deviceId); void CallManager.selectCameraByDeviceId(m.deviceId);
}} }}
> >
@ -207,9 +210,11 @@ const VideoInputMenu = ({
const AudioInputMenu = ({ const AudioInputMenu = ({
triggerId, triggerId,
audioInputsList, audioInputsList,
onUnmute,
}: { }: {
triggerId: string; triggerId: string;
audioInputsList: Array<InputItem>; audioInputsList: Array<InputItem>;
onUnmute: () => void;
}) => { }) => {
return ( return (
<Menu id={triggerId} animation={animation.fade}> <Menu id={triggerId} animation={animation.fade}>
@ -218,6 +223,7 @@ const AudioInputMenu = ({
<Item <Item
key={m.deviceId} key={m.deviceId}
onClick={() => { onClick={() => {
onUnmute();
void CallManager.selectAudioInputByDeviceId(m.deviceId); void CallManager.selectAudioInputByDeviceId(m.deviceId);
}} }}
> >
@ -357,10 +363,11 @@ export const InConversationCallContainer = () => {
iconSize={60} iconSize={60}
iconPadding="20px" iconPadding="20px"
iconType="hangup" iconType="hangup"
backgroundColor="var(--color-cell-background)" backgroundColor="white"
borderRadius="50%" borderRadius="50%"
onClick={handleEndCall} onClick={handleEndCall}
iconColor="red" iconColor="red"
margin="10px"
/> />
<DropDownAndToggleButton <DropDownAndToggleButton
iconType="camera" iconType="camera"
@ -375,8 +382,16 @@ export const InConversationCallContainer = () => {
onArrowClick={showAudioInputMenu} onArrowClick={showAudioInputMenu}
/> />
</InConvoCallWindowControls> </InConvoCallWindowControls>
<VideoInputMenu triggerId={videoTriggerId} camerasList={currentConnectedCameras} /> <VideoInputMenu
<AudioInputMenu triggerId={audioTriggerId} audioInputsList={currentConnectedAudioInputs} /> triggerId={videoTriggerId}
onUnmute={() => setVideoMuted(false)}
camerasList={currentConnectedCameras}
/>
<AudioInputMenu
triggerId={audioTriggerId}
onUnmute={() => setAudioMuted(false)}
audioInputsList={currentConnectedAudioInputs}
/>
</RelativeCallWindow> </RelativeCallWindow>
</InConvoCallWindow> </InConvoCallWindow>
); );

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import _ from 'lodash'; import _ from 'lodash';
import styled from 'styled-components'; import styled from 'styled-components';
import { contextMenu } from 'react-contexify';
type SProps = { type SProps = {
onArrowClick: (e: React.MouseEvent<HTMLDivElement>) => void; onArrowClick: (e: React.MouseEvent<HTMLDivElement>) => void;
@ -10,11 +11,10 @@ type SProps = {
iconType: 'microphone' | 'camera'; iconType: 'microphone' | 'camera';
}; };
const StyledRoundedButton = styled.div` const StyledRoundedButton = styled.div<{ isMuted: boolean }>`
background-color: var(--color-cell-background); background-color: ${props => (props.isMuted ? 'black' : 'white')};
color: var(--color-text); color: ${props => (props.isMuted ? 'white' : 'black')};
border-radius: 50%; border-radius: 50%;
box-shadow: var(--color-session-shadow);
cursor: pointer; cursor: pointer;
transition-duration: 0.25s; transition-duration: 0.25s;
@ -44,6 +44,7 @@ const StyledArrowIcon = styled(StyledRoundedButton)`
position: relative; position: relative;
top: -35%; top: -35%;
right: -65%; right: -65%;
box-shadow: 0 0 4px 0 #b4b4b4;
`; `;
const CameraIcon = ( const CameraIcon = (
@ -67,16 +68,17 @@ export const DropDownAndToggleButton = (props: SProps) => {
const mainButtonClickHandler = (e: React.MouseEvent<HTMLDivElement>) => { const mainButtonClickHandler = (e: React.MouseEvent<HTMLDivElement>) => {
e.stopPropagation(); e.stopPropagation();
contextMenu.hideAll();
onMainButtonClick(e); onMainButtonClick(e);
}; };
const iconToRender = const iconToRender =
iconType === 'microphone' ? MicrophoneIcon : iconType === 'camera' ? CameraIcon : null; iconType === 'microphone' ? MicrophoneIcon : iconType === 'camera' ? CameraIcon : null;
return ( return (
<StyledContainer> <StyledContainer isMuted={isMuted || false}>
<StyledMainIcon onClick={mainButtonClickHandler}>{iconToRender}</StyledMainIcon> <StyledMainIcon onClick={mainButtonClickHandler}>{iconToRender}</StyledMainIcon>
{!hidePopoverArrow && ( {!hidePopoverArrow && (
<StyledArrowIcon onClick={arrowClickHandler}> <StyledArrowIcon isMuted={false} onClick={arrowClickHandler}>
<svg viewBox="-200 -200 640 640" fill="currentColor"> <svg viewBox="-200 -200 640 640" fill="currentColor">
<path d="M127.5 191.25L255 63.75L0 63.75L127.5 191.25Z" /> <path d="M127.5 191.25L255 63.75L0 63.75L127.5 191.25Z" />
</svg> </svg>

@ -9,6 +9,7 @@ interface SProps extends SessionIconProps {
notificationCount?: number; notificationCount?: number;
isSelected?: boolean; isSelected?: boolean;
isHidden?: boolean; isHidden?: boolean;
margin?: string;
} }
const SessionIconButtonInner = (props: SProps) => { const SessionIconButtonInner = (props: SProps) => {
@ -26,6 +27,7 @@ const SessionIconButtonInner = (props: SProps) => {
backgroundColor, backgroundColor,
borderRadius, borderRadius,
iconPadding, iconPadding,
margin,
} = props; } = props;
const clickHandler = (e: React.MouseEvent<HTMLDivElement>) => { const clickHandler = (e: React.MouseEvent<HTMLDivElement>) => {
if (props.onClick) { if (props.onClick) {
@ -39,7 +41,7 @@ const SessionIconButtonInner = (props: SProps) => {
className={classNames('session-icon-button', iconSize, isSelected ? 'no-opacity' : '')} className={classNames('session-icon-button', iconSize, isSelected ? 'no-opacity' : '')}
role="button" role="button"
onClick={clickHandler} onClick={clickHandler}
style={{ display: isHidden ? 'none' : 'flex' }} style={{ display: isHidden ? 'none' : 'flex', margin: margin ? margin : '' }}
> >
<SessionIcon <SessionIcon
iconType={iconType} iconType={iconType}

Loading…
Cancel
Save