Skip to content

Commit 80b9ff2

Browse files
Merge branch 'main' into storybook-9
2 parents 77dac1f + 0e56c3c commit 80b9ff2

File tree

17 files changed

+146
-131
lines changed

17 files changed

+146
-131
lines changed

apps-rendering/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@guardian/cdk": "61.4.0",
4747
"@guardian/content-api-models": "31.0.0",
4848
"@guardian/content-atom-model": "6.1.0",
49-
"@guardian/eslint-config-typescript": "9.0.1",
49+
"@guardian/eslint-config-typescript": "10.0.1",
5050
"@guardian/libs": "22.0.0",
5151
"@guardian/renditions": "0.2.0",
5252
"@guardian/source": "9.0.0",

apps-rendering/src/atoms.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ interface TimelineEvent {
2121
}
2222

2323
function formatOptionalDate(date: Int64 | undefined): string | undefined {
24-
if (date === undefined) return undefined;
24+
if (date === undefined) {
25+
return undefined;
26+
}
2527
const d = new Date(date.toNumber());
26-
if (!isValidDate(d)) return undefined;
28+
if (!isValidDate(d)) {
29+
return undefined;
30+
}
2731
return d.toDateString();
2832
}
2933

apps-rendering/src/client/article.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ function followToggle(
7878
bridgetClient: NotificationsClient<void> | TagClient<void>,
7979
): void {
8080
const followStatus = document.querySelector(querySelector);
81-
if (!followStatus) return;
81+
if (!followStatus) {
82+
return;
83+
}
8284
void bridgetClient.isFollowing(topic).then((isFollowing) => {
8385
if (isFollowing) {
8486
void bridgetClient.unfollow(topic).then((unfollow) => {

apps-rendering/src/client/callouts.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ const makeArticleFormat = (theme: ArticleTheme): ArticleFormatProps => ({
120120
const themeParser: Parser<ArticleTheme> = pipe(
121121
numberParser,
122122
andThen((num) => {
123-
if (Pillar[num]) return succeed(num);
124-
if (ArticleSpecial[num]) return succeed(num);
123+
if (Pillar[num]) {
124+
return succeed(num);
125+
}
126+
if (ArticleSpecial[num]) {
127+
return succeed(num);
128+
}
125129
return fail(`I was not able to parse '${num}' as a valid theme`);
126130
}),
127131
);

apps-rendering/src/client/editions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ const adjustGalleryImages = (): void => {
3333
const figures: NodeListOf<HTMLElement> = document.querySelectorAll(
3434
'.editions-gallery-figure',
3535
);
36-
if (figures.length === 0) return;
36+
if (figures.length === 0) {
37+
return;
38+
}
3739

3840
Array.from(figures).forEach((figure) => {
3941
const imageEl = figure.querySelector('img');

apps-rendering/src/client/nativeCommunication.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ function areRectsEqual(rectA: IRect, rectB: IRect): boolean {
2929
}
3030

3131
function positionChanged(slotsA: Slot[], slotsB: Slot[]): boolean {
32-
if (slotsA.length !== slotsB.length) return true;
32+
if (slotsA.length !== slotsB.length) {
33+
return true;
34+
}
3335
return !slotsA.every((slot, index) =>
3436
areRectsEqual(slot.rect, slotsB[index].rect),
3537
);

apps-rendering/src/client/newsletterSignupForm.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ interface FormBundle {
1414
}
1515

1616
// ----- Constants ----- //
17-
const SIGNUP_CONTAINER_CLASSNAME = 'js-signup-form-container' as const;
18-
const FALLBACK_CONTENT_CLASSNAME = 'js-signup-form-fallback-container' as const;
19-
const LOADING_CONTENT_CLASSNAME = 'js-signup-form-loading-content' as const;
20-
const SIGNUP_COMPONENT_BASE_CLASSNAME = 'js-signup-form' as const;
17+
const SIGNUP_CONTAINER_CLASSNAME = 'js-signup-form-container';
18+
const FALLBACK_CONTENT_CLASSNAME = 'js-signup-form-fallback-container';
19+
const LOADING_CONTENT_CLASSNAME = 'js-signup-form-loading-content';
20+
const SIGNUP_COMPONENT_BASE_CLASSNAME = 'js-signup-form';
2121
const MODIFIER_CLASSNAME = {
2222
waiting: `${SIGNUP_COMPONENT_BASE_CLASSNAME}--waiting`,
2323
success: `${SIGNUP_COMPONENT_BASE_CLASSNAME}--success`,

apps-rendering/src/components/Callout/calloutContact.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export const formatContactNumbers = (contacts: Contact[]): string => {
3131

3232
// Group each contact by its value, so we can display multiple names for the same number.
3333
contacts.forEach(({ name, value }) => {
34-
if (!contactNumbers.has(value)) contactNumbers.set(value, []);
34+
if (!contactNumbers.has(value)) {
35+
contactNumbers.set(value, []);
36+
}
3537
contactNumbers.get(value)?.push(name);
3638
});
3739

apps-rendering/src/components/Callout/calloutForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ const CalloutForm = ({ id, fields }: CalloutFormProps) => {
9494
// Reset error for new submission attempt
9595
setSubmissionError('');
9696
const isValid = validateForm();
97-
if (!isValid) return;
97+
if (!isValid) {
98+
return;
99+
}
98100

99101
// need to add prefix `field_` to all keys in form (as is required by formstack api)
100102
const formDataWithFieldPrefix = Object.keys(formData).reduce(

apps-rendering/src/components/Callout/formFields.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export const FormField = ({
6262
);
6363
}
6464

65-
if (formField.hidden) return <input type="hidden" />;
65+
if (formField.hidden) {
66+
return <input type="hidden" />;
67+
}
6668

6769
switch (type) {
6870
case 'text':

0 commit comments

Comments
 (0)