foundry-component-library 0.2.39 → 0.2.40

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.
@@ -50,7 +50,7 @@ const Hub = ({
50
50
  <div className={styles.tile}>
51
51
  <a href={hub.uri}>
52
52
  {(hub.slug === "content-campaigning" ||
53
- hub.slug === "strategie-positionierung") && <TileBalls />}
53
+ hub.slug === "inhalte-kampagnen") && <TileBalls />}
54
54
  </a>
55
55
  <a href={hub.uri}>
56
56
  {(hub.slug === "social-media-performance" ||
@@ -64,7 +64,7 @@ const Hub = ({
64
64
  </a>
65
65
  <a href={hub.uri}>
66
66
  {(hub.slug === "strategy-positioning" ||
67
- hub.slug === "inhalte-kampagnen") && <TileGlass />}
67
+ hub.slug === "strategie-positionierung") && <TileGlass />}
68
68
  </a>
69
69
  </div>
70
70
  <div className={styles.title}>{hub.title}</div>
@@ -0,0 +1,53 @@
1
+ import { Page, Variables } from "../../lib/types";
2
+ import { request } from "./client";
3
+ import { ContactPage } from "./getContactPage";
4
+
5
+ export default async function getPageById(
6
+ id: string,
7
+ language: string,
8
+ ): Promise<{ page: Page; contactPage: ContactPage }> {
9
+ const contactPage = language === "DE" ? "contact-de" : "contact";
10
+
11
+ const query = `
12
+ query GetPageById($id: ID!) {
13
+ page(id: $id, idType: DATABASE_ID) {
14
+ title
15
+ content
16
+ }
17
+ contactPage: page(id: "${contactPage}", idType: URI) {
18
+ customFieldsContact {
19
+ facebook
20
+ instagram
21
+ linkedin
22
+ berlinImage {
23
+ sourceUrl
24
+ }
25
+ berlinText
26
+ berlinEmail
27
+ berlinPhone
28
+ zurichImage {
29
+ sourceUrl
30
+ }
31
+ zurichText
32
+ zurichEmail
33
+ zurichPhone
34
+ newyorkImage {
35
+ sourceUrl
36
+ }
37
+ newyorkText
38
+ newyorkEmail
39
+ newyorkPhone
40
+ contactTeaserHeading
41
+ contactTeaserText
42
+ }
43
+ }
44
+ }
45
+ `;
46
+
47
+ const variables: Variables = { id, language };
48
+ const data: { page: Page; contactPage: ContactPage } = await request(
49
+ query,
50
+ variables,
51
+ );
52
+ return data;
53
+ }
@@ -3,6 +3,7 @@ import getPosts from "./getPosts";
3
3
  import getCategories from "./getCategories";
4
4
  import getMetadataBySlug from "./getMetadataBySlug";
5
5
  import getPageBySlug from "./getPageBySlug";
6
+ import getPageById from "./getPageById";
6
7
  import getPostBySlug from "./getPostBySlug";
7
8
  import getCaseBySlug from "./getCaseBySlug";
8
9
  import getCaseById from "./getCaseById";
@@ -24,6 +25,7 @@ export {
24
25
  getCategories,
25
26
  getMetadataBySlug,
26
27
  getPageBySlug,
28
+ getPageById,
27
29
  getPostBySlug,
28
30
  getCaseBySlug,
29
31
  getCaseById,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-component-library",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",