Skip to content

Commit e884f8c

Browse files
committed
fix(suite): Fix banners when page changed
1 parent 8f8e119 commit e884f8c

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

packages/components/src/components/Tooltip/TooltipDelay.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ export const TOOLTIP_DELAY_NONE = 0;
22
export const TOOLTIP_DELAY_SHORT = 200;
33
export const TOOLTIP_DELAY_NORMAL = 500;
44
export const TOOLTIP_DELAY_LONG = 1000;
5+
export const TOOLTIP_DELAY_EXTRA_LONG = 3000;
56

67
export type TooltipDelay =
78
| typeof TOOLTIP_DELAY_NONE
89
| typeof TOOLTIP_DELAY_SHORT
910
| typeof TOOLTIP_DELAY_NORMAL
10-
| typeof TOOLTIP_DELAY_LONG;
11+
| typeof TOOLTIP_DELAY_LONG
12+
| typeof TOOLTIP_DELAY_EXTRA_LONG;

packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
selectIsDeviceBackupUnfinished,
1010
selectSelectedDevice,
1111
} from '@suite-common/wallet-core';
12-
import { Column, TOOLTIP_DELAY_LONG, Tooltip, motionEasing } from '@trezor/components';
12+
import { Column, TOOLTIP_DELAY_EXTRA_LONG, Text, Tooltip, motionEasing } from '@trezor/components';
1313
import { isWeb } from '@trezor/env-utils';
1414
import { spacingsPx } from '@trezor/theme';
1515

@@ -31,10 +31,10 @@ import { NoBackup } from './NoBackupBanner';
3131
import { NoConnectionBanner } from './NoConnectionBanner';
3232
import { SafetyChecksBanner } from './SafetyChecksBanner';
3333

34-
const Container = styled.div<{ $fill?: boolean; $cursor?: string }>`
34+
const Container = styled.div<{ $fill?: boolean; $cursor?: string; $hasPadding?: boolean }>`
3535
width: 100%;
3636
max-width: ${({ $fill }) => ($fill ? 'none' : MAX_CONTENT_WIDTH)};
37-
padding: ${spacingsPx.sm} ${spacingsPx.md};
37+
padding: ${({ $hasPadding }) => ($hasPadding ? `${spacingsPx.sm} ${spacingsPx.md}` : 0)};
3838
position: relative; /* because it must be on the top of the draggable area on Mac */
3939
cursor: ${({ $cursor }) => $cursor || 'unset'};
4040
`;
@@ -55,7 +55,7 @@ const BannerWrapper = ({ scale, children, isExpanded, index }: BannerWrapperProp
5555

5656
return (
5757
<BannerWrapperContainer
58-
initial={{ height: 1 }}
58+
initial={false}
5959
transition={{
6060
duration: 0.4,
6161
ease: motionEasing.transition,
@@ -178,17 +178,21 @@ export const SuiteBanners = ({ isOnboarding, fill }: SuiteBannersProps) => {
178178
$cursor={hasMultipleItems ? 'pointer' : 'unset'}
179179
$fill={fill}
180180
onClick={() => setIsExpanded(!isExpanded)}
181+
$hasPadding
181182
>
182183
<Tooltip
183184
isFullWidth
185+
placement="right"
184186
content={
185-
isExpanded
186-
? 'Click to collapse notifications'
187-
: 'Click to show all notifications'
187+
<Text typographyStyle="label">
188+
{isExpanded
189+
? 'Click to collapse notifications'
190+
: 'Click to show all notifications'}
191+
</Text>
188192
}
189193
hasArrow
190194
isActive={hasMultipleItems}
191-
delayShow={TOOLTIP_DELAY_LONG}
195+
delayShow={TOOLTIP_DELAY_EXTRA_LONG}
192196
>
193197
<Column gap={8} width="100%">
194198
<AnimatePresence>

0 commit comments

Comments
 (0)