Skip to content

Commit

Permalink
DTRA / Kate / Refactoring: resetting style (binary-com#154)
Browse files Browse the repository at this point in the history
* refactor: trading and contract details

* fix: reset button style in definition
  • Loading branch information
kate-deriv committed Jul 19, 2024
1 parent b8bc11f commit a641233
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/trader/src/AppV2/Components/Guide/guide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@

&__content {
&--definition {
all: unset;
color: var(--core-color-solid-coral-700);
}
&--bold {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
&__title {
display: flex;
gap: var(--semantic-spacing-gap-md);

button {
all: unset;
}
}

.deal-cancellation-badge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('TradeTypeTabs', () => {

it('should render correct tabs name for Vanillas', () => {
default_mock_store.modules.trade.contract_type = TRADE_TYPES.VANILLA.CALL;
default_mock_store.modules.trade.is_vanilla = true;
render(mockTradeTypeTabs({ is_minimized: true }));

expect(screen.getByText('Call')).toBeInTheDocument();
Expand All @@ -45,6 +46,7 @@ describe('TradeTypeTabs', () => {

it('should call onChange function if user clicks on another tab and not call it if he clicks on the already chosen one', () => {
default_mock_store.modules.trade.contract_type = TRADE_TYPES.TURBOS.LONG;
default_mock_store.modules.trade.is_turbos = true;
render(mockTradeTypeTabs());

const current_tab = screen.getByText('Up');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import { observer } from 'mobx-react';
import clsx from 'clsx';
import { SegmentedControlSingleChoice } from '@deriv-com/quill-ui';
import { useTraderStore } from 'Stores/useTraderStores';
import { isTurbosContract, isVanillaContract, TRADE_TYPES } from '@deriv/shared';
import { TRADE_TYPES } from '@deriv/shared';

type TTradeTypeTabsProps = {
is_minimized?: boolean;
};

const TradeTypeTabs = observer(({ is_minimized }: TTradeTypeTabsProps) => {
const { contract_type, onChange } = useTraderStore();
const is_turbos = isTurbosContract(contract_type);
const is_vanilla = isVanillaContract(contract_type);
const { contract_type, is_turbos, is_vanilla, onChange } = useTraderStore();
const tab_list = [
{ label: 'Up', value: TRADE_TYPES.TURBOS.LONG, is_displayed: is_turbos },
{ label: 'Down', value: TRADE_TYPES.TURBOS.SHORT, is_displayed: is_turbos },
Expand Down
4 changes: 4 additions & 0 deletions packages/trader/src/AppV2/Containers/Trade/trade.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
min-height: var(--core-spacing-1600);
white-space: nowrap;
scrollbar-width: none;

button {
background-color: transparent;
}
}
&__assets {
padding: 0 var(--core-spacing-800);
Expand Down

0 comments on commit a641233

Please sign in to comment.