@npm_leadtech/legal-lib-components 7.19.2 → 7.20.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.
Files changed (82) hide show
  1. package/dist/css/styles.css +30 -15
  2. package/dist/images/componentsSvg/InfoLocationSvg.d.ts +2 -0
  3. package/dist/images/componentsSvg/InfoLocationSvg.js +4 -0
  4. package/dist/images/componentsSvg/InfoLocationSvg.tsx +14 -0
  5. package/dist/images/componentsSvg/InfoMailSvg.d.ts +2 -0
  6. package/dist/images/componentsSvg/InfoMailSvg.js +4 -0
  7. package/dist/images/componentsSvg/InfoMailSvg.tsx +12 -0
  8. package/dist/images/componentsSvg/InfoPhoneSvg.d.ts +2 -0
  9. package/dist/images/componentsSvg/InfoPhoneSvg.js +4 -0
  10. package/dist/images/componentsSvg/InfoPhoneSvg.tsx +12 -0
  11. package/dist/src/components/atoms/CardPane/CardPane.styled.js +1 -1
  12. package/dist/src/components/atoms/CardPane/CardPane.styled.ts +1 -1
  13. package/dist/src/components/atoms/PhoneNumberDisplay/PhoneNumberDisplay.styled.js +1 -1
  14. package/dist/src/components/atoms/PhoneNumberDisplay/PhoneNumberDisplay.styled.ts +1 -1
  15. package/dist/src/components/atoms/SearchSelect/SearchSelect.styled.js +1 -1
  16. package/dist/src/components/atoms/SearchSelect/SearchSelect.styled.ts +1 -1
  17. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBox.d.ts +3 -0
  18. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBox.js +6 -0
  19. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBox.styled.d.ts +1 -0
  20. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBox.styled.js +23 -0
  21. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBox.styled.ts +24 -0
  22. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBox.tsx +15 -0
  23. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBoxProps.types.d.ts +4 -0
  24. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBoxProps.types.js +1 -0
  25. package/dist/src/components/molecules/ContactInfoBox/ContactInfoBoxProps.types.ts +4 -0
  26. package/dist/src/components/molecules/ContactInfoBox/index.d.ts +2 -0
  27. package/dist/src/components/molecules/ContactInfoBox/index.js +1 -0
  28. package/dist/src/components/molecules/ContactInfoBox/index.ts +2 -0
  29. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobile.d.ts +3 -0
  30. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobile.js +6 -0
  31. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobile.styled.d.ts +1 -0
  32. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobile.styled.js +23 -0
  33. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobile.styled.ts +24 -0
  34. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobile.tsx +15 -0
  35. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobileProps.types.d.ts +4 -0
  36. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobileProps.types.js +1 -0
  37. package/dist/src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobileProps.types.ts +4 -0
  38. package/dist/src/components/molecules/ContactInfoBoxMobile/index.d.ts +2 -0
  39. package/dist/src/components/molecules/ContactInfoBoxMobile/index.js +1 -0
  40. package/dist/src/components/molecules/ContactInfoBoxMobile/index.ts +2 -0
  41. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCard.d.ts +3 -0
  42. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCard.js +19 -0
  43. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCard.styled.d.ts +1 -0
  44. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCard.styled.js +77 -0
  45. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCard.styled.ts +78 -0
  46. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCard.tsx +58 -0
  47. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCardProps.d.ts +7 -0
  48. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCardProps.js +1 -0
  49. package/dist/src/components/molecules/ContactInfoCard/ContactInfoCardProps.ts +8 -0
  50. package/dist/src/components/molecules/ContactInfoCard/index.d.ts +2 -0
  51. package/dist/src/components/molecules/ContactInfoCard/index.js +2 -0
  52. package/dist/src/components/molecules/ContactInfoCard/index.ts +2 -0
  53. package/dist/src/components/molecules/NavBarDropDown/NavBarDropDown.tsx +1 -1
  54. package/dist/src/components/molecules/SocialLinks/SocialLinks.js +5 -1
  55. package/dist/src/components/molecules/SocialLinks/SocialLinks.tsx +11 -7
  56. package/dist/src/components/molecules/TextInput/TextInput.scss +31 -15
  57. package/dist/src/components/molecules/TextInput/stories/TextInput.stories.tsx +13 -2
  58. package/dist/src/components/molecules/index.d.ts +2 -0
  59. package/dist/src/components/molecules/index.js +2 -0
  60. package/dist/src/components/molecules/index.ts +2 -0
  61. package/dist/src/components/organisms/ContactJumbotron/ContactJumbotron.js +3 -3
  62. package/dist/src/components/organisms/ContactJumbotron/ContactJumbotron.styled.js +0 -1
  63. package/dist/src/components/organisms/ContactJumbotron/ContactJumbotron.styled.ts +0 -1
  64. package/dist/src/components/organisms/ContactJumbotron/ContactJumbotron.tsx +4 -6
  65. package/dist/src/components/organisms/ContactJumbotron/ContactJumbotronProps.types.d.ts +2 -3
  66. package/dist/src/components/organisms/ContactJumbotron/ContactJumbotronProps.types.ts +2 -4
  67. package/dist/src/components/organisms/MobileMenu/MobileMenu.js +0 -1
  68. package/dist/src/components/organisms/MobileMenu/MobileMenu.tsx +0 -1
  69. package/dist/src/components/organisms/MobilePanel/MobilePanel.js +0 -1
  70. package/dist/src/components/organisms/MobilePanel/MobilePanel.tsx +0 -1
  71. package/dist/src/components/pages/ContactUsPage/ContactUsPage.js +3 -3
  72. package/dist/src/components/pages/ContactUsPage/ContactUsPage.tsx +3 -3
  73. package/dist/src/components/pages/ContactUsPage/ContactUsPageProps.d.ts +2 -2
  74. package/dist/src/components/pages/ContactUsPage/ContactUsPageProps.ts +2 -2
  75. package/dist/src/components/sections/AppHeader/AppHeader.scss +3 -0
  76. package/dist/src/components/sections/ContactSection/ContactSection.styled.js +2 -0
  77. package/dist/src/components/sections/ContactSection/ContactSection.styled.ts +2 -0
  78. package/dist/src/hooks/useIntersectionObserver.d.ts +7 -5
  79. package/dist/src/hooks/useIntersectionObserver.js +5 -7
  80. package/dist/src/hooks/useIntersectionObserver.tsx +12 -10
  81. package/dist/tsconfig.build.tsbuildinfo +1 -1
  82. package/package.json +1 -1
