feat: add config, types and add basic quadrant page
This commit is contained in:
committed by
Mathias Schopmans
parent
2e0f320424
commit
57d7e85331
@@ -1,5 +0,0 @@
|
||||
import messages from "../../public/messages.json";
|
||||
|
||||
export function getAppName() {
|
||||
return messages.radarName;
|
||||
}
|
||||
@@ -1,5 +1,24 @@
|
||||
import messages from "../../public/messages.json";
|
||||
import config from "../data/config.json";
|
||||
import messages from "../data/messages.json";
|
||||
|
||||
import { Quadrant, Ring } from "@/lib/types";
|
||||
|
||||
export function getMessages() {
|
||||
return messages;
|
||||
}
|
||||
|
||||
export function getAppName() {
|
||||
return messages.radarName;
|
||||
}
|
||||
|
||||
export function getRings(): Ring[] {
|
||||
return config.rings;
|
||||
}
|
||||
|
||||
export function getQuadrants(): Quadrant[] {
|
||||
return config.quadrants;
|
||||
}
|
||||
|
||||
export function getQuadrant(id: string): Quadrant | undefined {
|
||||
return getQuadrants().find((q) => q.id === id);
|
||||
}
|
||||
|
||||
41
src/lib/types.ts
Normal file
41
src/lib/types.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
export enum Flag {
|
||||
New = "new",
|
||||
Changed = "changed",
|
||||
Default = "default",
|
||||
}
|
||||
|
||||
export type Release = string;
|
||||
|
||||
export interface Revision {
|
||||
release: Release;
|
||||
ring: string;
|
||||
body?: string;
|
||||
}
|
||||
|
||||
export interface Item {
|
||||
id: string;
|
||||
title: string;
|
||||
info?: string;
|
||||
body: string;
|
||||
featured: boolean;
|
||||
ring: string;
|
||||
quadrant: string;
|
||||
flag: Flag;
|
||||
revisions?: Revision[];
|
||||
}
|
||||
|
||||
export interface Ring {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
export interface Quadrant {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
color: string;
|
||||
position: number;
|
||||
items?: Item[];
|
||||
}
|
||||
Reference in New Issue
Block a user