feat(PageIndex): make PageIndex published text configurable

This commit is contained in:
Danny Koppenhagen
2021-10-26 20:02:33 +02:00
committed by Bastian
parent a509e0a0da
commit 265a8318b0
4 changed files with 16 additions and 1 deletions

View File

@@ -90,6 +90,9 @@
"pageItem": {
"quadrantOverview": "Quadrant Overview"
},
"pageIndex": {
"publishedLabel": "Quadrant Overview"
},
"legalInformationLink": "https://www.aoe.com/en/imprint.html",
"search": "What are you looking for?"
}

View File

@@ -90,6 +90,9 @@
"pageItem": {
"quadrantOverview": "Quadrant Overview"
},
"pageIndex": {
"publishedLabel": "Quadrant Overview"
},
"legalInformationLink": "https://www.aoe.com/en/imprint.html",
"search": "What are you looking for?"
}

View File

@@ -7,6 +7,7 @@ import Fadeable from "../Fadeable/Fadeable";
import SetTitle from "../SetTitle";
import { radarName, radarNameShort } from "../../config";
import { MomentInput } from "moment";
import { useMessages } from "../../context/MessagesContext";
type PageIndexProps = {
leaving: boolean;
@@ -21,6 +22,9 @@ export default function PageIndex({
items,
releases,
}: PageIndexProps) {
const { pageIndex } = useMessages();
const publishedLabel = pageIndex?.publishedLabel || 'Published';
const newestRelease = releases.slice(-1)[0];
const numberOfReleases = releases.length;
return (
@@ -33,7 +37,7 @@ export default function PageIndex({
</div>
<QuadrantGrid items={featuredOnly(items)} />
<div className="publish-date">
Published {formatRelease(newestRelease)}
{publishedLabel} {formatRelease(newestRelease)}
</div>
</Fadeable>
);

View File

@@ -35,6 +35,10 @@ interface PageItem {
quadrantOverview: string;
}
interface PageIndex {
publishedLabel: string;
}
export interface Messages {
footerFootnote?: string;
socialLinks?: SocialLink[];
@@ -42,6 +46,7 @@ export interface Messages {
pageHelp?: PageHelp;
pageOverview?: PageOverview;
pageItem?: PageItem;
pageIndex?: PageIndex;
searchPlaceholder?: string;
}