Added typings to app configuration

Added an interface for the app configuration list and imported/used it in several places. Also found some cases where there were unused/unnecessary properties involved that didn't exist in this configuration.
This commit is contained in:
Kire committed 2021-02-03 13:51:59 -05:00
1 parent 948f8dfade
commit 5a36290b83
3 files changed
+21 -4

No files matched your search

+11 -1
View File
@@ -39,6 +39,16 @@ import { SelloutApp } from '../../../apps/sellout/components/SelloutApp';
import { NotesApp } from '../../../apps/notes/NotesApp';
import CameraApp from '../../../apps/camera/components/CameraApp';
export interface AppConfiguration {
id: string;
nameLocale: string;
icon: JSX.Element;
backgroundColor: string;
color: string;
path: string;
Route: () => JSX.Element;
}
const appsState = atom({
key: 'apps',
default: {
@@ -148,7 +158,7 @@ const appsState = atom({
export const useApps = () => {
const [apps, setApps] = useConfig(appsState);
const allApps = [...apps.preinstalled];
const allApps: AppConfiguration[] = [...apps.preinstalled];
const getApp = (id) => allApps.find((a) => a.id === id) || null;