Skip to content

Commit 5fe5ac7

Browse files
author
Kubit
committed
Add new useScrollEffect to Drawer component
1 parent 44d3d50 commit 5fe5ac7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/drawer/drawerControlled.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { DrawerStandAlone } from './drawerStandAlone';
1111
import { DrawerVariantStylesType, IDrawerControlled, IDrawerStandAlone } from './types';
1212

1313
/* Constants for useScrollEffect */
14-
const CONDITION = true;
1514
const SCROLL_DISTANCE = 5;
1615
/* Constants for useZoomEffect (footer) */
1716
const FOOTER_EDIT_STYLES: CssProperty[] = [
@@ -34,11 +33,10 @@ const DrawerControlledComponent = React.forwardRef(
3433
const device = useMediaDevice();
3534
const stylesByDevice = styles[device];
3635

37-
const { scrollableRef, shadowRef } = useScrollEffect(
38-
CONDITION,
39-
stylesByDevice.titleContainer?.box_shadow,
40-
SCROLL_DISTANCE
41-
);
36+
const { scrollableRef, shadowRef } = useScrollEffect({
37+
shadowStyles: stylesByDevice.titleContainer?.box_shadow,
38+
shadowVisible: SCROLL_DISTANCE,
39+
});
4240

4341
const footerRef = useZoomEffect(FOOTER_EDIT_STYLES, MAX_ZOOM);
4442

0 commit comments

Comments
 (0)