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

+3 -2
View File
@@ -4,6 +4,7 @@ import Avatar from '@material-ui/core/Avatar';
import { green } from '@material-ui/core/colors';
import { Button } from '@material-ui/core';
import Nui from '../../os/nui-events/utils/Nui';
import { AppConfiguration } from '../../os/apps/hooks/useApps';
interface IStyles {
root: any;
@@ -29,7 +30,7 @@ const useStyles = makeStyles(
})
);
export const AppIcon = ({ id, name, icon, backgroundColor, color }) => {
export const AppIcon = ({ id, icon, backgroundColor, color }: AppConfiguration) => {
const classes = useStyles({
backgroundColor: backgroundColor || green[50],
color: color || green[400],
@@ -42,7 +43,7 @@ export const AppIcon = ({ id, name, icon, backgroundColor, color }) => {
return (
<Button onClick={openAppCallback} className={classes.root}>
<Avatar className={classes.avatar}>
{icon || name[0].toUpperCase()}
{icon}
</Avatar>
</Button>
);