Skip to content

Commit

Permalink
feat(RevisionsText): make RevisionsText prefix configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen authored and bastianccm committed Nov 10, 2021
1 parent 1e34332 commit 9d2efc1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion messages_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
"publishedLabel": "Quadrant Overview"
},
"legalInformationLink": "https://www.aoe.com/en/imprint.html",
"search": "What are you looking for?"
"search": "What are you looking for?",
"revisionsText": "Revisions:"
}
3 changes: 2 additions & 1 deletion public/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
"publishedLabel": "Quadrant Overview"
},
"legalInformationLink": "https://www.aoe.com/en/imprint.html",
"search": "What are you looking for?"
"search": "What are you looking for?",
"revisionsText": "Revisions:"
}
4 changes: 3 additions & 1 deletion src/components/ItemRevisions/ItemRevisions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import HeadlineGroup from "../HeadlineGroup/HeadlineGroup";
import ItemRevision from "../ItemRevision/ItemRevision";
import { Revision } from "../../model";
import "./item-revisions.scss";
import { useMessages } from "../../context/MessagesContext";
export default function ItemRevisions({
revisions,
}: {
revisions: Revision[];
}) {
const { revisionsText } = useMessages();
return (
<div className="item-revisions">
<HeadlineGroup secondary>
<h4 className="headline headline--dark">Revisions:</h4>
<h4 className="headline headline--dark">{revisionsText ?? 'Revisions:'}</h4>
</HeadlineGroup>

{revisions.map((revision) => (
Expand Down
1 change: 1 addition & 0 deletions src/context/MessagesContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface Messages {
pageItem?: PageItem;
pageIndex?: PageIndex;
searchPlaceholder?: string;
revisionsText?: string;
}

const MessagesContext = createContext<Messages | undefined>(undefined);
Expand Down

0 comments on commit 9d2efc1

Please sign in to comment.