Skip to content

Commit

Permalink
fix(calls): hide keypad when receive call
Browse files Browse the repository at this point in the history
  • Loading branch information
enkhtuvshinD committed May 10, 2024
1 parent 686a730 commit cf839fe
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/plugin-calls-ui/src/components/Widget.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { SIP_STATUS_DISCONNECTED, SIP_STATUS_ERROR } from "../lib/enums";
import { callPropType, sipPropType } from "../lib/types";
import { SIP_STATUS_DISCONNECTED, SIP_STATUS_ERROR } from '../lib/enums';
import { callPropType, sipPropType } from '../lib/types';

import Icon from "@erxes/ui/src/components/Icon";
import Popover from "@erxes/ui/src/components/Popover";
import React from "react";
import WidgetPopover from "./WidgetPopover";
import { WidgetWrapper } from "../styles";
import { __ } from "@erxes/ui/src/utils";
import Icon from '@erxes/ui/src/components/Icon';
import Popover from '@erxes/ui/src/components/Popover';
import React from 'react';
import WidgetPopover from './WidgetPopover';
import { WidgetWrapper } from '../styles';
import { __ } from '@erxes/ui/src/utils';

type Props = {
callUserIntegrations: any;
Expand All @@ -20,12 +20,14 @@ const Widget = (props: Props, context) => {
!Sip.call ||
Sip.sip?.status === SIP_STATUS_ERROR ||
Sip.sip?.status === SIP_STATUS_DISCONNECTED;

if (context?.call?.direction === 'callDirection/INCOMING') {
return;
}
return (
<Popover
trigger={
<WidgetWrapper $isConnected={isConnected}>
<Icon icon={isConnected ? "phone-slash" : "phone"} size={23} />
<Icon icon={isConnected ? 'phone-slash' : 'phone'} size={23} />
</WidgetWrapper>
}
placement="top"
Expand Down

0 comments on commit cf839fe

Please sign in to comment.