@npm_leadtech/legal-lib-components 5.11.12 → 5.11.13

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.
@@ -1,4 +1,5 @@
1
1
  export interface MenuItemProps {
2
+ className?: string;
2
3
  spacing?: boolean;
3
4
  hasBullets?: boolean;
4
5
  initialActiveContent?: string;
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  export interface MenuItemProps {
3
+ className?: string
3
4
  spacing?: boolean
4
5
  hasBullets?: boolean
5
6
  initialActiveContent?: string
@@ -9,6 +9,7 @@ const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer
9
9
  const overlayBackground = useRef(null);
10
10
  const overlayMessage = useRef(null);
11
11
  useEffect(() => {
12
+ handleBodyScroll(open);
12
13
  if (open) {
13
14
  const backgroundElement = overlayBackground.current;
14
15
  backgroundElement.addEventListener('mousedown', handleCloseModal);
@@ -17,6 +18,17 @@ const BottomOverlay = ({ givenClass, header, body, open = false, onClose, footer
17
18
  };
18
19
  }
19
20
  }, [open]);
21
+ const handleBodyScroll = (disableScroll) => {
22
+ if (disableScroll) {
23
+ document.body.style.overflow = 'hidden';
24
+ document.body.style.position = 'fixed';
25
+ }
26
+ else {
27
+ document.body.style.overflow = 'unset';
28
+ document.body.style.position = 'relative';
29
+ document.body.style.width = '100%';
30
+ }
31
+ };
20
32
  const handleCloseModal = (event) => {
21
33
  if (onClose != null)
22
34
  onClose();
@@ -12,6 +12,7 @@ const BottomOverlay: FC<BottomOverlayProps> = ({ givenClass, header, body, open
12
12
  const overlayMessage = useRef<HTMLDivElement | null>(null)
13
13
 
14
14
  useEffect(() => {
15
+ handleBodyScroll(open)
15
16
  if (open) {
16
17
  const backgroundElement = overlayBackground.current as HTMLElement
17
18
  backgroundElement.addEventListener('mousedown', handleCloseModal)
@@ -21,6 +22,17 @@ const BottomOverlay: FC<BottomOverlayProps> = ({ givenClass, header, body, open
21
22
  }
22
23
  }, [open])
23
24
 
25
+ const handleBodyScroll = (disableScroll: boolean): void => {
26
+ if (disableScroll) {
27
+ document.body.style.overflow = 'hidden'
28
+ document.body.style.position = 'fixed'
29
+ } else {
30
+ document.body.style.overflow = 'unset'
31
+ document.body.style.position = 'relative'
32
+ document.body.style.width = '100%'
33
+ }
34
+ }
35
+
24
36
  const handleCloseModal = (event: MouseEvent): void => {
25
37
  if (onClose != null) onClose()
26
38
  }
@@ -1,3 +1,4 @@
1
+ import { device } from '../../../globalStyles/breakpoints';
1
2
  import styled from 'styled-components';
2
3
  export const RatafiaSubscriptionCardStyled = styled.div `
3
4
  display: flex;
@@ -90,5 +91,11 @@ export const RatafiaSubscriptionCardStyled = styled.div `
90
91
  display: flex;
91
92
  margin-top: 1.5rem;
92
93
  }
94
+
95
+ @media ${device.mobile} {
96
+ &__button {
97
+ flex: 1;
98
+ }
99
+ }
93
100
  }
94
101
  `;
@@ -1,3 +1,4 @@
1
+ import { device } from '../../../globalStyles/breakpoints'
1
2
  import styled from 'styled-components'
2
3
 
3
4
  export const RatafiaSubscriptionCardStyled = styled.div`
@@ -91,5 +92,11 @@ export const RatafiaSubscriptionCardStyled = styled.div`
91
92
  display: flex;
92
93
  margin-top: 1.5rem;
93
94
  }
95
+
96
+ @media ${device.mobile} {
97
+ &__button {
98
+ flex: 1;
99
+ }
100
+ }
94
101
  }
95
102
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.11.12",
3
+ "version": "5.11.13",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",