From 8b052b6221fdf5b28132f11a8b110ab66f877a3f Mon Sep 17 00:00:00 2001 From: Danny Koppenhagen Date: Tue, 26 Oct 2021 20:29:07 +0200 Subject: [PATCH] feat(Footer): make Footer texts configurable --- messages_example.json | 2 ++ public/messages.json | 2 ++ src/components/FooterEnd/FooterEnd.tsx | 6 +++--- src/context/MessagesContext/index.tsx | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/messages_example.json b/messages_example.json index f2592d7..185a597 100644 --- a/messages_example.json +++ b/messages_example.json @@ -1,5 +1,6 @@ { "footerFootnote": "AOE is a leading global provider of services for digital transformation and digital business models. AOE relies exclusively on established Enterprise Open Source technologies. This leads to innovative solutions, digital products and portals in agile software projects, and helps build long-lasting, strategic partnerships with our customers.", + "socialLinksLabel": "Follow us:", "socialLinks": [ { "href": "https://www.facebook.com/aoepeople", "iconName": "facebook" }, { "href": "https://twitter.com/aoepeople", "iconName": "twitter" }, @@ -97,6 +98,7 @@ "publishedLabel": "Quadrant Overview" }, "legalInformationLink": "https://www.aoe.com/en/imprint.html", + "legalInformationLabel": "Legal Information", "searchLabel": "Search", "searchPlaceholder": "What are you looking for?", "revisionsText": "Revisions:" diff --git a/public/messages.json b/public/messages.json index f2592d7..185a597 100644 --- a/public/messages.json +++ b/public/messages.json @@ -1,5 +1,6 @@ { "footerFootnote": "AOE is a leading global provider of services for digital transformation and digital business models. AOE relies exclusively on established Enterprise Open Source technologies. This leads to innovative solutions, digital products and portals in agile software projects, and helps build long-lasting, strategic partnerships with our customers.", + "socialLinksLabel": "Follow us:", "socialLinks": [ { "href": "https://www.facebook.com/aoepeople", "iconName": "facebook" }, { "href": "https://twitter.com/aoepeople", "iconName": "twitter" }, @@ -97,6 +98,7 @@ "publishedLabel": "Quadrant Overview" }, "legalInformationLink": "https://www.aoe.com/en/imprint.html", + "legalInformationLabel": "Legal Information", "searchLabel": "Search", "searchPlaceholder": "What are you looking for?", "revisionsText": "Revisions:" diff --git a/src/components/FooterEnd/FooterEnd.tsx b/src/components/FooterEnd/FooterEnd.tsx index ae2c922..3278b61 100644 --- a/src/components/FooterEnd/FooterEnd.tsx +++ b/src/components/FooterEnd/FooterEnd.tsx @@ -9,7 +9,7 @@ interface Props { } const FooterEnd: React.FC = ({ modifier }) => { - const { socialLinks, legalInformationLink } = useMessages(); + const { socialLinksLabel, socialLinks, legalInformationLink, legalInformationLabel } = useMessages(); return (
= ({ modifier }) => { {socialLinks && ( <>
-

Follow us:

+

{socialLinksLabel ?? 'Follow us:' }

{socialLinks.map(({ href, iconName }) => ( @@ -40,7 +40,7 @@ const FooterEnd: React.FC = ({ modifier }) => { target="_blank" rel="noopener noreferrer" > - Legal Information + {legalInformationLabel || 'Legal Information'}

diff --git a/src/context/MessagesContext/index.tsx b/src/context/MessagesContext/index.tsx index d1b5732..0644a8c 100644 --- a/src/context/MessagesContext/index.tsx +++ b/src/context/MessagesContext/index.tsx @@ -44,7 +44,9 @@ interface PageIndex { export interface Messages { footerFootnote?: string; + socialLinksLabel?: string; socialLinks?: SocialLink[]; + legalInformationLabel?: string; legalInformationLink?: string; pageHelp?: PageHelp; pageOverview?: PageOverview;