committed by
Bastian
parent
8d28e4c3a3
commit
70ea8d5bcd
@@ -1,34 +1,19 @@
|
||||
import { Item } from "./model";
|
||||
|
||||
export interface ConfigData {
|
||||
quadrants: { [key: string]: string };
|
||||
rings: string[];
|
||||
}
|
||||
|
||||
export const radarName =
|
||||
process.env.REACT_APP_RADAR_NAME || "AOE Technology Radar";
|
||||
export const radarNameShort = radarName;
|
||||
|
||||
export const quadrants = [
|
||||
"languages-and-frameworks",
|
||||
"methods-and-patterns",
|
||||
"platforms-and-aoe-services",
|
||||
"tools",
|
||||
];
|
||||
|
||||
export const rings = ["all", "adopt", "trial", "assess", "hold"] as const;
|
||||
|
||||
export type Ring = typeof rings[number];
|
||||
|
||||
export const getItemPageNames = (items: Item[]) =>
|
||||
items.map((item) => `${item.quadrant}/${item.name}`);
|
||||
|
||||
export const showEmptyRings = false;
|
||||
|
||||
const messages: { [k: string]: string } = {
|
||||
"languages-and-frameworks": "Languages & Frameworks",
|
||||
"methods-and-patterns": "Methods & Patterns",
|
||||
"platforms-and-aoe-services": "Platforms & Operations",
|
||||
tools: "Tools",
|
||||
};
|
||||
|
||||
export const translate = (key: string) => messages[key] || "-";
|
||||
|
||||
export function isMobileViewport() {
|
||||
// return false for server side rendering
|
||||
if (typeof window == "undefined") return false;
|
||||
@@ -43,3 +28,7 @@ export function isMobileViewport() {
|
||||
export function assetUrl(file: string) {
|
||||
return process.env.PUBLIC_URL + "/" + file;
|
||||
}
|
||||
|
||||
export function translate(config: ConfigData, key: string) {
|
||||
return config.quadrants[key] || "-";
|
||||
}
|
||||
Reference in New Issue
Block a user