feat: config.json option to show empty rings

The `showEmptyRings` option in `config.ts` can now be set via
`config.json`. This enables display of headers for rings that contain no
items.
This commit is contained in:
Tom Clift
2021-11-26 16:39:26 +11:00
committed by Bastian
parent 5c37fdf26e
commit cba3767195
5 changed files with 20 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import { Item } from "./model";
export interface ConfigData {
quadrants: { [key: string]: string };
rings: string[];
showEmptyRings: boolean;
}
export const radarName =
@@ -12,8 +13,6 @@ export const radarNameShort = radarName;
export const getItemPageNames = (items: Item[]) =>
items.map((item) => `${item.quadrant}/${item.name}`);
export const showEmptyRings = false;
export function isMobileViewport() {
// return false for server side rendering
if (typeof window == "undefined") return false;
@@ -31,4 +30,4 @@ export function assetUrl(file: string) {
export function translate(config: ConfigData, key: string) {
return config.quadrants[key] || "-";
}
}