foundry-component-library 0.1.2 → 0.1.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.
@@ -54,12 +54,14 @@ const NewsTeaser = ({
54
54
  return (
55
55
  <div key={id} className={styles.item}>
56
56
  <div className={styles.image}>
57
- <Image
58
- src={customFields.thumbnailImage.sourceUrl}
59
- width={260}
60
- height={220}
61
- alt={title}
62
- />
57
+ {customFields.thumbnailImage && (
58
+ <Image
59
+ src={customFields.thumbnailImage?.sourceUrl}
60
+ width={260}
61
+ height={220}
62
+ alt={title}
63
+ />
64
+ )}
63
65
  </div>
64
66
  <div className={styles.itemTexts}>
65
67
  <div>
@@ -138,6 +138,9 @@
138
138
  }
139
139
 
140
140
  .image {
141
+ height: 220px;
142
+ background-color: $color-gray-light;
143
+
141
144
  img {
142
145
  object-fit: cover;
143
146
  }
@@ -84,15 +84,22 @@ type AboutPage = {
84
84
  newyorkEmail?: string;
85
85
  newyorkPhone?: string;
86
86
  newyorkAddressLink?: string;
87
+ contactTeaserHeading?: string;
88
+ contactTeaserText?: string;
87
89
  };
88
90
  };
89
91
  };
90
92
 
91
- export default async function getContactPage({
93
+ export default async function getAboutPage({
92
94
  slug,
95
+ language,
93
96
  }: {
94
97
  slug: string;
98
+ language: string;
95
99
  }): Promise<AboutPage> {
100
+ const homePage = language === "DE" ? "home-berlin-de" : "home-berlin";
101
+ const contactPage = language === "DE" ? "contact-de" : "contact";
102
+
96
103
  const query = gql`
97
104
  query GetPageBySlug($slug: ID!) {
98
105
  aboutPage: page(id: $slug, idType: URI) {
@@ -128,9 +135,7 @@ export default async function getContactPage({
128
135
  }
129
136
  }
130
137
  }
131
- homePage: page(id: "${
132
- slug === "about-us" ? "home-berlin" : "home-berlin-de"
133
- }", idType: URI) {
138
+ homePage: page(id: "${homePage}", idType: URI) {
134
139
  customFieldsBerlin {
135
140
  brandsCaption
136
141
  brandsHeading
@@ -156,9 +161,7 @@ export default async function getContactPage({
156
161
  }
157
162
  }
158
163
  }
159
- contactPage: page(id: "${
160
- slug === "about-us" ? "contact" : "contact-de"
161
- }", idType: URI) {
164
+ contactPage: page(id: "${contactPage}", idType: URI) {
162
165
  customFieldsContact {
163
166
  berlinImage {
164
167
  sourceUrl
@@ -184,6 +187,8 @@ export default async function getContactPage({
184
187
  newyorkPhone
185
188
  newyorkAddress
186
189
  newyorkAddressLink
190
+ contactTeaserHeading
191
+ contactTeaserText
187
192
  }
188
193
  }
189
194
  }
@@ -16,11 +16,20 @@ type HomePage = {
16
16
  };
17
17
  };
18
18
 
19
- export default async function getCaseBySlug(slug: string): Promise<{
19
+ export default async function getCaseBySlug({
20
+ slug,
21
+ language,
22
+ }: {
23
+ slug: string;
24
+ language: string;
25
+ }): Promise<{
20
26
  case: Case;
21
27
  contactPage: ContactPage;
22
28
  homePage: HomePage;
23
29
  }> {
30
+ const homePage = language === "DE" ? "home-berlin-de" : "home-berlin";
31
+ const contactPage = language === "DE" ? "contact-de" : "contact";
32
+
24
33
  const query = gql`
25
34
  query GetCaseBySlug($slug: ID!) {
26
35
  case(id: $slug, idType: SLUG) {
@@ -135,7 +144,7 @@ export default async function getCaseBySlug(slug: string): Promise<{
135
144
  }
136
145
  }
137
146
  }
138
- contactPage: page(id: "contact", idType: URI) {
147
+ contactPage: page(id: "${contactPage}", idType: URI) {
139
148
  customFieldsContact {
140
149
  berlinImage {
141
150
  sourceUrl
@@ -155,9 +164,11 @@ export default async function getCaseBySlug(slug: string): Promise<{
155
164
  newyorkText
156
165
  newyorkEmail
157
166
  newyorkPhone
167
+ contactTeaserHeading
168
+ contactTeaserText
158
169
  }
159
170
  }
160
- homePage: page(id: "home-berlin", idType: URI) {
171
+ homePage: page(id: "${homePage}", idType: URI) {
161
172
  customFieldsBerlin {
162
173
  awardsHeading
163
174
  awards {
@@ -7,7 +7,7 @@ type Params = {
7
7
  searchTerm?: string;
8
8
  category?: string;
9
9
  params?: { before?: string | null; after?: string | null };
10
- language?: string;
10
+ language: string;
11
11
  exclude?: string;
12
12
  };
13
13
 
@@ -23,7 +23,7 @@ type Params = {
23
23
  searchTerm?: string;
24
24
  category?: string;
25
25
  params?: { before?: string | null; after?: string | null };
26
- language?: string;
26
+ language: string;
27
27
  exclude?: string;
28
28
  page?: number;
29
29
  service?: string;
@@ -59,6 +59,8 @@ export default async function getCasesPage({
59
59
  const hasSearchTerm = searchTerm && searchTerm.trim() !== "";
60
60
  const hasCategoryTerm = category && category.trim() !== "";
61
61
  const isPrevious = !!params.before;
62
+ const homePage = language === "DE" ? "home-berlin-de" : "home-berlin";
63
+ const contactPage = language === "DE" ? "contact-de" : "contact";
62
64
 
63
65
  // Definition
64
66
  const variableDefinitions = [
@@ -132,7 +134,7 @@ export default async function getCasesPage({
132
134
  }
133
135
  }
134
136
  }
135
- contactPage: page(id: "contact", idType: URI) {
137
+ contactPage: page(id: "${contactPage}", idType: URI) {
136
138
  customFieldsContact {
137
139
  berlinImage {
138
140
  sourceUrl
@@ -152,9 +154,11 @@ export default async function getCasesPage({
152
154
  newyorkText
153
155
  newyorkEmail
154
156
  newyorkPhone
157
+ contactTeaserHeading
158
+ contactTeaserText
155
159
  }
156
160
  }
157
- homePage: page(id: "home-berlin", idType: URI) {
161
+ homePage: page(id: "${homePage}", idType: URI) {
158
162
  customFieldsBerlin {
159
163
  awardsHeading
160
164
  awards {
@@ -42,6 +42,8 @@ export type ContactPage = {
42
42
  berlinDetails: string;
43
43
  swissHeading: string;
44
44
  swissDetails: string;
45
+ contactTeaserHeading?: string;
46
+ contactTeaserText?: string;
45
47
  };
46
48
  };
47
49
 
@@ -90,15 +90,21 @@ type HomePage = {
90
90
  newyorkText?: string;
91
91
  newyorkEmail?: string;
92
92
  newyorkPhone?: string;
93
+ contactTeaserHeading?: string;
94
+ contactTeaserText?: string;
93
95
  };
94
96
  };
95
97
  };
96
98
 
97
99
  export default async function getHomePage({
98
100
  slug,
101
+ language,
99
102
  }: {
100
103
  slug: string;
104
+ language: string;
101
105
  }): Promise<HomePage> {
106
+ const contactPage = language === "EN" ? "contact" : "contact-de";
107
+
102
108
  const query = gql`
103
109
  query GetPageBySlug($slug: ID!) {
104
110
  page(id: $slug, idType: URI) {
@@ -163,14 +169,14 @@ export default async function getHomePage({
163
169
  newsText
164
170
  }
165
171
  }
166
- hubs {
172
+ hubs(where: {language: ${language}}) {
167
173
  nodes {
168
174
  id
169
175
  title
170
176
  uri
171
177
  }
172
178
  }
173
- posts(first: 3) {
179
+ posts(first: 3, where: {language: ${language}}) {
174
180
  nodes {
175
181
  id
176
182
  title
@@ -183,7 +189,7 @@ export default async function getHomePage({
183
189
  }
184
190
  }
185
191
  }
186
- contactPage: page(id: "contact", idType: URI) {
192
+ contactPage: page(id: "${contactPage}", idType: URI) {
187
193
  customFieldsContact {
188
194
  berlinImage {
189
195
  sourceUrl
@@ -209,6 +215,8 @@ export default async function getHomePage({
209
215
  newyorkPhone
210
216
  newyorkAddress
211
217
  newyorkAddressLink
218
+ contactTeaserHeading
219
+ contactTeaserText
212
220
  }
213
221
  }
214
222
  }
@@ -25,9 +25,14 @@ type HubFields = {
25
25
 
26
26
  export default async function getCaseBySlug({
27
27
  slug,
28
+ language,
28
29
  }: {
29
30
  slug: string;
31
+ language: string;
30
32
  }): Promise<HubFields> {
33
+ const homePage = language === "DE" ? "home-berlin-de" : "home-berlin";
34
+ const contactPage = language === "DE" ? "contact-de" : "contact";
35
+
31
36
  const query = gql`
32
37
  query GetHubBySlug($slug: ID!) {
33
38
  hub(id: $slug, idType: SLUG) {
@@ -71,7 +76,7 @@ export default async function getCaseBySlug({
71
76
  quoteText
72
77
  }
73
78
  }
74
- contactPage: page(id: "contact", idType: URI) {
79
+ contactPage: page(id: "${contactPage}", idType: URI) {
75
80
  customFieldsContact {
76
81
  berlinImage {
77
82
  sourceUrl
@@ -91,9 +96,11 @@ export default async function getCaseBySlug({
91
96
  newyorkText
92
97
  newyorkEmail
93
98
  newyorkPhone
99
+ contactTeaserHeading
100
+ contactTeaserText
94
101
  }
95
102
  }
96
- cases(first: 3) {
103
+ cases(first: 3, where: {language: ${language}}) {
97
104
  nodes {
98
105
  id
99
106
  title
@@ -115,7 +122,7 @@ export default async function getCaseBySlug({
115
122
  hasPreviousPage
116
123
  }
117
124
  }
118
- homePage: page(id: "home-berlin", idType: URI) {
125
+ homePage: page(id: "${homePage}", idType: URI) {
119
126
  customFieldsBerlin {
120
127
  awardsHeading
121
128
  awards {
@@ -17,7 +17,7 @@ type HomePage = {
17
17
  };
18
18
 
19
19
  type AboutPage = {
20
- customFieldsAbout: {
20
+ customFieldsAboutBerlin: {
21
21
  partnersCaption?: string;
22
22
  partnersHeading?: string;
23
23
  partnersText?: string;
@@ -46,12 +46,16 @@ type Params = {
46
46
  searchTerm?: string;
47
47
  category?: string;
48
48
  params?: { before?: string | null; after?: string | null };
49
- language?: string;
49
+ language: string;
50
50
  exclude?: string;
51
51
  slug?: string;
52
52
  };
53
53
 
54
- export default async function getCasesPage(options: Params = {}): Promise<{
54
+ export default async function getCasesPage(
55
+ options: Params = {
56
+ language: "EN",
57
+ }
58
+ ): Promise<{
55
59
  hubsPage: HubsPage;
56
60
  hubs: Hub[];
57
61
  pageInfo: {
@@ -76,6 +80,9 @@ export default async function getCasesPage(options: Params = {}): Promise<{
76
80
  const hasSearchTerm = searchTerm && searchTerm.trim() !== "";
77
81
  const hasCategoryTerm = category && category.trim() !== "";
78
82
  const isPrevious = !!params.before;
83
+ const homePage = language === "DE" ? "home-berlin-de" : "home-berlin";
84
+ const contactPage = language === "DE" ? "contact-de" : "contact";
85
+ const aboutPage = language === "DE" ? "about-berlin-de" : "about-berlin";
79
86
 
80
87
  // Definition
81
88
  const variableDefinitions = [
@@ -153,9 +160,7 @@ export default async function getCasesPage(options: Params = {}): Promise<{
153
160
  hasPreviousPage
154
161
  }
155
162
  }
156
- contactPage: page(id: "${
157
- language === "EN" ? "contact" : "contact-de"
158
- }", idType: URI) {
163
+ contactPage: page(id: "${contactPage}", idType: URI) {
159
164
  customFieldsContact {
160
165
  berlinImage {
161
166
  sourceUrl
@@ -175,11 +180,11 @@ export default async function getCasesPage(options: Params = {}): Promise<{
175
180
  newyorkText
176
181
  newyorkEmail
177
182
  newyorkPhone
183
+ contactTeaserHeading
184
+ contactTeaserText
178
185
  }
179
186
  }
180
- homePage: page(id: "${
181
- language === "EN" ? "home-berlin" : "home-berlin-de"
182
- }", idType: URI) {
187
+ homePage: page(id: "${homePage}", idType: URI) {
183
188
  customFieldsBerlin {
184
189
  awardsHeading
185
190
  awards {
@@ -191,10 +196,8 @@ export default async function getCasesPage(options: Params = {}): Promise<{
191
196
  }
192
197
  }
193
198
  }
194
- aboutPage: page(id: "${
195
- language === "EN" ? "about-us" : "about-us-de"
196
- }", idType: URI) {
197
- customFieldsAbout {
199
+ aboutPage: page(id: "${aboutPage}", idType: URI) {
200
+ customFieldsAboutBerlin {
198
201
  partnersCaption
199
202
  partnersHeading
200
203
  partnersText
@@ -19,7 +19,7 @@ type Params = {
19
19
  searchTerm?: string;
20
20
  category?: string;
21
21
  params?: { before?: string | null; after?: string | null };
22
- language?: string;
22
+ language: string;
23
23
  exclude?: string;
24
24
  slug: string;
25
25
  };
@@ -47,6 +47,7 @@ export default async function getNewsPage(options: Params): Promise<{
47
47
  const hasSearchTerm = searchTerm && searchTerm.trim() !== "";
48
48
  const hasCategoryTerm = category && category.trim() !== "";
49
49
  const isPrevious = !!params.before;
50
+ const contactPage = language === "DE" ? "contact-de" : "contact";
50
51
 
51
52
  // Definition
52
53
  const variableDefinitions = [
@@ -116,7 +117,7 @@ export default async function getNewsPage(options: Params): Promise<{
116
117
  hasPreviousPage
117
118
  }
118
119
  }
119
- contactPage: page(id: "contact", idType: URI) {
120
+ contactPage: page(id: "${contactPage}", idType: URI) {
120
121
  customFieldsContact {
121
122
  berlinImage {
122
123
  sourceUrl
@@ -136,6 +137,8 @@ export default async function getNewsPage(options: Params): Promise<{
136
137
  newyorkText
137
138
  newyorkEmail
138
139
  newyorkPhone
140
+ contactTeaserHeading
141
+ contactTeaserText
139
142
  }
140
143
  }
141
144
  }
@@ -50,15 +50,21 @@ type PeoplePage = {
50
50
  newyorkEmail?: string;
51
51
  newyorkPhone?: string;
52
52
  newyorkAddress?: string;
53
+ contactTeaserHeading?: string;
54
+ contactTeaserText?: string;
53
55
  };
54
56
  };
55
57
  };
56
58
 
57
59
  export default async function getContactPage({
58
60
  slug,
61
+ language,
59
62
  }: {
60
63
  slug: string;
64
+ language: string;
61
65
  }): Promise<PeoplePage> {
66
+ const contactPage = language === "DE" ? "contact-de" : "contact";
67
+
62
68
  const query = gql`
63
69
  query GetPageBySlug($slug: ID!) {
64
70
  page(id: $slug, idType: URI) {
@@ -94,7 +100,7 @@ export default async function getContactPage({
94
100
  heroHeading
95
101
  }
96
102
  }
97
- contactPage: page(id: "contact", idType: URI) {
103
+ contactPage: page(id: "${contactPage}", idType: URI) {
98
104
  customFieldsContact {
99
105
  berlinImage {
100
106
  sourceUrl
@@ -117,6 +123,8 @@ export default async function getContactPage({
117
123
  newyorkEmail
118
124
  newyorkPhone
119
125
  newyorkAddress
126
+ contactTeaserHeading
127
+ contactTeaserText
120
128
  }
121
129
  }
122
130
  }
@@ -71,11 +71,13 @@ type PerformancePage = {
71
71
  newyorkEmail?: string;
72
72
  newyorkPhone?: string;
73
73
  newyorkAddressLink?: string;
74
+ contactTeaserHeading?: string;
75
+ contactTeaserText?: string;
74
76
  };
75
77
  };
76
78
  };
77
79
 
78
- export default async function getContactPage(): Promise<PerformancePage> {
80
+ export default async function getPerformanceHubPage(): Promise<PerformancePage> {
79
81
  const query = gql`
80
82
  query GetPageBySlug($slug: ID!) {
81
83
  homePage: page(id: "home-berlin", idType: URI) {
@@ -150,6 +152,8 @@ export default async function getContactPage(): Promise<PerformancePage> {
150
152
  newyorkPhone
151
153
  newyorkAddress
152
154
  newyorkAddressLink
155
+ contactTeaserHeading
156
+ contactTeaserText
153
157
  }
154
158
  }
155
159
  }
@@ -3,10 +3,18 @@ import { Post } from "../../lib/types";
3
3
  import client from "./client";
4
4
  import { ContactPage } from "./getContactPage";
5
5
 
6
- export default async function getPostBySlug(slug: string): Promise<{
6
+ export default async function getPostBySlug({
7
+ slug,
8
+ language,
9
+ }: {
10
+ slug: string;
11
+ language: string;
12
+ }): Promise<{
7
13
  post: Post;
8
14
  contactPage: ContactPage;
9
15
  }> {
16
+ const contactPage = language === "DE" ? "contact-de" : "contact";
17
+
10
18
  const query = gql`
11
19
  query GetPostBySlug($slug: ID!) {
12
20
  post(id: $slug, idType: SLUG) {
@@ -94,7 +102,7 @@ export default async function getPostBySlug(slug: string): Promise<{
94
102
  }
95
103
  }
96
104
  }
97
- contactPage: page(id: "contact", idType: URI) {
105
+ contactPage: page(id: "${contactPage}", idType: URI) {
98
106
  customFieldsContact {
99
107
  berlinImage {
100
108
  sourceUrl
@@ -114,6 +122,8 @@ export default async function getPostBySlug(slug: string): Promise<{
114
122
  newyorkText
115
123
  newyorkEmail
116
124
  newyorkPhone
125
+ contactTeaserHeading
126
+ contactTeaserText
117
127
  }
118
128
  }
119
129
  }
@@ -6,11 +6,15 @@ interface Params {
6
6
  searchTerm?: string;
7
7
  category?: string;
8
8
  params?: { before?: string | null; after?: string | null };
9
- language?: string;
9
+ language: string;
10
10
  perPage?: number;
11
11
  }
12
12
 
13
- export default async function getPosts(options: Params = {}): Promise<{
13
+ export default async function getPosts(
14
+ options: Params = {
15
+ language: "EN",
16
+ }
17
+ ): Promise<{
14
18
  posts: Post[];
15
19
  pageInfo: {
16
20
  startCursor: string | null;
@@ -14,7 +14,7 @@ export interface Variables {
14
14
  after?: string | null;
15
15
  search?: string;
16
16
  categorySlug?: string;
17
- language?: string;
17
+ language: string;
18
18
  slug?: string;
19
19
  exclude?: string;
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-component-library",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",