feat(PageItem): make PageItem back to quadrant overview text configurable
This commit is contained in:
committed by
Bastian
parent
0e180cc841
commit
a509e0a0da
@@ -87,6 +87,9 @@
|
|||||||
"pageOverview": {
|
"pageOverview": {
|
||||||
"title": "Technologies Overview"
|
"title": "Technologies Overview"
|
||||||
},
|
},
|
||||||
|
"pageItem": {
|
||||||
|
"quadrantOverview": "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?"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,9 @@
|
|||||||
"pageOverview": {
|
"pageOverview": {
|
||||||
"title": "Technologies Overview"
|
"title": "Technologies Overview"
|
||||||
},
|
},
|
||||||
|
"pageItem": {
|
||||||
|
"quadrantOverview": "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?"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
groupByQuadrants,
|
groupByQuadrants,
|
||||||
Item,
|
Item,
|
||||||
} from "../../model";
|
} from "../../model";
|
||||||
|
import { useMessages } from "../../context/MessagesContext";
|
||||||
|
|
||||||
const getItem = (pageName: string, items: Item[]) => {
|
const getItem = (pageName: string, items: Item[]) => {
|
||||||
const [quadrantName, itemName] = pageName.split("/");
|
const [quadrantName, itemName] = pageName.split("/");
|
||||||
@@ -33,6 +34,9 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const PageItem: React.FC<Props> = ({ pageName, items, leaving, onLeave }) => {
|
const PageItem: React.FC<Props> = ({ pageName, items, leaving, onLeave }) => {
|
||||||
|
const { pageItem } = useMessages();
|
||||||
|
const quadrantOverview = pageItem?.quadrantOverview || 'Quadrant Overview';
|
||||||
|
|
||||||
const itemsInRing = getItemsInRing(pageName, items);
|
const itemsInRing = getItemsInRing(pageName, items);
|
||||||
|
|
||||||
const { getAnimationState, getAnimationStates } = useAnimations({
|
const { getAnimationState, getAnimationStates } = useAnimations({
|
||||||
@@ -70,7 +74,7 @@ const PageItem: React.FC<Props> = ({ pageName, items, leaving, onLeave }) => {
|
|||||||
<div className="split__right">
|
<div className="split__right">
|
||||||
<Link className="icon-link" pageName={item.quadrant}>
|
<Link className="icon-link" pageName={item.quadrant}>
|
||||||
<span className="icon icon--pie icon-link__icon" />
|
<span className="icon icon--pie icon-link__icon" />
|
||||||
Quadrant Overview
|
{quadrantOverview}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,12 +31,17 @@ interface PageOverview {
|
|||||||
title: string;
|
title: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface PageItem {
|
||||||
|
quadrantOverview: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Messages {
|
export interface Messages {
|
||||||
footerFootnote?: string;
|
footerFootnote?: string;
|
||||||
socialLinks?: SocialLink[];
|
socialLinks?: SocialLink[];
|
||||||
legalInformationLink?: string;
|
legalInformationLink?: string;
|
||||||
pageHelp?: PageHelp;
|
pageHelp?: PageHelp;
|
||||||
pageOverview?: PageOverview;
|
pageOverview?: PageOverview;
|
||||||
|
pageItem?: PageItem;
|
||||||
searchPlaceholder?: string;
|
searchPlaceholder?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user