forked from AOEpeople/aoe_technology_radar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
66 lines (55 loc) · 1.41 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { FC, createContext, useContext } from "react";
import { Props as SocialLink } from "../../components/SocialLink/SocialLink";
interface Quadrant {
name: string;
description: string;
}
interface Paragraph {
headline: string;
values: string[];
}
interface PageHelp {
paragraphs: Paragraph[];
quadrantsPreDescription?: string;
quadrants: Quadrant[];
rings: { name: string; description: string }[];
ringsPreDescription?: string;
sourcecodeLink?: {
href: string;
name: string;
description: string;
};
headlinePrefix?: string;
}
interface PageOverview {
title: string;
}
interface PageItem {
quadrantOverview: string;
}
interface PageIndex {
publishedLabel: string;
}
export interface Messages {
footerFootnote?: string;
socialLinksLabel?: string;
socialLinks?: SocialLink[];
legalInformationLabel?: string;
legalInformationLink?: string;
pageHelp?: PageHelp;
pageOverview?: PageOverview;
pageItem?: PageItem;
pageIndex?: PageIndex;
searchLabel?: string;
searchPlaceholder?: string;
revisionsText?: string;
}
const MessagesContext = createContext<Messages | undefined>(undefined);
export const MessagesProvider: FC<
React.PropsWithChildren<{ messages?: Messages }>
> = ({ messages, children }) => (
<MessagesContext.Provider value={messages}>
{children}
</MessagesContext.Provider>
);
export const useMessages = () => useContext(MessagesContext) || {};