Skip to content

Commit f75cf0d

Browse files
committed
fix(suite): Fix trade heading
1 parent 8ddf478 commit f75cf0d

File tree

1 file changed

+30
-16
lines changed
  • packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader

1 file changed

+30
-16
lines changed

packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx

+30-16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import styled, { css } from 'styled-components';
22

33
import { selectSelectedDevice } from '@suite-common/wallet-core';
44
import { SelectedAccountStatus } from '@suite-common/wallet-types';
5-
import { Row, variables } from '@trezor/components';
5+
import { Row } from '@trezor/components';
66
import { hasBitcoinOnlyFirmware } from '@trezor/device-utils';
7+
import { breakpointMediaQueries } from '@trezor/styles';
78
import { EventType, analytics } from '@trezor/suite-analytics';
89
import { spacings } from '@trezor/theme';
910

@@ -19,11 +20,22 @@ const ShowOnLargeDesktopWrapper = styled.div<{ $isActive?: boolean }>`
1920
${({ $isActive }) =>
2021
$isActive &&
2122
css`
22-
${variables.SCREEN_QUERY.BELOW_DESKTOP} {
23+
${breakpointMediaQueries.below_xl} {
2324
display: none;
2425
}
2526
`}
2627
`;
28+
29+
const ShowOnDesktopWrapper = styled.div<{ $isActive?: boolean }>`
30+
${({ $isActive }) =>
31+
$isActive &&
32+
css`
33+
${breakpointMediaQueries.below_lg} {
34+
display: none;
35+
}
36+
`}
37+
`;
38+
2739
interface TradeActionsProps {
2840
selectedAccount?: SelectedAccountStatus;
2941
hideBuyAndSellBelowDesktop?: boolean;
@@ -79,20 +91,22 @@ export const TradeActions = ({
7991
</HeaderActionButton>
8092
</ShowOnLargeDesktopWrapper>
8193
{!hasBitcoinOnlyFirmware(device) && (
82-
<HeaderActionButton
83-
icon="arrowsLeftRight"
84-
onClick={() => {
85-
goToWithAnalytics('wallet-trading-exchange', {
86-
preserveParams: true,
87-
});
88-
}}
89-
data-testid="@wallet/menu/wallet-trading-exchange"
90-
variant="tertiary"
91-
size="small"
92-
isDisabled={isAccountLoading}
93-
>
94-
<Translation id="TR_TRADING_SWAP" />
95-
</HeaderActionButton>
94+
<ShowOnDesktopWrapper $isActive={hideBuyAndSellBelowDesktop}>
95+
<HeaderActionButton
96+
icon="arrowsLeftRight"
97+
onClick={() => {
98+
goToWithAnalytics('wallet-trading-exchange', {
99+
preserveParams: true,
100+
});
101+
}}
102+
data-testid="@wallet/menu/wallet-trading-exchange"
103+
variant="tertiary"
104+
size="small"
105+
isDisabled={isAccountLoading}
106+
>
107+
<Translation id="TR_TRADING_SWAP" />
108+
</HeaderActionButton>
109+
</ShowOnDesktopWrapper>
96110
)}
97111
</AppNavigationTooltip>
98112
</Row>

0 commit comments

Comments
 (0)