foundry-component-library 0.2.3 → 0.2.4

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,7 +10,7 @@ const ContactTeaser = ({
10
10
  text,
11
11
  theme = "yellow",
12
12
  buttonText = "Contact Us",
13
- buttonHref = "/contact",
13
+ buttonHref = "/contact#contact-us",
14
14
  alternate,
15
15
  Link,
16
16
  }: {
@@ -17,12 +17,16 @@ function Contacts({
17
17
  email: string;
18
18
  }[];
19
19
  }) {
20
- const [isTypeformOpen, setIsTypeformOpen] = useState(false);
21
- const ref = useClickOutside<HTMLDivElement>(() => setIsTypeformOpen(false));
20
+ const [isTypeform1Open, setIsTypeform1Open] = useState(false);
21
+ const [isTypeform2Open, setIsTypeform2Open] = useState(false);
22
+ const ref = useClickOutside<HTMLDivElement>(() => {
23
+ setIsTypeform1Open(false);
24
+ setIsTypeform2Open(false);
25
+ });
22
26
  if (!items) return;
23
27
 
24
28
  return (
25
- <section className={styles.section}>
29
+ <section className={styles.section} id="contact-us">
26
30
  <Container>
27
31
  <h2 className={styles.title}>{title}</h2>
28
32
  <div className={styles.boxes}>
@@ -44,8 +48,13 @@ function Contacts({
44
48
  </div>
45
49
  <a
46
50
  className={styles.buttonSecondary}
47
- onClick={() => setIsTypeformOpen(true)}
48
- >
51
+ onClick={() => {
52
+ if (i === 2) {
53
+ setIsTypeform1Open(true);
54
+ } else {
55
+ setIsTypeform2Open(true);
56
+ }
57
+ }}>
49
58
  {i === 0 && "Contact Account"}
50
59
  {i === 1 && "General Contact"}
51
60
  {i === 2 && "Contact HR"}
@@ -57,8 +66,7 @@ function Contacts({
57
66
  </div>
58
67
  <div
59
68
  className={styles.typeform}
60
- style={{ display: isTypeformOpen ? "flex" : "none" }}
61
- >
69
+ style={{ display: isTypeform1Open ? "flex" : "none" }}>
62
70
  <Script src="//embed.typeform.com/next/embed.js" />
63
71
  <div ref={ref} className={styles.typeformWrapper}>
64
72
  {/* <div data-tf-widget="qmv6Yk" data-tf-iframe-props="title=Foundry Website Contact Form" data-tf-medium="snippet" style={{ width: '100%', height: '400px' }} /> */}
@@ -70,6 +78,20 @@ function Contacts({
70
78
  />
71
79
  </div>
72
80
  </div>
81
+ <div
82
+ className={styles.typeform}
83
+ style={{ display: isTypeform2Open ? "flex" : "none" }}>
84
+ <Script src="//embed.typeform.com/next/embed.js" />
85
+ <div ref={ref} className={styles.typeformWrapper}>
86
+ {/* <div data-tf-widget="qmv6Yk" data-tf-iframe-props="title=Foundry Website Contact Form" data-tf-medium="snippet" style={{ width: '100%', height: '400px' }} /> */}
87
+ <div
88
+ data-tf-widget="qmv6Yk"
89
+ data-tf-iframe-props="title=Foundry Website Contact Form"
90
+ data-tf-medium="snippet"
91
+ style={{ width: "100%", height: "400px" }}
92
+ />
93
+ </div>
94
+ </div>
73
95
  </Container>
74
96
  </section>
75
97
  );
@@ -4,6 +4,7 @@
4
4
  padding: 64px 0;
5
5
  background-color: $color-yellow;
6
6
  color: $color-brown;
7
+ scroll-margin-top: 60px;
7
8
 
8
9
  @media #{$QUERY-sm} {
9
10
  padding: 32px 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-component-library",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",