foundry-component-library 0.2.19 → 0.2.21
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.
|
@@ -42,9 +42,10 @@ const CaseStudyTeaser = ({
|
|
|
42
42
|
setTimeout(() => {
|
|
43
43
|
dragStarted.current = false;
|
|
44
44
|
}, 0);
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
45
|
+
}}>
|
|
47
46
|
{cases.map((el) => {
|
|
47
|
+
if (!el) return;
|
|
48
|
+
|
|
48
49
|
const { thumbnailImage, mainImage } = el.case;
|
|
49
50
|
|
|
50
51
|
return (
|
|
@@ -68,8 +69,7 @@ const CaseStudyTeaser = ({
|
|
|
68
69
|
e.preventDefault();
|
|
69
70
|
e.stopPropagation();
|
|
70
71
|
}
|
|
71
|
-
}}
|
|
72
|
-
>
|
|
72
|
+
}}>
|
|
73
73
|
{translate("See More")}
|
|
74
74
|
</a>
|
|
75
75
|
</div>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Dispatch, SetStateAction } from "react";
|
|
3
|
+
import { usePathname } from "next/navigation";
|
|
2
4
|
import styles from "./styles.module.scss";
|
|
3
5
|
import { translate } from "../../utils";
|
|
4
6
|
import Arrow from "../../assets/svg/arrow.svg";
|
|
@@ -14,6 +16,12 @@ function Menu({
|
|
|
14
16
|
setMenuOpen: Dispatch<SetStateAction<boolean>>;
|
|
15
17
|
Link: NextLink;
|
|
16
18
|
}) {
|
|
19
|
+
const path = usePathname();
|
|
20
|
+
const currentLang = path.startsWith("/de") ? "DE" : "EN";
|
|
21
|
+
|
|
22
|
+
const langPrefix =
|
|
23
|
+
currentLang === "EN" ? "" : `/${currentLang.toLowerCase()}`;
|
|
24
|
+
|
|
17
25
|
return (
|
|
18
26
|
<div className={`${styles.menu} ${isOpen}`}>
|
|
19
27
|
<div
|
|
@@ -26,16 +34,18 @@ function Menu({
|
|
|
26
34
|
<div className={styles.menuWrapper}>
|
|
27
35
|
<ul className={styles.menuList}>
|
|
28
36
|
<li className={styles.menuListItem}>
|
|
29
|
-
<Link href=
|
|
37
|
+
<Link href={`${langPrefix}/hubs`}>{translate("Service Hubs")}</Link>
|
|
30
38
|
</li>
|
|
31
39
|
<li className={styles.menuListItem}>
|
|
32
|
-
<Link href=
|
|
40
|
+
<Link href={`${langPrefix}/cases`}>{translate("Work")}</Link>
|
|
33
41
|
</li>
|
|
34
42
|
<li className={styles.menuListItem}>
|
|
35
|
-
<Link href=
|
|
43
|
+
<Link href={`${langPrefix}/about-us`}>{translate("About Us")}</Link>
|
|
36
44
|
</li>
|
|
37
45
|
<li className={styles.menuListItem}>
|
|
38
|
-
<Link href=
|
|
46
|
+
<Link href={`${langPrefix}/contact`}>
|
|
47
|
+
{translate("Contact Us")}
|
|
48
|
+
</Link>
|
|
39
49
|
</li>
|
|
40
50
|
</ul>
|
|
41
51
|
<ul className={styles.menuSecondary}>
|
|
@@ -56,18 +66,31 @@ function Menu({
|
|
|
56
66
|
</Container>
|
|
57
67
|
</li> */}
|
|
58
68
|
<li className={styles.secondaryMenuItem}>
|
|
59
|
-
<Link href=
|
|
69
|
+
<Link href={`${langPrefix}/team`}>
|
|
60
70
|
{translate("Team & Careers")}
|
|
61
71
|
<Arrow />
|
|
62
72
|
</Link>
|
|
63
73
|
</li>
|
|
64
74
|
<li className={styles.secondaryMenuItem}>
|
|
65
|
-
<Link href=
|
|
75
|
+
<Link href={`${langPrefix}/news`}>
|
|
66
76
|
{translate("News & Insights")}
|
|
67
77
|
<Arrow />
|
|
68
78
|
</Link>
|
|
69
79
|
</li>
|
|
70
80
|
</ul>
|
|
81
|
+
<div className={styles.languageSwitcher} aria-label="Language switcher">
|
|
82
|
+
<a
|
|
83
|
+
href={path.replace(`${langPrefix}`, "")}
|
|
84
|
+
className={`${styles.langBtn} ${currentLang === "EN" ? styles.active : ""}`}>
|
|
85
|
+
EN
|
|
86
|
+
</a>
|
|
87
|
+
<div className={styles.divider} />
|
|
88
|
+
<a
|
|
89
|
+
href={currentLang === "DE" ? "" : ` /de${path}`}
|
|
90
|
+
className={`${styles.langBtn} ${currentLang === "DE" ? styles.active : ""}`}>
|
|
91
|
+
DE
|
|
92
|
+
</a>
|
|
93
|
+
</div>
|
|
71
94
|
</div>
|
|
72
95
|
</div>
|
|
73
96
|
);
|
|
@@ -172,3 +172,25 @@
|
|
|
172
172
|
color: $color-pink;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
+
|
|
176
|
+
.languageSwitcher {
|
|
177
|
+
display: flex;
|
|
178
|
+
gap: 8px;
|
|
179
|
+
padding: 8px 0 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.langBtn {
|
|
183
|
+
text-transform: uppercase;
|
|
184
|
+
opacity: 0.6;
|
|
185
|
+
}
|
|
186
|
+
.divider {
|
|
187
|
+
margin: 3px 1px;
|
|
188
|
+
width: 2px;
|
|
189
|
+
height: calc(100% - 6px);
|
|
190
|
+
background-color: $color-text;
|
|
191
|
+
opacity: 0.6;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.langBtn.active {
|
|
195
|
+
opacity: 1;
|
|
196
|
+
}
|
|
@@ -6,6 +6,7 @@ import styles from "./styles.module.scss";
|
|
|
6
6
|
import Arrow from "../../../assets/svg/arrow.svg";
|
|
7
7
|
import { Case, NextImage, NextLink, NextRouter } from "../../../types";
|
|
8
8
|
import Top from "../Top";
|
|
9
|
+
import { usePathname } from "next/navigation";
|
|
9
10
|
|
|
10
11
|
function Cases({
|
|
11
12
|
cases,
|
|
@@ -42,6 +43,13 @@ function Cases({
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const [selected, setSelected] = useState(defaultValue);
|
|
46
|
+
|
|
47
|
+
const path = usePathname();
|
|
48
|
+
const currentLang = path.startsWith("/de") ? "DE" : "EN";
|
|
49
|
+
|
|
50
|
+
const langPrefix =
|
|
51
|
+
currentLang === "EN" ? "" : `/${currentLang.toLowerCase()}`;
|
|
52
|
+
|
|
45
53
|
const services = [
|
|
46
54
|
"Brand Identity",
|
|
47
55
|
"Advertising & Campaigning",
|
|
@@ -84,10 +92,9 @@ function Cases({
|
|
|
84
92
|
return (
|
|
85
93
|
<div key={item.id} className={styles.case}>
|
|
86
94
|
<Link
|
|
87
|
-
href={
|
|
95
|
+
href={`${langPrefix}/cases/${
|
|
88
96
|
item.status !== "draft" ? item.slug : `preview/${item.id}`
|
|
89
|
-
}`}
|
|
90
|
-
>
|
|
97
|
+
}`}>
|
|
91
98
|
{thumbnailVideo && (
|
|
92
99
|
<Video
|
|
93
100
|
url={thumbnailVideo.mediaItemUrl}
|
|
@@ -18,7 +18,7 @@ type HomePage = {
|
|
|
18
18
|
|
|
19
19
|
export default async function getCaseBySlug({
|
|
20
20
|
slug,
|
|
21
|
-
language,
|
|
21
|
+
language = "EN",
|
|
22
22
|
}: {
|
|
23
23
|
slug: string;
|
|
24
24
|
language: string;
|
|
@@ -31,8 +31,9 @@ export default async function getCaseBySlug({
|
|
|
31
31
|
const contactPage = language === "DE" ? "contact-de" : "contact";
|
|
32
32
|
|
|
33
33
|
const query = gql`
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
query GetCaseBySlug($slug: String, $language: LanguageCodeFilterEnum!) {
|
|
35
|
+
cases(where: { name: $slug, language: $language }) {
|
|
36
|
+
nodes {
|
|
36
37
|
id
|
|
37
38
|
title
|
|
38
39
|
case {
|
|
@@ -229,58 +230,61 @@ export default async function getCaseBySlug({
|
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
newyorkText
|
|
253
|
-
newyorkEmail
|
|
254
|
-
newyorkPhone
|
|
255
|
-
contactTeaserHeading
|
|
256
|
-
contactTeaserText
|
|
233
|
+
}
|
|
234
|
+
contactPage: page(id: "${contactPage}", idType: URI) {
|
|
235
|
+
customFieldsContact {
|
|
236
|
+
facebook
|
|
237
|
+
instagram
|
|
238
|
+
linkedin
|
|
239
|
+
berlinImage {
|
|
240
|
+
sourceUrl
|
|
241
|
+
}
|
|
242
|
+
berlinText
|
|
243
|
+
berlinEmail
|
|
244
|
+
berlinPhone
|
|
245
|
+
zurichImage {
|
|
246
|
+
sourceUrl
|
|
247
|
+
}
|
|
248
|
+
zurichText
|
|
249
|
+
zurichEmail
|
|
250
|
+
zurichPhone
|
|
251
|
+
newyorkImage {
|
|
252
|
+
sourceUrl
|
|
257
253
|
}
|
|
254
|
+
newyorkText
|
|
255
|
+
newyorkEmail
|
|
256
|
+
newyorkPhone
|
|
257
|
+
contactTeaserHeading
|
|
258
|
+
contactTeaserText
|
|
258
259
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
heading
|
|
267
|
-
text
|
|
260
|
+
}
|
|
261
|
+
homePage: page(id: "${homePage}", idType: URI) {
|
|
262
|
+
customFieldsBerlin {
|
|
263
|
+
awardsHeading
|
|
264
|
+
awards {
|
|
265
|
+
image {
|
|
266
|
+
sourceUrl
|
|
268
267
|
}
|
|
268
|
+
heading
|
|
269
|
+
text
|
|
269
270
|
}
|
|
270
271
|
}
|
|
271
272
|
}
|
|
272
|
-
|
|
273
|
+
}
|
|
274
|
+
`;
|
|
273
275
|
|
|
274
|
-
const variables = { slug };
|
|
276
|
+
const variables = { slug, language };
|
|
275
277
|
const data: {
|
|
276
|
-
|
|
278
|
+
cases: {
|
|
279
|
+
nodes: Case[];
|
|
280
|
+
};
|
|
277
281
|
contactPage: ContactPage;
|
|
278
282
|
homePage: HomePage;
|
|
279
283
|
} = await client.request(query, variables);
|
|
280
284
|
|
|
281
285
|
return {
|
|
282
|
-
case: data.
|
|
283
|
-
contactPage: data
|
|
284
|
-
homePage: data
|
|
286
|
+
case: data?.cases.nodes[0],
|
|
287
|
+
contactPage: data?.contactPage,
|
|
288
|
+
homePage: data?.homePage,
|
|
285
289
|
};
|
|
286
290
|
}
|