@npm_leadtech/legal-lib-components 5.11.21 → 5.12.1

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.
@@ -10,6 +10,7 @@ export const CookiePolicyBarStyled = styled.div `
10
10
  position: fixed;
11
11
  bottom: 0;
12
12
  z-index: 3;
13
+ flex-direction: column;
13
14
 
14
15
  @media ${device['portrait-tablets']} {
15
16
  flex-direction: row;
@@ -11,6 +11,7 @@ export const CookiePolicyBarStyled = styled.div`
11
11
  position: fixed;
12
12
  bottom: 0;
13
13
  z-index: 3;
14
+ flex-direction: column;
14
15
 
15
16
  @media ${device['portrait-tablets']} {
16
17
  flex-direction: row;
@@ -1,10 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import { Button } from '../../atoms/Button';
3
4
  import { WhyLawDistrictItems } from '../../atoms/WhyLawDistrictItems';
4
5
  import { WhyLawDistrictSectionStyled } from './WhyLawDistrictSection.styled';
5
6
  export const WhyLawDistrictSection = ({ title, items, userActive, link }) => {
6
7
  if (items.length === 0)
7
8
  return null;
8
- return (_jsxs(WhyLawDistrictSectionStyled, { className: 'whyLawDistrictSection', children: [_jsx("h2", { className: 'why-lawDistrict__title serif --hero', children: title }), _jsx(WhyLawDistrictItems, { items: items }), !userActive && (_jsx(Button, { givenClass: 'whyLawDistrictSection__button', label: link.cta, link: link.url, onClick: link.onClick, dataQa: link.dataQa, isExternal: true, hasNoFollow: true }))] }));
9
+ const [isUserActive, setIsUserActive] = useState(false);
10
+ useEffect(() => {
11
+ setIsUserActive(userActive);
12
+ }, [userActive]);
13
+ return (_jsxs(WhyLawDistrictSectionStyled, { className: 'whyLawDistrictSection', children: [_jsx("h2", { className: 'why-lawDistrict__title serif --hero', children: title }), _jsx(WhyLawDistrictItems, { items: items }), !isUserActive && (_jsx(Button, { givenClass: 'whyLawDistrictSection__button', label: link.cta, link: link.url, onClick: link.onClick, dataQa: link.dataQa, isExternal: true, hasNoFollow: true }))] }));
9
14
  };
10
15
  export default WhyLawDistrictSection;
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
 
3
3
  import { Button } from '../../atoms/Button'
4
4
  import { WhyLawDistrictItems } from '../../atoms/WhyLawDistrictItems'
@@ -8,12 +8,18 @@ import { WhyLawDistrictSectionStyled } from './WhyLawDistrictSection.styled'
8
8
  export const WhyLawDistrictSection: React.FC<WhyLawDistrictSectionProps> = ({ title, items, userActive, link }) => {
9
9
  if (items.length === 0) return null
10
10
 
11
+ const [isUserActive, setIsUserActive] = useState(false)
12
+
13
+ useEffect(() => {
14
+ setIsUserActive(userActive)
15
+ }, [userActive])
16
+
11
17
  return (
12
18
  <WhyLawDistrictSectionStyled className={'whyLawDistrictSection'}>
13
19
  <h2 className={'why-lawDistrict__title serif --hero'}>{title}</h2>
14
20
  <WhyLawDistrictItems items={items} />
15
21
 
16
- {!userActive && (
22
+ {!isUserActive && (
17
23
  <Button
18
24
  givenClass='whyLawDistrictSection__button'
19
25
  label={link.cta}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.11.21",
3
+ "version": "5.12.1",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",