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": { "pageItem": {
"quadrantOverview": "Quadrant Overview" "quadrantOverview": "Quadrant Overview"
}, },
"pageIndex": {
"publishedLabel": "Quadrant Overview"
},
"legalInformationLink": "https://www.aoe.com/en/imprint.html", "legalInformationLink": "https://www.aoe.com/en/imprint.html",
"search": "What are you looking for?" "search": "What are you looking for?"
} }

View File

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

View File

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

View File

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