feat(PageHelp): make PageHelp messages configurable

This commit is contained in:
Danny Koppenhagen
2021-10-26 20:12:45 +02:00
committed by Bastian
parent 265a8318b0
commit 1e3433274b
4 changed files with 17 additions and 7 deletions

View File

@@ -14,11 +14,12 @@ const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
const { pageHelp } = useMessages();
if (pageHelp) {
const { paragraphs, quadrants, rings, sourcecodeLink } = pageHelp;
const { paragraphs, quadrants, rings, sourcecodeLink, headlinePrefix, quadrantsPreDescription, ringsPreDescription } = pageHelp;
const title = `${headlinePrefix || 'How to use the'} ${radarName}`;
return (
<Fadeable leaving={leaving} onLeave={onLeave}>
<SetTitle title={"How to use the " + radarName} />
<HeroHeadline>How to use the {radarName}</HeroHeadline>
<SetTitle title={title}/>
<HeroHeadline>{title}</HeroHeadline>
<div className="fullpage-content">
{paragraphs.map(({ headline, values }) => (
<React.Fragment key={headline}>
@@ -29,7 +30,7 @@ const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
</React.Fragment>
))}
<p>The quadrants are:</p>
<p>{quadrantsPreDescription ?? "The quadrants are:"}</p>
<ul>
{quadrants.map(({ name, description }) => (
<li key={name}>
@@ -38,7 +39,7 @@ const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
))}
</ul>
<p>Each of the items is classified in one of these rings:</p>
<p>{ringsPreDescription ?? "Each of the items is classified in one of these rings:"}</p>
<ul>
{rings.map(({ name, description }) => (
<li key={name}>

View File

@@ -18,13 +18,16 @@ interface Paragraph {
interface PageHelp {
paragraphs: Paragraph[];
quadrantsPreDescription?: string;
quadrants: Quadrant[];
rings: Ring[];
ringsPreDescription?: string;
sourcecodeLink?: {
href: string;
name: string;
description: string;
};
headlinePrefix?: string
}
interface PageOverview {