Skip to content

Commit

Permalink
Hamza/90782/useless tooltip deal cancellation (binary-com#7958)
Browse files Browse the repository at this point in the history
* fix: deal cancellation tooltip removed the checkbox

* fix: Merge conflicts resolved
  • Loading branch information
hamza-deriv authored and nijil-deriv committed May 24, 2023
1 parent 76db23e commit 06b30b8
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { isDesktop, isMobile } from '@deriv/shared';
import ContractCardDialog from './contract-card-dialog';
import ContractUpdateForm from './contract-update-form';
import PopoverMessageCheckbox from '../../popover-message-checkbox';
import Icon from '../../icon';
import DesktopWrapper from '../../desktop-wrapper';
import MobileDialog from '../../mobile-dialog';
Expand Down Expand Up @@ -53,7 +52,7 @@ const ToggleCardDialog = ({
const [is_visible, setIsVisible] = React.useState(false);
const [top, setTop] = React.useState(0);
const [left, setLeft] = React.useState(0);
const [is_do_not_show_selected, setIsDoNotShowSelected] = React.useState(!should_show_cancellation_warning);
const is_do_not_show_selected = !should_show_cancellation_warning;

const toggle_ref = React.useRef<HTMLDivElement>(null);
const dialog_ref = React.useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -95,10 +94,6 @@ const ToggleCardDialog = ({
}
};

const onPopoverCheckboxChange = () => {
setIsDoNotShowSelected(!is_do_not_show_selected);
};

const toggleDialog = (e: React.MouseEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
Expand Down Expand Up @@ -134,15 +129,7 @@ const ToggleCardDialog = ({
is_bubble_hover_enabled
margin={2}
zIndex='2'
message={
<PopoverMessageCheckbox
defaultChecked={is_do_not_show_selected}
checkboxLabel={getCardLabels().DONT_SHOW_THIS_AGAIN}
message={getCardLabels().TAKE_PROFIT_LOSS_NOT_AVAILABLE}
name='should_show_cancellation_warning'
onChange={onPopoverCheckboxChange}
/>
}
message={getCardLabels().TAKE_PROFIT_LOSS_NOT_AVAILABLE}
onBubbleClose={onPopoverClose}
>
<div className='dc-contract-card-dialog-toggle__wrapper'>{edit_icon}</div>
Expand Down

0 comments on commit 06b30b8

Please sign in to comment.