Merge pull request #87 from AOEpeople/extractAoeSpecificTexts

Extract AOE specific texts as messages.json
This commit is contained in:
Achim Rolle
2021-07-01 16:19:52 +02:00
committed by GitHub
10 changed files with 459 additions and 289 deletions

1
.gitignore vendored
View File

@@ -13,6 +13,7 @@
# local development # local development
/public/rd.json /public/rd.json
/public/messages.json
# misc # misc
.idea .idea

View File

@@ -34,6 +34,99 @@ For reference have a look at [public/logo.svg](./public/logo.svg).
To change the index.html, create a public folder in your application and put your index.html in it. To change the index.html, create a public folder in your application and put your index.html in it.
For reference have a look at [public/index.html](./public/index.html). For reference have a look at [public/index.html](./public/index.html).
### Add social links to the footer and sidebar
To add social links, create a public folder in your application and put a messages.json in it.
```json
{
"socialLinks": [
{ "href": "https://www.facebook.com/aoepeople", "iconName": "facebook" },
{ "href": "https://twitter.com/aoepeople", "iconName": "twitter" },
{ "href": "https://www.linkedin.com/company/aoe", "iconName": "linkedIn" }
]
}
```
> For more information and the possible icon names see the source code of the [SocialLink Component](./src/components/SocialLink/SocialLink.tsx).
### Add a legal information link to the footer and sidebar
To add a link to legal information, create a public folder in your application and put a messages.json in it.
```json
{
"legalInformationLink": "https://www.aoe.com/en/imprint.html"
}
```
### Add a footnote with the logo to the footer
To add a footnote to the footer, create a public folder in your application and put a messages.json in it.
```json
{
"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."
}
```
### Add a help page with explanations
To add a help page, create a public folder in your application and put a messages.json in it.
```json
{
"pageHelp": {
"paragraphs": [
{
"headline": "Introduction",
"values": [
"Technology is moving fast and new technologies and innovations appear continuously.",
"It's essential for a development and technology company such as AOE to constantly improve and keep track with the latest useful innovations. It is important to openly look for innovations and new technologies and to question established technologies and methods every now and then.",
"But, it is also important to wisely choose which technologies to use in our daily work and in the different projects we are carrying out. As we all know: There is no silver bullet."
]
},
{
"headline": "What is the AOE Technology Radar",
"values": [
"The Tech Radar is an overview of different technologies - from languages, frameworks, tools and patterns to platforms - that we consider \"new or mentionable\". The radar therefore doesn't provide an overview of all established technologies - but it focuses on items that have recently gained in importance or changed."
]
}
],
"quadrants": [
{
"name": "Languages and Frameworks",
"description": "We've placed development languages (such as Scala or Golang) here, as well as more low-level development frameworks (such as Play or Symfony), which are useful for implementing custom software of all kinds."
},
{
"name": "Tools",
"description": "Here we put different software tools - from small helpers to bigger software projects"
},
{
"name": "Methods and Patterns",
"description": "Patterns are so important, and a lot of them are valid for a long time (compared to some tools or frameworks). So, this is the category where we put information on methods and patterns concerning development, continuous x, testing, organization, architecture, etc."
},
{
"name": "Platforms and Operations",
"description": "(including AOE internal Services): Here we include infrastructure platforms and services. We also use this category to communicate news about AOE services that we want all AOE teams to be aware of."
}
],
"rings": [
{
"name": "Adopt",
"description": "We can clearly recommend this technology. We have used it for longer period of time in many teams and it has proven to be stable and useful."
},
{
"name": "Trial",
"description": "We have used it with success and recommend to have a closer look at the technology in this ring. The goal of items here is to look at them more closely, with the goal to bring them to the adopt level."
},
{
"name": "Assess",
"description": "We have tried it out and we find it promising. We recommend having a look at these items when you face a specific need for the technology in your project."
},
{
"name": "Hold",
"description": "This category is a bit special. Unlike the others, we recommend to stop doing or using something. That does not mean that they are bad and it often might be ok to use them in existing projects. But we move things here if we think we shouldn't do them anymore - because we see better options or alternatives now."
}
]
}
}
```
> For more information see the source code of the [Messages Context](./src/context/MessagesContext/index.tsx).
## Use and build the radar ## Use and build the radar
> Set the environment variable `PUBLIC_URL` properly. For more information see [Host the application under a sub path](#host-the-application-under-a-sub-path) > Set the environment variable `PUBLIC_URL` properly. For more information see [Host the application under a sub path](#host-the-application-under-a-sub-path)
@@ -115,7 +208,8 @@ You can integrate images in your markdown. Put the image files in your public fo
``` ```
## Development ## Development
For local development you need a `rd.json` in the public folder. You can use `rd_example.json`. For local development you need a `rd.json` in the public folder. You can use [rd_example.json](./rd_example.json).
For several customizations you need a `messages.json` in the public folder. You can use [messages_example.json](./messages_example.json).
Then simply start the dev server Then simply start the dev server
``` ```

88
messages_example.json Normal file
View File

@@ -0,0 +1,88 @@
{
"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.",
"socialLinks": [
{ "href": "https://www.facebook.com/aoepeople", "iconName": "facebook" },
{ "href": "https://twitter.com/aoepeople", "iconName": "twitter" },
{ "href": "https://www.linkedin.com/company/aoe", "iconName": "linkedIn" },
{ "href": "https://www.xing.com/company/aoe", "iconName": "xing" },
{ "href": "https://www.instagram.com/aoepeople", "iconName": "instagram" },
{ "href": "https://www.youtube.com/user/aoepeople", "iconName": "youtube" },
{ "href": "https://github.com/aoepeople", "iconName": "github" }
],
"pageHelp": {
"paragraphs": [
{
"headline": "Introduction",
"values": [
"Technology is moving fast and new technologies and innovations appear continuously.",
"It's essential for a development and technology company such as AOE to constantly improve and keep track with the latest useful innovations. It is important to openly look for innovations and new technologies and to question established technologies and methods every now and then.",
"But, it is also important to wisely choose which technologies to use in our daily work and in the different projects we are carrying out. As we all know: There is no silver bullet."
]
},
{
"headline": "What is the AOE Technology Radar",
"values": [
"The Tech Radar is an overview of different technologies - from languages, frameworks, tools and patterns to platforms - that we consider \"new or mentionable\". The radar therefore doesn't provide an overview of all established technologies - but it focuses on items that have recently gained in importance or changed."
]
},
{
"headline": "How it is created",
"values": [
"The items in the technology radar are raised by the different teams and therefore a lot of the items are related to the work and challenges the teams face in the different projects. In fact, we don't include anything on the radar, which we haven't already tried ourselves at least once.",
"There have been a lot of valuable discussions in different expert groups about the classification and details of each of technologies and innovations. And the result of all this can be found in the latest technology radar."
]
},
{
"headline": "How should it be used",
"values": [
"The radar acts as an overview of technologies that we think everyone in the teams should currently know about.",
"Its goal is to act as a guide and inspiration for the daily work in the teams. Its purpose is also to provide helpful information and a bird's-eye perspective - so that decisions can be taken with a much deeper understanding of the subject matter. This results in more-informed and better-aligned decisions.",
"We also hope that developers outside of AOE find the information in our technology overview inspirational.",
"We group or categorize the items in 4 quadrants - (sometimes, when it's not 100% clear where a item belongs, we choose the best fit)."
]
}
],
"quadrants": [
{
"name": "Languages and Frameworks",
"description": "We've placed development languages (such as Scala or Golang) here, as well as more low-level development frameworks (such as Play or Symfony), which are useful for implementing custom software of all kinds."
},
{
"name": "Tools",
"description": "Here we put different software tools - from small helpers to bigger software projects"
},
{
"name": "Methods and Patterns",
"description": "Patterns are so important, and a lot of them are valid for a long time (compared to some tools or frameworks). So, this is the category where we put information on methods and patterns concerning development, continuous x, testing, organization, architecture, etc."
},
{
"name": "Platforms and Operations",
"description": "(including AOE internal Services): Here we include infrastructure platforms and services. We also use this category to communicate news about AOE services that we want all AOE teams to be aware of."
}
],
"rings": [
{
"name": "Adopt",
"description": "We can clearly recommend this technology. We have used it for longer period of time in many teams and it has proven to be stable and useful."
},
{
"name": "Trial",
"description": "We have used it with success and recommend to have a closer look at the technology in this ring. The goal of items here is to look at them more closely, with the goal to bring them to the adopt level."
},
{
"name": "Assess",
"description": "We have tried it out and we find it promising. We recommend having a look at these items when you face a specific need for the technology in your project."
},
{
"name": "Hold",
"description": "This category is a bit special. Unlike the others, we recommend to stop doing or using something. That does not mean that they are bad and it often might be ok to use them in existing projects. But we move things here if we think we shouldn't do them anymore - because we see better options or alternatives now."
}
],
"sourcecodeLinks": {
"href": "https://github.com/AOEpeople/aoe_technology_radar",
"name": "AOE Tech Radar on Github",
"description": "Contributions and source code of the AOE Tech Radar are on github:"
}
},
"legalInformationLink": "https://www.aoe.com/en/imprint.html"
}

View File

@@ -12,15 +12,31 @@ import {
useLocation, useLocation,
} from "react-router-dom"; } from "react-router-dom";
import { Item } from "../model"; import { Item } from "../model";
import { Messages, MessagesProvider } from "../context/MessagesContext";
interface Params { interface Params {
page: string; page: string;
} }
const useQuery = () => { const useFetch = <D extends unknown>(url: string): D | undefined => {
return new URLSearchParams(useLocation().search); const [data, setData] = React.useState<D>();
React.useEffect(() => {
fetch(url)
.then((response) => response.json())
.then((data: D) => {
setData(data);
})
.catch((error) => {
console.error(`fetch ${url} failed. Did the file exist?`, error);
});
}, []);
return data;
}; };
const useQuery = () => new URLSearchParams(useLocation().search);
const RouterWithPageParam = ({ const RouterWithPageParam = ({
items, items,
releases, releases,
@@ -59,21 +75,15 @@ interface Data {
} }
export default function App() { export default function App() {
const [data, setData] = React.useState<Data>(); const data = useFetch<Data>(`${process.env.PUBLIC_URL}/rd.json`);
React.useEffect(() => { const messages = useFetch<Messages>(
fetch(`${process.env.PUBLIC_URL}/rd.json`) `${process.env.PUBLIC_URL}/messages.json`
.then((response) => response.json()) );
.then((data: Data) => {
setData(data);
})
.catch((error) => {
console.error("fetch data", error);
});
}, []);
if (data) { if (data) {
const { items, releases } = data; const { items, releases } = data;
return ( return (
<MessagesProvider messages={messages}>
<BrowserRouter basename={`${process.env.PUBLIC_URL}`}> <BrowserRouter basename={`${process.env.PUBLIC_URL}`}>
<Switch> <Switch>
<Route path={"/:page(.+).html"}> <Route path={"/:page(.+).html"}>
@@ -96,6 +106,7 @@ export default function App() {
</Route> </Route>
</Switch> </Switch>
</BrowserRouter> </BrowserRouter>
</MessagesProvider>
); );
} }

View File

@@ -5,13 +5,16 @@ import FooterEnd from "../FooterEnd/FooterEnd";
import { assetUrl, getItemPageNames, isMobileViewport } from "../../config"; import { assetUrl, getItemPageNames, isMobileViewport } from "../../config";
import { Item } from "../../model"; import { Item } from "../../model";
import "./footer.scss"; import "./footer.scss";
export default function Footer({ import { useMessages } from "../../context/MessagesContext";
items,
pageName, interface Props {
}: {
items: Item[]; items: Item[];
pageName: string; pageName: string;
}) { }
const Footer: React.FC<Props> = ({ items, pageName }) => {
const { footerFootnote } = useMessages();
return ( return (
<div <div
className={classNames("footer", { className={classNames("footer", {
@@ -19,22 +22,25 @@ export default function Footer({
!isMobileViewport() && getItemPageNames(items).includes(pageName), !isMobileViewport() && getItemPageNames(items).includes(pageName),
})} })}
> >
{footerFootnote && (
<Branding <Branding
modifier="footer" modifier="footer"
logoContent={ logoContent={
<img src={assetUrl("logo.svg")} width="150px" height="60px" alt="" /> <img
src={assetUrl("logo.svg")}
width="150px"
height="60px"
alt=""
/>
} }
> >
<span className="footnote"> <span className="footnote">{footerFootnote}</span>
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.
</span>
</Branding> </Branding>
)}
<FooterEnd /> <FooterEnd />
</div> </div>
); );
} };
export default Footer;

View File

@@ -1,99 +1,42 @@
import React from "react"; import React from "react";
import classNames from "classnames"; import classNames from "classnames";
import { import SocialLink from "../SocialLink/SocialLink";
FaFacebookF,
FaTwitter,
FaLinkedinIn,
FaXing,
FaYoutube,
FaGithub,
FaInstagram,
} from "react-icons/fa";
import "./footerend.scss"; import "./footerend.scss";
import { useMessages } from "../../context/MessagesContext";
interface Props { interface Props {
modifier?: "in-sidebar"; modifier?: "in-sidebar";
} }
const FooterEnd: React.FC<Props> = ({ modifier }) => ( const FooterEnd: React.FC<Props> = ({ modifier }) => {
const { socialLinks, legalInformationLink } = useMessages();
return (
<div <div
className={classNames("footer-end", { className={classNames("footer-end", {
[`footer-end__${modifier}`]: modifier, [`footer-end__${modifier}`]: modifier,
})} })}
> >
<div className="footer-social"> <div className="footer-social">
{socialLinks && (
<>
<div className="footer-social__label"> <div className="footer-social__label">
<p>Follow us:</p> <p>Follow us:</p>
</div> </div>
<div className="footer-social__links"> <div className="footer-social__links">
<a {socialLinks.map(({ href, iconName }) => (
href="https://www.facebook.com/aoepeople" <SocialLink href={href} iconName={iconName} key={iconName} />
target="_blank" ))}
rel="noopener noreferrer"
className="social-icon-a"
>
<FaFacebookF className="social-icon" />
</a>
<a
href="https://twitter.com/aoepeople"
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<FaTwitter className="social-icon" />
</a>
<a
href="https://www.linkedin.com/company/aoe"
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<FaLinkedinIn className="social-icon" />
</a>
<a
href="https://www.xing.com/company/aoe"
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<FaXing className="social-icon" />
</a>
<a
href="https://www.instagram.com/aoepeople"
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<FaInstagram className="social-icon" />
</a>
<a
href="https://www.youtube.com/user/aoepeople"
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<FaYoutube className="social-icon" />
</a>
<a
href="https://github.com/aoepeople"
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<FaGithub className="social-icon" />
</a>
</div> </div>
</>
)}
</div> </div>
{legalInformationLink && (
<div className="footer-copyright"> <div className="footer-copyright">
<p> <p>
<a <a
href="https://www.aoe.com/en/imprint.html" href={legalInformationLink}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
@@ -101,7 +44,9 @@ const FooterEnd: React.FC<Props> = ({ modifier }) => (
</a> </a>
</p> </p>
</div> </div>
)}
</div> </div>
); );
};
export default FooterEnd; export default FooterEnd;

View File

@@ -7,10 +7,12 @@ import Search from "../Search/Search";
import { radarNameShort } from "../../config"; import { radarNameShort } from "../../config";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import qs from "query-string"; import qs from "query-string";
import { useMessages } from "../../context/MessagesContext";
export default function Header({ pageName }: { pageName: string }) { export default function Header({ pageName }: { pageName: string }) {
const [searchOpen, setSearchOpen] = useState(false); const [searchOpen, setSearchOpen] = useState(false);
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const { pageHelp } = useMessages();
const history = useHistory(); const history = useHistory();
const searchRef = useRef<HTMLInputElement>(null); const searchRef = useRef<HTMLInputElement>(null);
@@ -49,12 +51,14 @@ export default function Header({ pageName }: { pageName: string }) {
return ( return (
<Branding logoContent={<LogoLink small={smallLogo} />}> <Branding logoContent={<LogoLink small={smallLogo} />}>
<div className="nav"> <div className="nav">
{pageHelp && (
<div className="nav__item"> <div className="nav__item">
<Link pageName="help-and-about-tech-radar" className="icon-link"> <Link pageName="help-and-about-tech-radar" className="icon-link">
<span className="icon icon--question icon-link__icon" /> <span className="icon icon--question icon-link__icon" />
How to Use {radarNameShort}? How to Use {radarNameShort}?
</Link> </Link>
</div> </div>
)}
<div className="nav__item"> <div className="nav__item">
<Link pageName="overview" className="icon-link"> <Link pageName="overview" className="icon-link">
<span className="icon icon--overview icon-link__icon" /> <span className="icon icon--overview icon-link__icon" />

View File

@@ -3,141 +3,68 @@ import HeroHeadline from "../HeroHeadline/HeroHeadline";
import Fadeable from "../Fadeable/Fadeable"; import Fadeable from "../Fadeable/Fadeable";
import SetTitle from "../SetTitle"; import SetTitle from "../SetTitle";
import { radarName } from "../../config"; import { radarName } from "../../config";
import { useMessages } from "../../context/MessagesContext";
export default function PageHelp({ interface Props {
leaving,
onLeave,
}: {
leaving: boolean; leaving: boolean;
onLeave: () => void; onLeave: () => void;
}) { }
const PageHelp: React.FC<Props> = ({ leaving, onLeave }) => {
const { pageHelp } = useMessages();
if (pageHelp) {
const { paragraphs, quadrants, rings, sourcecodeLink } = pageHelp;
return ( return (
<Fadeable leaving={leaving} onLeave={onLeave}> <Fadeable leaving={leaving} onLeave={onLeave}>
<SetTitle title={"How to use the " + radarName} /> <SetTitle title={"How to use the " + radarName} />
<HeroHeadline>How to use the {radarName}</HeroHeadline> <HeroHeadline>How to use the {radarName}</HeroHeadline>
<div className="fullpage-content"> <div className="fullpage-content">
<h3>Introduction</h3> {paragraphs.map(({ headline, values }) => (
<p> <React.Fragment key={headline}>
Technology is moving fast and new technologies and innovations appear <h3>{headline}</h3>
continuously. {values.map((element, index) => (
</p> <p key={index}>{element}</p>
<p> ))}
It's essential for a development and technology company such as AOE to </React.Fragment>
constantly improve and keep track with the latest useful innovations. ))}
It is important to openly look for innovations and new technologies
and to question established technologies and methods every now and
then.
</p>
<p>
But, it is also important to wisely choose which technologies to use
in our daily work and in the different projects we are carrying out.
As we all know: There is no silver bullet.
</p>
<h3>What is the {radarName}</h3>
<p>
The Tech Radar is an overview of different technologies - from
languages, frameworks, tools and patterns to platforms - that we
consider "new or mentionable". The radar therefore doesn't provide an
overview of all established technologies - but it focuses on items
that have recently gained in importance or changed.
</p>
<h3>How it is created</h3>
<p>
The items in the technology radar are raised by the different teams
and therefore a lot of the items are related to the work and
challenges the teams face in the different projects. In fact, we don't
include anything on the radar, which we haven't already tried
ourselves at least once.
</p>
<p>
There have been a lot of valuable discussions in different expert
groups about the classification and details of each of technologies
and innovations. And the result of all this can be found in the latest
technology radar.
</p>
<h3>How should it be used</h3>
<p>
The radar acts as an overview of technologies that we think everyone
in the teams should currently know about.
</p>
<p>
Its goal is to act as a guide and inspiration for the daily work in
the teams. Its purpose is also to provide helpful information and a
bird's-eye perspective - so that decisions can be taken with a much
deeper understanding of the subject matter. This results in
more-informed and better-aligned decisions.
</p>
<p>
We also hope that developers outside of AOE find the information in
our technology overview inspirational.
</p>
<p>
We group or categorize the items in 4 quadrants - (sometimes, when
it's not 100% clear where a item belongs, we choose the best fit).
</p>
<p>The quadrants are:</p> <p>The quadrants are:</p>
<ul> <ul>
<li> {quadrants.map(({ name, description }) => (
<strong>Languages and Frameworks:</strong> We've placed development <li key={name}>
languages (such as Scala or Golang) here, as well as more low-level <strong>{name}:</strong> {description}
development frameworks (such as Play or Symfony), which are useful
for implementing custom software of all kinds.
</li>
<li>
<strong>Tools:</strong> Here we put different software tools - from
small helpers to bigger software projects
</li>
<li>
<strong>Methods and Patterns:</strong> Patterns are so important,
and a lot of them are valid for a long time (compared to some tools
or frameworks). So, this is the category where we put information on
methods and patterns concerning development, continuous x, testing,
organization, architecture, etc.
</li>
<li>
<strong>Platforms and Services</strong> (including AOE internal
Services): Here we include infrastructure platforms and services. We
also use this category to communicate news about AOE services that
we want all AOE teams to be aware of.
</li> </li>
))}
</ul> </ul>
<p>Each of the items is classified in one of these rings:</p> <p>Each of the items is classified in one of these rings:</p>
<ul> <ul>
<li> {rings.map(({ name, description }) => (
<strong>Adopt:</strong> We can clearly recommend this technology. We <li key={name}>
have used it for longer period of time in many teams and it has <strong>{name}:</strong> {description}
proven to be stable and useful.
</li>
<li>
<strong>Trial:</strong> We have used it with success and recommend
to have a closer look at the technology in this ring. The goal of
items here is to look at them more closely, with the goal to bring
them to the adopt level.
</li>
<li>
<strong>Assess:</strong> We have tried it out and we find it
promising. We recommend having a look at these items when you face a
specific need for the technology in your project.
</li>
<li>
<strong>Hold:</strong> This category is a bit special. Unlike the
others, we recommend to stop doing or using something. That does not
mean that they are bad and it often might be ok to use them in
existing projects. But we move things here if we think we shouldn't
do them anymore - because we see better options or alternatives now.
</li> </li>
))}
</ul> </ul>
{sourcecodeLink && (
<p> <p>
Contributions and source code of the radar are on github:{" "} {`${sourcecodeLink.description} `}
<a <a
href="https://github.com/AOEpeople/aoe_technology_radar" href={sourcecodeLink.href}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
AOE Tech Radar on Github {sourcecodeLink.name}
</a> </a>
</p> </p>
)}
</div> </div>
</Fadeable> </Fadeable>
); );
} }
return null;
};
export default PageHelp;

View File

@@ -0,0 +1,46 @@
import React from "react";
import {
FaFacebookF,
FaTwitter,
FaLinkedinIn,
FaXing,
FaYoutube,
FaGithub,
FaInstagram,
} from "react-icons/fa";
const icons = {
facebook: FaFacebookF,
twitter: FaTwitter,
linkedIn: FaLinkedinIn,
xing: FaXing,
instagram: FaInstagram,
youtube: FaYoutube,
github: FaGithub,
};
export interface Props {
href: string;
iconName: keyof typeof icons;
}
const SocialLink: React.FC<Props> = ({ href, iconName }) => {
const Icon = icons[iconName];
if (Icon) {
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="social-icon-a"
>
<Icon className="social-icon" />
</a>
);
}
console.error(`The iconname is unknown: ${iconName}`);
return null;
};
export default SocialLink;

View File

@@ -0,0 +1,48 @@
import { createContext, FC, useContext } from "react";
import { Props as SocialLink } from "../../components/SocialLink/SocialLink";
interface Quadrant {
name: string;
description: string;
}
interface Ring {
name: string;
description: string;
}
interface Paragraph {
headline: string;
values: string[];
}
interface PageHelp {
paragraphs: Paragraph[];
quadrants: Quadrant[];
rings: Ring[];
sourcecodeLink?: {
href: string;
name: string;
description: string;
};
}
export interface Messages {
footerFootnote?: string;
socialLinks?: SocialLink[];
legalInformationLink?: string;
pageHelp?: PageHelp;
}
const MessagesContext = createContext<Messages | undefined>(undefined);
export const MessagesProvider: FC<{ messages?: Messages }> = ({
messages,
children,
}) => (
<MessagesContext.Provider value={messages}>
{children}
</MessagesContext.Provider>
);
export const useMessages = () => useContext(MessagesContext) || {};