feat(PageIndex): make PageIndex published text configurable
This commit is contained in:
committed by
Bastian
parent
a509e0a0da
commit
265a8318b0
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user