Skip to content

Commit

Permalink
DTRA-1707 / Kate / [DTrader-V2]: Fix UX issue for Turbos,Vanillas,Hig…
Browse files Browse the repository at this point in the history
…her/Lower and Touch/No Touch trade type (#16747)

* fix: layout jumps

* chore: smooth animation

* refactor: remove animatin for minimized trade params

* refactor: update quill with the latest changes

* fix: test case
  • Loading branch information
kate-deriv committed Sep 9, 2024
1 parent 6067f72 commit e9e92bc
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 46 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@deriv-com/utils": "^0.0.25",
"@deriv-com/ui": "1.32.0",
"@deriv/api": "^1.0.0",
"@deriv-com/quill-ui": "1.16.5",
"@deriv-com/quill-ui": "1.16.9",
"@deriv/components": "^1.0.0",
"@deriv/hooks": "^1.0.0",
"@deriv/integration": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@datadog/browser-rum": "^5.11.0",
"@deriv-com/analytics": "1.14.0",
"@deriv-com/quill-tokens": "^2.0.4",
"@deriv-com/quill-ui": "1.16.5",
"@deriv-com/quill-ui": "1.16.9",
"@deriv-com/translations": "1.3.5",
"@deriv-com/ui": "1.32.0",
"@deriv-com/utils": "^0.0.25",
Expand Down
2 changes: 1 addition & 1 deletion packages/trader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"dependencies": {
"@deriv-com/analytics": "1.14.0",
"@deriv-com/quill-tokens": "^2.0.4",
"@deriv-com/quill-ui": "1.16.5",
"@deriv-com/quill-ui": "1.16.9",
"@deriv-com/utils": "^0.0.25",
"@deriv-com/ui": "1.32.0",
"@deriv/api-types": "1.0.172",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
align-items: center;
padding: 0 var(--core-spacing-400) var(--core-spacing-400);
gap: var(--core-spacing-400);
position: sticky;
position: fixed;
width: 100%;
z-index: 2; // chart has z-index: 1, it should not push purchase buttons down
bottom: 0;
bottom: var(--core-spacing-2800);

&.slide {
&-enter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ describe('TradeParametersContainer', () => {
expect(screen.getByText(children)).toBeInTheDocument();
});

it('should render only children if is_minimized is true', () => {
render(<TradeParametersContainer is_minimized>{mock_children}</TradeParametersContainer>);
it('should render only children if is_minimized and is_minimized_visible is true', () => {
render(
<TradeParametersContainer is_minimized is_minimized_visible>
{mock_children}
</TradeParametersContainer>
);

expect(screen.queryByText('Set your trade')).not.toBeInTheDocument();
expect(screen.queryByText('Guide')).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Localize } from '@deriv/translations';
import { CSSTransition } from 'react-transition-group';
import { Text } from '@deriv-com/quill-ui';
import Guide from '../Guide';

Expand All @@ -14,22 +13,8 @@ const TradeParametersContainer = ({
is_minimized,
is_minimized_visible,
}: React.PropsWithChildren<TTradeParametersContainer>) =>
is_minimized ? (
<div className='trade-params--minimized'>
<CSSTransition
in={is_minimized_visible}
timeout={0}
classNames={{
appear: 'trade-params__options__wrapper--minimized--enter',
enter: 'trade-params__options__wrapper--minimized--enter',
enterDone: 'trade-params__options__wrapper--minimized--enter-done',
exit: 'trade-params__options__wrapper--minimized--exit',
}}
unmountOnExit
>
{children}
</CSSTransition>
</div>
is_minimized && is_minimized_visible ? (
<div className='trade-params--minimized'>{children}</div>
) : (
<section className='trade-params'>
<div className='trade-params__title'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,9 @@
}

&--minimized {
max-height: 0px;
padding: 0px;
transition: transform 0.5s, opacity 0.5s, max-height 0.5s, padding 0.1s;
max-height: 104px;
padding: var(--core-spacing-400) var(--core-spacing-400) var(--core-spacing-400) var(--core-spacing-400);

&--enter,
&--exit {
opacity: 0;
transform: translateY(100%);
max-height: 0px;
padding: 0px;
}
&--enter-done {
opacity: 1;
transform: translateY(0);
max-height: 104px;
padding: var(--core-spacing-400) var(--core-spacing-400) var(--core-spacing-400)
var(--core-spacing-400);
}
.quill-input__container {
width: unset;
}
Expand Down
6 changes: 5 additions & 1 deletion packages/trader/src/AppV2/Containers/Trade/trade.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
}
}
&__parameter {
display: inline;
min-height: 13.6rem;

&:has(.trade-params__options__wrapper--horizontal:not(:only-child)) {
min-height: 16.8rem;
}
}
}

0 comments on commit e9e92bc

Please sign in to comment.