foundry-component-library 0.2.20 → 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.
|
@@ -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
|
}
|