Skip to content

Commit 12214a8

Browse files
authored
fix(Drawer): header styles (#2242)
1 parent c01b536 commit 12214a8

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

src/components/Drawer/Drawer.scss

+19
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,23 @@
1616
&__controls {
1717
margin-left: auto;
1818
}
19+
20+
&__header-wrapper {
21+
position: sticky;
22+
z-index: 3;
23+
top: 0;
24+
left: 0;
25+
26+
padding: var(--g-spacing-4) var(--g-spacing-4) 0 var(--g-spacing-6);
27+
28+
background-color: var(--g-color-base-background);
29+
}
30+
31+
&__content-wrapper {
32+
display: flex;
33+
overflow: auto;
34+
flex-direction: column;
35+
36+
height: 100%;
37+
}
1938
}

src/components/Drawer/Drawer.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
import {Xmark} from '@gravity-ui/icons';
44
import {DrawerItem, Drawer as GravityDrawer} from '@gravity-ui/navigation';
5-
import {ActionTooltip, Button, Flex, Icon} from '@gravity-ui/uikit';
5+
import {ActionTooltip, Button, Flex, Icon, Text} from '@gravity-ui/uikit';
66

77
import {cn} from '../../utils/cn';
88
import {isNumeric} from '../../utils/utils';
@@ -184,8 +184,8 @@ export const DrawerWrapper = ({
184184
}
185185

186186
return (
187-
<Flex justifyContent="space-between" className={headerClassName}>
188-
{title}
187+
<Flex justifyContent="space-between" className={b('header-wrapper', headerClassName)}>
188+
<Text variant="subheader-2">{title}</Text>
189189
<Flex className={b('controls')}>{controls}</Flex>
190190
</Flex>
191191
);
@@ -205,8 +205,10 @@ export const DrawerWrapper = ({
205205
detectClickOutside={detectClickOutside}
206206
isPercentageWidth={isPercentageWidth}
207207
>
208-
{renderDrawerHeader()}
209-
{renderDrawerContent()}
208+
<div className={b('content-wrapper')}>
209+
{renderDrawerHeader()}
210+
{renderDrawerContent()}
211+
</div>
210212
</DrawerPaneContentWrapper>
211213
</React.Fragment>
212214
);

0 commit comments

Comments
 (0)