Skip to content

Commit 896f866

Browse files
committed
Add Observer footer
1 parent 46ee6c6 commit 896f866

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

dotcom-rendering/src/components/ArticleBody.tsx

Lines changed: 20 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,24 @@ 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) => tag.type === 'Publication' && tag.title === 'The Observer',
146+
);
147+
const { removeObserver = false } = switches;
148+
149+
const ObserverFooter = () => {
150+
return (
151+
<ul css={textBlockStyles(format)}>
152+
<li>
153+
<p>
154+
This is the archive of The Observer up until 21/04/2025.
155+
The Observer is now owned and operated by Tortoise
156+
Media.
157+
</p>
158+
</li>
159+
</ul>
160+
);
161+
};
143162

144163
if (
145164
format.design === ArticleDesign.LiveBlog ||
@@ -233,6 +252,7 @@ export const ArticleBody = ({
233252
contributionsServiceUrl={contributionsServiceUrl}
234253
/>
235254
</div>
255+
{hasObserverPublicationTag && removeObserver && <ObserverFooter />}
236256
</>
237257
);
238258
};

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)