@npm_leadtech/legal-lib-components 5.17.0 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useRef, useState } from 'react';
4
4
  import { useSwipeable } from 'react-swipeable';
5
5
  import { BottomOverlayStyled } from './BottomOverlay.styled';
6
- const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer }) => {
6
+ const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer, enableDisableScroll = true }) => {
7
7
  const [scrollingDown, setScrollingDown] = useState(false);
8
8
  const scrollingShadow = scrollingDown ? 'overlay__delimiter__scrolling' : '';
9
9
  const overlayBackground = useRef(null);
@@ -19,7 +19,7 @@ const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer
19
19
  }
20
20
  }, [open]);
21
21
  const handleBodyScroll = (disableScroll) => {
22
- if (disableScroll) {
22
+ if (enableDisableScroll && disableScroll) {
23
23
  document.body.style.overflow = 'hidden';
24
24
  document.body.style.position = 'fixed';
25
25
  }
@@ -5,7 +5,15 @@ import { useSwipeable } from 'react-swipeable'
5
5
  import { type BottomOverlayProps } from './BottomOverlayProps.types'
6
6
  import { BottomOverlayStyled } from './BottomOverlay.styled'
7
7
 
8
- const BottomOverlay: FC<BottomOverlayProps> = ({ givenClass, header, body, open = false, onClose, footer }) => {
8
+ const BottomOverlay: FC<BottomOverlayProps> = ({
9
+ givenClass,
10
+ header,
11
+ body,
12
+ open = false,
13
+ onClose,
14
+ footer,
15
+ enableDisableScroll = true
16
+ }) => {
9
17
  const [scrollingDown, setScrollingDown] = useState<boolean>(false)
10
18
  const scrollingShadow = scrollingDown ? 'overlay__delimiter__scrolling' : ''
11
19
  const overlayBackground = useRef<HTMLDivElement | null>(null)
@@ -23,7 +31,7 @@ const BottomOverlay: FC<BottomOverlayProps> = ({ givenClass, header, body, open
23
31
  }, [open])
24
32
 
25
33
  const handleBodyScroll = (disableScroll: boolean): void => {
26
- if (disableScroll) {
34
+ if (enableDisableScroll && disableScroll) {
27
35
  document.body.style.overflow = 'hidden'
28
36
  document.body.style.position = 'fixed'
29
37
  } else {
@@ -5,4 +5,5 @@ export interface BottomOverlayProps {
5
5
  footer?: React.ReactNode;
6
6
  open?: boolean;
7
7
  onClose?: () => void;
8
+ enableDisableScroll?: boolean;
8
9
  }
@@ -6,4 +6,5 @@ export interface BottomOverlayProps {
6
6
  footer?: React.ReactNode
7
7
  open?: boolean
8
8
  onClose?: () => void
9
+ enableDisableScroll?: boolean
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.17.0",
3
+ "version": "5.18.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",