@@ -0,0 +1,58 @@
1
+ import React from 'react'
2
+
3
+ import { Button } from '../../atoms'
4
+
5
+ import { ContactInfoCardProps } from './ContactInfoCardProps'
6
+ import { ContactInfoCardStyled } from './ContactInfoCard.styled'
7
+
8
+ import { InfoLocationSvg } from '../../../../images/componentsSvg/InfoLocationSvg'
9
+ import { InfoMailSvg } from '../../../../images/componentsSvg/InfoMailSvg'
10
+ import { InfoPhoneSvg } from '../../../../images/componentsSvg/InfoPhoneSvg'
11
+
12
+ const iconMap = {
13
+ email: <InfoMailSvg />,
14
+ phone: <InfoPhoneSvg />,
15
+ location: <InfoLocationSvg />
16
+ }
17
+
18
+ export const ContactInfoCard: React.FC<ContactInfoCardProps> = ({ type, isMobile = false, title, text }) => {
19
+ if (type === 'phone' && isMobile) {
20
+ return (
21
+ <ContactInfoCardStyled className='contact-info-card phone-mobile'>
22
+ <Button
23
+ key={title}
24
+ centered
25
+ isExternal
26
+ link={`tel:${title}`}
27
+ gtmTag={'clicked_phone_contactus'}
28
+ givenClass='phone-mobile-contact-button e-button e-button--link e-button--primary-1 e-button--center'
29
+ label={title ?? ''}
30
+ dataQa={'phone_contact_box'}
31
+ />
32
+ <p className='text'>{text}</p>
33
+ </ContactInfoCardStyled>
34
+ )
35
+ } else {
36
+ return (
37
+ <ContactInfoCardStyled className='contact-info-card'>
38
+ <div className='info-card-wrapper'>
39
+ <div className='info-icon'>{iconMap[type]}</div>
40
+ <div className='content'>
41
+ {title && (
42
+ <p className={`title${type === 'email' ? ' email' : ''}`}>
43
+ {type === 'email' ? (
44
+ <a href={`mailto:${title}`}>{title}</a>
45
+ ) : type === 'phone' ? (
46
+ <a href={`tel:${title}`}>{title}</a>
47
+ ) : (
48
+ title
49
+ )}
50
+ </p>
51
+ )}
52
+ <p className='text'>{text}</p>
53
+ </div>
54
+ </div>
55
+ </ContactInfoCardStyled>
56
+ )
57
+ }
58
+ }
@@ -0,0 +1,7 @@
1
+ export type ContactInfoType = 'phone' | 'email' | 'location';
2
+ export interface ContactInfoCardProps {
3
+ type: ContactInfoType;
4
+ isMobile?: boolean;
5
+ title?: string;
6
+ text: string;
7
+ }
@@ -0,0 +1,8 @@
1
+ export type ContactInfoType = 'phone' | 'email' | 'location'
2
+
3
+ export interface ContactInfoCardProps {
4
+ type: ContactInfoType
5
+ isMobile?: boolean
6
+ title?: string
7
+ text: string
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ContactInfoCard';
2
+ export * from './ContactInfoCardProps';
@@ -0,0 +1,2 @@
1
+ export * from './ContactInfoCard';
2
+ export * from './ContactInfoCardProps';
@@ -0,0 +1,2 @@
1
+ export * from './ContactInfoCard'
2
+ export * from './ContactInfoCardProps'
@@ -18,7 +18,7 @@ export const NavBarDropDown: FC<NavBarDropDownProps> = ({
18
18
  setEnableScrollbarOnClose,
19
19
  setIsOpen
20
20
  }): React.ReactElement | null => {
21
- const [ref, isIntersectingWithElement] = useIntersectionObserver({
21
+ const [ref, isIntersectingWithElement] = useIntersectionObserver<HTMLDivElement>({
22
22
  options: { threshold: 0.15 }
23
23
  })
24
24
 
@@ -1,5 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SocialList } from './SocialLinks.styled';
3
+ import { useIntersectionObserver } from '../../../hooks';
3
4
  export const SocialLinks = ({ links }) => {
4
- return (_jsx(SocialList, { children: links.map((social) => (_jsx("li", { children: _jsx("a", { href: social.url, rel: 'noopener noreferrer', target: '_blank', children: _jsx("img", { src: social.iconSrc, alt: social.alt, width: '20', height: '20' }) }) }, social.url))) }));
5
+ return (_jsx(SocialList, { children: links.map((social) => {
6
+ const [ref, isIntersecting] = useIntersectionObserver({});
7
+ return (_jsx("li", { children: _jsx("a", { href: social.url, rel: 'noopener noreferrer', target: '_blank', children: _jsx("img", { ref: ref, src: isIntersecting ? social.iconSrc : '', alt: social.alt, width: '20', height: '20' }) }) }, social.url));
8
+ }) }));
5
9
  };
@@ -1,17 +1,21 @@
1
1
  import React from 'react'
2
2
  import { SocialLinksProps } from './SocialLinksProps.types'
3
3
  import { SocialList } from './SocialLinks.styled'
4
+ import { useIntersectionObserver } from '../../../hooks'
4
5
 
5
6
  export const SocialLinks: React.FC<SocialLinksProps> = ({ links }) => {
6
7
  return (
7
8
  <SocialList>
8
- {links.map((social) => (
9
- <li key={social.url}>
10
- <a href={social.url} rel='noopener noreferrer' target='_blank'>
11
- <img src={social.iconSrc} alt={social.alt} width='20' height='20' />
12
- </a>
13
- </li>
14
- ))}
9
+ {links.map((social) => {
10
+ const [ref, isIntersecting] = useIntersectionObserver<HTMLImageElement>({})
11
+ return (
12
+ <li key={social.url}>
13
+ <a href={social.url} rel='noopener noreferrer' target='_blank'>
14
+ <img ref={ref} src={isIntersecting ? social.iconSrc : ''} alt={social.alt} width='20' height='20' />
15
+ </a>
16
+ </li>
17
+ )
18
+ })}
15
19
  </SocialList>
16
20
  )
17
21
  }
@@ -55,6 +55,10 @@
55
55
  font-weight: bold;
56
56
  }
57
57
 
58
+ .e-text__inner {
59
+ grid-row: 1;
60
+ }
61
+
58
62
  .form-group__label-icon {
59
63
  color: var(--neutral-neutral-1);
60
64
  font-weight: bold;
@@ -150,6 +154,8 @@
150
154
 
151
155
  &--has-prefix {
152
156
  width: 100%;
157
+ display: grid;
158
+ grid-template-columns: 1fr;
153
159
 
154
160
  @include portrait-tablets {
155
161
  width: 50%;
@@ -157,14 +163,23 @@
157
163
 
158
164
  .has-currency-prefix {
159
165
  padding-left: 2rem;
166
+ grid-column: 1;
167
+ grid-row: 2;
168
+ align-self: center;
160
169
  }
161
170
 
162
171
  .has-currency-suffix {
163
172
  padding-right: 2rem;
173
+ grid-column: 1;
174
+ grid-row: 2;
175
+ align-self: center;
164
176
  }
165
177
 
166
178
  .has-percent-suffix {
167
179
  padding-left: 0.75rem;
180
+ grid-column: 1;
181
+ grid-row: 2;
182
+ align-self: center;
168
183
  }
169
184
  }
170
185
 
@@ -185,27 +200,28 @@
185
200
  }
186
201
 
187
202
  .input-icon-currency-suffix {
188
- position: absolute;
189
- right: 10px;
190
- bottom: 10px;
191
- background: none;
192
- border: none;
203
+ grid-column: 1;
204
+ grid-row: 2;
205
+ align-self: center;
206
+ margin-left: calc(100% - 30px);
207
+ width: fit-content;
193
208
  }
194
209
 
195
210
  .input-icon-currency-prefix {
196
- position: absolute;
197
- left: 10px;
198
- bottom: 10px;
199
- background: none;
200
- border: none;
211
+ grid-column: 1;
212
+ grid-row: 2;
213
+ align-self: center;
214
+ z-index: 1;
215
+ padding-left: 0.87rem;
216
+ width: fit-content;
201
217
  }
202
218
 
203
219
  .input-icon-percent-suffix {
204
- position: absolute;
205
- right: 10px;
206
- bottom: 10px;
207
- background: none;
208
- border: none;
220
+ grid-column: 1;
221
+ grid-row: 2;
222
+ align-self: center;
223
+ margin-left: calc(100% - 30px);
224
+ width: fit-content;
209
225
  }
210
226
 
211
227
  .formgroup--input__button {
@@ -124,7 +124,7 @@ export const MaskInput: Story = {
124
124
  }
125
125
  }
126
126
 
127
- export const WithPrefixEuro: Story = {
127
+ export const WithSufixEuro: Story = {
128
128
  args: {
129
129
  name: 'prefix',
130
130
  label: 'Price:',
@@ -146,7 +146,7 @@ export const WithPrefixNoEuro: Story = {
146
146
  }
147
147
  }
148
148
 
149
- export const WithPrefixPercent: Story = {
149
+ export const WithSufixPercent: Story = {
150
150
  args: {
151
151
  name: 'prefix',
152
152
  label: 'Price:',
@@ -156,3 +156,14 @@ export const WithPrefixPercent: Story = {
156
156
  country: 'US'
157
157
  }
158
158
  }
159
+
160
+ export const WithPrefixPercent: Story = {
161
+ args: {
162
+ name: 'prefix',
163
+ label: 'Price:',
164
+ value: '20.30',
165
+ type: 'text',
166
+ prefix: 'currency',
167
+ country: 'CA'
168
+ }
169
+ }
@@ -12,6 +12,8 @@ export * from './Breadcrumb';
12
12
  export * from './ContactBox';
13
13
  export * from './ContactCardList';
14
14
  export * from './ContactInfo';
15
+ export * from './ContactInfoBox';
16
+ export * from './ContactInfoBoxMobile';
15
17
  export * from './ContinueEditingBanner';
16
18
  export * from './CountDownMessage';
17
19
  export * from './DocumentListMenuSection';
@@ -12,6 +12,8 @@ export * from './Breadcrumb';
12
12
  export * from './ContactBox';
13
13
  export * from './ContactCardList';
14
14
  export * from './ContactInfo';
15
+ export * from './ContactInfoBox';
16
+ export * from './ContactInfoBoxMobile';
15
17
  export * from './ContinueEditingBanner';
16
18
  export * from './CountDownMessage';
17
19
  export * from './DocumentListMenuSection';
@@ -12,6 +12,8 @@ export * from './Breadcrumb'
12
12
  export * from './ContactBox'
13
13
  export * from './ContactCardList'
14
14
  export * from './ContactInfo'
15
+ export * from './ContactInfoBox'
16
+ export * from './ContactInfoBoxMobile'
15
17
  export * from './ContinueEditingBanner'
16
18
  export * from './CountDownMessage'
17
19
  export * from './DocumentListMenuSection'
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { EmailContactBox, PhoneContactBoxDesktop } from '../../molecules';
3
2
  import { Button } from '../../atoms';
3
+ import { ContactInfoBox } from '../../molecules/ContactInfoBox';
4
4
  import { ContactJumbotronStyled } from './ContactJumbotron.styled';
5
- export const ContactJumbotron = ({ phoneBoxDesktopProps, emailContactBoxProps, faqsTitle, visitFaqPageLabel, children, isJonSnow = false }) => {
6
- return (_jsxs(ContactJumbotronStyled, { children: [!isJonSnow && _jsx(PhoneContactBoxDesktop, { ...phoneBoxDesktopProps }), _jsx("h2", { className: 'contact__text__title sans-serif', children: faqsTitle }), _jsx("div", { className: 'contact__text__subtitle sans-serif', children: children }), !isJonSnow && (_jsx(Button, { givenClass: 'faq-button', color: 'secondary', label: visitFaqPageLabel, link: '/faqs/', dataQa: 'visitFaq' })), _jsx(EmailContactBox, { ...emailContactBoxProps })] }));
5
+ export const ContactJumbotron = ({ faqsTitle, visitFaqPageLabel, children, isJonSnow = false, items }) => {
6
+ return (_jsxs(ContactJumbotronStyled, { children: [_jsx(ContactInfoBox, { items: items }), _jsx("h2", { className: 'contact__text__title sans-serif', children: faqsTitle }), _jsx("div", { className: 'contact__text__subtitle sans-serif', children: children }), !isJonSnow && (_jsx(Button, { givenClass: 'faq-button', color: 'secondary', label: visitFaqPageLabel, link: '/faqs/', dataQa: 'visitFaq' }))] }));
7
7
  };
@@ -35,7 +35,6 @@ export const ContactJumbotronStyled = styled.article `
35
35
  .faq-button {
36
36
  display: inline-block;
37
37
  margin-top: 1rem;
38
- width: 100%;
39
38
  @media ${device['portrait-tablets']} {
40
39
  width: 10rem;
41
40
  }
@@ -36,7 +36,6 @@ export const ContactJumbotronStyled = styled.article`
36
36
  .faq-button {
37
37
  display: inline-block;
38
38
  margin-top: 1rem;
39
- width: 100%;
40
39
  @media ${device['portrait-tablets']} {
41
40
  width: 10rem;
42
41
  }
@@ -1,21 +1,20 @@
1
1
  import React from 'react'
2
2
 
3
- import { EmailContactBox, PhoneContactBoxDesktop } from '../../molecules'
4
3
  import { Button } from '../../atoms'
4
+ import { ContactInfoBox } from '../../molecules/ContactInfoBox'
5
5
  import { type ContactJumbotronProps } from './ContactJumbotronProps.types'
6
6
  import { ContactJumbotronStyled } from './ContactJumbotron.styled'
7
7
 
8
8
  export const ContactJumbotron: React.FC<ContactJumbotronProps> = ({
9
- phoneBoxDesktopProps,
10
- emailContactBoxProps,
11
9
  faqsTitle,
12
10
  visitFaqPageLabel,
13
11
  children,
14
- isJonSnow = false
12
+ isJonSnow = false,
13
+ items
15
14
  }) => {
16
15
  return (
17
16
  <ContactJumbotronStyled>
18
- {!isJonSnow && <PhoneContactBoxDesktop {...phoneBoxDesktopProps} />}
17
+ <ContactInfoBox items={items} />
19
18
  <h2 className='contact__text__title sans-serif'>{faqsTitle}</h2>
20
19
  <div className='contact__text__subtitle sans-serif'>{children}</div>
21
20
  {!isJonSnow && (
@@ -27,7 +26,6 @@ export const ContactJumbotron: React.FC<ContactJumbotronProps> = ({
27
26
  dataQa={'visitFaq'}
28
27
  />
29
28
  )}
30
- <EmailContactBox {...emailContactBoxProps} />
31
29
  </ContactJumbotronStyled>
32
30
  )
33
31
  }
@@ -1,10 +1,9 @@
1
+ import { ContactInfoCardProps } from 'src/components/molecules/ContactInfoCard';
1
2
  import type React from 'react';
2
- import { type EmailContactBoxProps, type PhoneContactBoxDesktopProps } from '../../molecules';
3
3
  export interface ContactJumbotronProps {
4
- phoneBoxDesktopProps: PhoneContactBoxDesktopProps;
5
- emailContactBoxProps: EmailContactBoxProps;
6
4
  faqsTitle: string;
7
5
  visitFaqPageLabel: string;
8
6
  children: React.ReactNode;
9
7
  isJonSnow?: boolean;
8
+ items: ContactInfoCardProps[];
10
9
  }
@@ -1,12 +1,10 @@
1
+ import { ContactInfoCardProps } from 'src/components/molecules/ContactInfoCard'
1
2
  import type React from 'react'
2
3
 
3
- import { type EmailContactBoxProps, type PhoneContactBoxDesktopProps } from '../../molecules'
4
-
5
4
  export interface ContactJumbotronProps {
6
- phoneBoxDesktopProps: PhoneContactBoxDesktopProps
7
- emailContactBoxProps: EmailContactBoxProps
8
5
  faqsTitle: string
9
6
  visitFaqPageLabel: string
10
7
  children: React.ReactNode
11
8
  isJonSnow?: boolean
9
+ items: ContactInfoCardProps[]
12
10
  }
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // src/components/organisms/MobileMenu/MobileMenu.tsx
3
2
  import { ContactInformation, MobileTrigger } from '../../atoms';
4
3
  import { MobileMenuWrapper, UserActionsPanel } from './MobileMenu.styled';
5
4
  import { HelpPanelList } from '../../molecules';
@@ -1,4 +1,3 @@
1
- // src/components/organisms/MobileMenu/MobileMenu.tsx
2
1
  import { ContactInformation, MobileTrigger } from '../../atoms'
3
2
  import { MobileMenuWrapper, UserActionsPanel } from './MobileMenu.styled'
4
3
  import { HelpPanelList } from '../../molecules'
@@ -1,4 +1,3 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // src/components/molecules/MobilePanel/MobilePanel.tsx
3
2
  import { CloseButton, PanelMenu, PanelMobileWrapper } from './MobilePanel.styled';
4
3
  export const MobilePanel = ({ showTopBar, isActive, onClose, children, closeText }) => (_jsx(PanelMobileWrapper, { isActive: isActive, showTopBar: showTopBar, children: _jsxs(PanelMenu, { children: [children, _jsx(CloseButton, { onClick: onClose, children: closeText })] }) }));
@@ -1,4 +1,3 @@
1
- // src/components/molecules/MobilePanel/MobilePanel.tsx
2
1
  import { CloseButton, PanelMenu, PanelMobileWrapper } from './MobilePanel.styled'
3
2
  import { MobilePanelProps } from './MobilePanelProps'
4
3
  import React from 'react'
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ContactSection, JumbotronSimplifiedSection } from '../../sections';
3
- import { PhoneContactBoxMobile } from '../../molecules';
4
- export const ContactUsPage = ({ jumbotronSimplifiedSectionProps, phoneContactBox, contactProps, isJonSnow = false }) => {
5
- return (_jsxs(_Fragment, { children: [_jsx(JumbotronSimplifiedSection, { ...jumbotronSimplifiedSectionProps }), !isJonSnow && _jsx(PhoneContactBoxMobile, { ...phoneContactBox }), _jsx(ContactSection, { ...contactProps })] }));
3
+ import { ContactInfoBoxMobile } from '../../molecules';
4
+ export const ContactUsPage = ({ jumbotronSimplifiedSectionProps, contactInfoBoxMobileProps, contactProps, isJonSnow = false }) => {
5
+ return (_jsxs(_Fragment, { children: [_jsx(JumbotronSimplifiedSection, { ...jumbotronSimplifiedSectionProps }), !isJonSnow && _jsx(ContactInfoBoxMobile, { ...contactInfoBoxMobileProps }), _jsx(ContactSection, { ...contactProps })] }));
6
6
  };
@@ -1,19 +1,19 @@
1
1
  import React from 'react'
2
2
 
3
3
  import { ContactSection, JumbotronSimplifiedSection } from '../../sections'
4
+ import { ContactInfoBoxMobile } from '../../molecules'
4
5
  import { type ContactUsPageProps } from './ContactUsPageProps'
5
- import { PhoneContactBoxMobile } from '../../molecules'
6
6
 
7
7
  export const ContactUsPage: React.FC<ContactUsPageProps> = ({
8
8
  jumbotronSimplifiedSectionProps,
9
- phoneContactBox,
9
+ contactInfoBoxMobileProps,
10
10
  contactProps,
11
11
  isJonSnow = false
12
12
  }) => {
13
13
  return (
14
14
  <>
15
15
  <JumbotronSimplifiedSection {...jumbotronSimplifiedSectionProps} />
16
- {!isJonSnow && <PhoneContactBoxMobile {...phoneContactBox} />}
16
+ {!isJonSnow && <ContactInfoBoxMobile {...contactInfoBoxMobileProps} />}
17
17
  <ContactSection {...contactProps} />
18
18
  </>
19
19
  )
@@ -1,8 +1,8 @@
1
1
  import { type ContactSectionProps, type JumbotronSimplifiedSectionProps } from '../../sections';
2
- import { type PhoneContactBoxMobileProps } from '../../molecules';
2
+ import { ContactInfoBoxMobileProps } from 'src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobileProps.types';
3
3
  export interface ContactUsPageProps {
4
4
  jumbotronSimplifiedSectionProps: JumbotronSimplifiedSectionProps;
5
- phoneContactBox: PhoneContactBoxMobileProps;
5
+ contactInfoBoxMobileProps: ContactInfoBoxMobileProps;
6
6
  contactProps: ContactSectionProps;
7
7
  isJonSnow?: boolean;
8
8
  }
@@ -1,9 +1,9 @@
1
1
  import { type ContactSectionProps, type JumbotronSimplifiedSectionProps } from '../../sections'
2
- import { type PhoneContactBoxMobileProps } from '../../molecules'
2
+ import { ContactInfoBoxMobileProps } from 'src/components/molecules/ContactInfoBoxMobile/ContactInfoBoxMobileProps.types'
3
3
 
4
4
  export interface ContactUsPageProps {
5
5
  jumbotronSimplifiedSectionProps: JumbotronSimplifiedSectionProps
6
- phoneContactBox: PhoneContactBoxMobileProps
6
+ contactInfoBoxMobileProps: ContactInfoBoxMobileProps
7
7
  contactProps: ContactSectionProps
8
8
  isJonSnow?: boolean
9
9
  }
@@ -2,6 +2,9 @@
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
5
+ .login-button {
6
+ margin-right: 1rem;
7
+ }
5
8
  .navigation-pane__user-name {
6
9
  margin-right: 1rem;
7
10
  font-weight: bold;
@@ -30,10 +30,12 @@ export const ContactSectionStyled = styled.section `
30
30
  .contact-left-container {
31
31
  padding-left: 1.5rem;
32
32
  padding-right: 1.5rem;
33
+ margin-bottom: 2.5rem;
33
34
 
34
35
  @media ${device['portrait-tablets']} {
35
36
  padding-left: 0;
36
37
  padding-right: 0;
38
+ margin-bottom: 1.5rem;
37
39
  width: 45%;
38
40
  }
39
41
  }
@@ -31,10 +31,12 @@ export const ContactSectionStyled = styled.section`
31
31
  .contact-left-container {
32
32
  padding-left: 1.5rem;
33
33
  padding-right: 1.5rem;
34
+ margin-bottom: 2.5rem;
34
35
 
35
36
  @media ${device['portrait-tablets']} {
36
37
  padding-left: 0;
37
38
  padding-right: 0;
39
+ margin-bottom: 1.5rem;
38
40
  width: 45%;
39
41
  }
40
42
  }
@@ -1,5 +1,7 @@
1
- import { type LegacyRef } from 'react';
2
- export declare function useIntersectionObserver({ options, defaultIntersecting }: {
3
- options?: {} | undefined;
4
- defaultIntersecting?: boolean | undefined;
5
- }): [LegacyRef<HTMLDivElement> | undefined, boolean];
1
+ import { RefObject } from 'react';
2
+ interface UseIntersectionObserverParams {
3
+ options?: IntersectionObserverInit;
4
+ defaultIntersecting?: boolean;
5
+ }
6
+ export declare function useIntersectionObserver<T extends HTMLElement>({ options, defaultIntersecting }?: UseIntersectionObserverParams): [RefObject<T | null>, boolean];
7
+ export {};
@@ -1,21 +1,19 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- export function useIntersectionObserver({ options = {}, defaultIntersecting = false }) {
2
+ export function useIntersectionObserver({ options = {}, defaultIntersecting = false } = {}) {
3
3
  const [isIntersecting, setIsIntersecting] = useState(defaultIntersecting);
4
4
  const elementRef = useRef(null);
5
5
  useEffect(() => {
6
6
  const currentElement = elementRef.current;
7
+ if (!currentElement)
8
+ return;
7
9
  const observer = new IntersectionObserver((entries) => {
8
10
  entries.forEach((entry) => {
9
11
  setIsIntersecting(entry.isIntersecting);
10
12
  });
11
13
  }, options);
12
- if (currentElement != null) {
13
- observer.observe(currentElement);
14
- }
14
+ observer.observe(currentElement);
15
15
  return () => {
16
- if (currentElement != null) {
17
- observer.unobserve(currentElement);
18
- }
16
+ observer.disconnect();
19
17
  };
20
18
  }, [options]);
21
19
  return [elementRef, isIntersecting];
@@ -1,14 +1,20 @@
1
- import { type LegacyRef, useEffect, useRef, useState } from 'react'
1
+ import { RefObject, useEffect, useRef, useState } from 'react'
2
2
 
3
- export function useIntersectionObserver({
3
+ interface UseIntersectionObserverParams {
4
+ options?: IntersectionObserverInit
5
+ defaultIntersecting?: boolean
6
+ }
7
+
8
+ export function useIntersectionObserver<T extends HTMLElement>({
4
9
  options = {},
5
10
  defaultIntersecting = false
6
- }): [LegacyRef<HTMLDivElement> | undefined, boolean] {
11
+ }: UseIntersectionObserverParams = {}): [RefObject<T | null>, boolean] {
7
12
  const [isIntersecting, setIsIntersecting] = useState(defaultIntersecting)
8
- const elementRef = useRef<HTMLDivElement>(null)
13
+ const elementRef = useRef<T>(null)
9
14
 
10
15
  useEffect(() => {
11
16
  const currentElement = elementRef.current
17
+ if (!currentElement) return
12
18
 
13
19
  const observer = new IntersectionObserver((entries) => {
14
20
  entries.forEach((entry) => {
@@ -16,14 +22,10 @@ export function useIntersectionObserver({
16
22
  })
17
23
  }, options)
18
24
 
19
- if (currentElement != null) {
20
- observer.observe(currentElement)
21
- }
25
+ observer.observe(currentElement)
22
26
 
23
27
  return () => {
24
- if (currentElement != null) {
25
- observer.unobserve(currentElement)
26
- }
28
+ observer.disconnect()
27
29
  }
28
30
  }, [options])
29
31