Skip to content

Commit 7633d60

Browse files
authored
Merge pull request #13785 from guardian/add-observer-footer
Add Observer footer
2 parents 46ee6c6 + a3bda7e commit 7633d60

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

dotcom-rendering/src/components/ArticleBody.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import type { TagType } from '../types/tag';
2222
import { Island } from './Island';
2323
import { LiveBlogRenderer } from './LiveBlogRenderer';
2424
import { TableOfContents } from './TableOfContents.importable';
25+
import { textBlockStyles } from './TextBlockComponent';
2526

2627
type Props = {
2728
format: ArticleFormat;
@@ -140,6 +141,23 @@ export const ArticleBody = ({
140141
format.design === ArticleDesign.Crossword;
141142
const language = decideLanguage(lang);
142143
const languageDirection = decideLanguageDirection(isRightToLeftLang);
144+
const hasObserverPublicationTag = tags.find(
145+
(tag) =>
146+
tag.type === 'Publication' && tag.id === 'publication/theobserver',
147+
);
148+
const ObserverFooter = () => {
149+
return (
150+
<ul css={textBlockStyles(format)}>
151+
<li>
152+
<p>
153+
This is the archive of The Observer up until 21/04/2025.
154+
The Observer is now owned and operated by Tortoise
155+
Media.
156+
</p>
157+
</li>
158+
</ul>
159+
);
160+
};
143161

144162
if (
145163
format.design === ArticleDesign.LiveBlog ||
@@ -233,6 +251,7 @@ export const ArticleBody = ({
233251
contributionsServiceUrl={contributionsServiceUrl}
234252
/>
235253
</div>
254+
{hasObserverPublicationTag && <ObserverFooter />}
236255
</>
237256
);
238257
};

dotcom-rendering/src/components/TextBlockComponent.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const sanitiserOptions: IOptions = {
162162
},
163163
};
164164

165-
const styles = (format: ArticleFormat) => css`
165+
export const textBlockStyles = (format: ArticleFormat) => css`
166166
margin-bottom: ${remSpace[3]};
167167
word-break: break-word;
168168
${format.theme === ArticleSpecial.Labs ? textSans17 : article17};
@@ -257,7 +257,7 @@ const buildElementTree =
257257

258258
switch (node.nodeName) {
259259
case 'P': {
260-
return jsx('p', { css: styles(format), children });
260+
return jsx('p', { css: textBlockStyles(format), children });
261261
}
262262
case 'BLOCKQUOTE':
263263
return jsx('blockquote', {
@@ -312,7 +312,7 @@ const buildElementTree =
312312

313313
return node.textContent;
314314
}
315-
return jsx('p', { css: styles(format), children });
315+
return jsx('p', { css: textBlockStyles(format), children });
316316
}
317317
case 'SPAN':
318318
if (
@@ -325,14 +325,14 @@ const buildElementTree =
325325
children,
326326
});
327327
}
328-
return jsx('p', { css: styles(format), children });
328+
return jsx('p', { css: textBlockStyles(format), children });
329329
case 'BR':
330330
return jsx('br', {
331331
key,
332332
});
333333
case 'STRIKE':
334334
return jsx('s', {
335-
css: styles(format),
335+
css: textBlockStyles(format),
336336
key,
337337
children,
338338
});
@@ -359,7 +359,7 @@ const buildElementTree =
359359
case 'U':
360360
case 'DEL':
361361
return jsx(node.nodeName.toLowerCase(), {
362-
css: styles(format),
362+
css: textBlockStyles(format),
363363
key,
364364
children,
365365
});

0 commit comments

Comments
 (0)