working typescript compiling and fixing linting issues

This commit is contained in:
erik-sn committed 2020-10-11 13:59:25 -04:00
1 parent b1babd88c2
commit 3273d192c9
49 files changed
+271 -110

No files matched your search

+4 -4
View File
@@ -1,8 +1,8 @@
import React from "react";
import { Box, makeStyles, Backdrop, Paper } from "@material-ui/core";
import { AppContentTypes } from '../interface/InterfaceUI';
import { AppContentTypes } from "../interface/InterfaceUI";
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles(() => ({
wrapper: {
height: "67vh",
overflow: "auto",
@@ -29,12 +29,12 @@ export const AppContent = ({
backdrop,
onClickBackdrop,
...props
}: AppContentTypes) => {
}: AppContentTypes) => {
const classes = useStyles();
return (
<Paper className={classes.wrapper}>
<Box flexGrow={1} className={classes.box} {...props}>
<Paper square px={2} pt={1} elevation={0} className={classes.paper}>
<Paper square elevation={0} className={classes.paper}>
<Backdrop
className={classes.backdrop}
open={backdrop || false}
+22 -15
View File
@@ -4,22 +4,29 @@ import Avatar from "@material-ui/core/Avatar";
import { green } from "@material-ui/core/colors";
import { Button } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
root: {
display: "flex",
"& > *": {
margin: theme.spacing(1),
interface IStyles {
root: any;
avatar: any;
}
const useStyles = makeStyles(
(theme): IStyles => ({
root: {
display: "flex",
"& > *": {
margin: theme.spacing(1),
},
padding: 0,
},
padding: 0,
},
avatar: {
backgroundColor: ({ backgroundColor }) => backgroundColor,
color: ({ color }) => color,
width: theme.spacing(7),
height: theme.spacing(7),
fontSize: theme.typography.h4.fontSize,
},
}));
avatar: {
backgroundColor: ({ backgroundColor }) => backgroundColor,
color: ({ color }) => color,
width: theme.spacing(7),
height: theme.spacing(7),
fontSize: theme.typography.h4.fontSize,
},
})
);
export const AppIcon = ({ name, icon, backgroundColor, color }) => {
const classes = useStyles({
+25 -11
View File
@@ -1,23 +1,37 @@
import React from "react";
import { Typography, Box, makeStyles } from "@material-ui/core";
import { useTranslation } from "react-i18next";
import { Variant } from "@material-ui/core/styles/createTypography";
const useStyle = makeStyles((theme) => ({
root: ({ backgroundColor }) => ({
width: "100%",
textAlign: "center",
backgroundColor: backgroundColor || theme.palette.background.default,
}),
text: ({ color }) => ({
color: color || theme.palette.text.primary,
}),
}));
interface IProps {
app: any;
className?: string;
variant?: Variant;
}
interface IUseStyle {
root: any;
text: any;
}
const useStyle = makeStyles(
(theme): IUseStyle => ({
root: ({ backgroundColor }) => ({
width: "100%",
textAlign: "center",
backgroundColor: backgroundColor || theme.palette.background.default,
}),
text: ({ color }) => ({
color: color || theme.palette.text.primary,
}),
})
);
export const AppTitle = ({
app: { backgroundColor, color, nameLocale },
variant = "h4",
...props
}) => {
}: IProps) => {
const classes = useStyle({ color, backgroundColor });
const { t } = useTranslation();
return (
+5 -5
View File
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { makeStyles } from "@material-ui/core/styles";
import { Paper } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles(() => ({
root: {
zIndex: 10,
background: "#424242",
@@ -31,16 +31,16 @@ export const Modal = ({ children, visible, handleClose }) => {
// when the user presses escape we should close the modal
const _handleEscape = (e) => {
const isEscapeKey = e.key == "Escape" || e.key == "Esc";
const isEscapeKey = e.key === "Escape" || e.key === "Esc";
if (isEscapeKey) {
e.preventDefault();
handleClose();
}
};
useEffect(() => {
const listener = window.addEventListener("keydown", _handleEscape, true);
return () => window.removeEventListener("keydown", listener);
}, []);
window.addEventListener("keydown", _handleEscape, true);
return () => window.removeEventListener("keydown", _handleEscape);
});
const showHideClassName = visible
? classes.displayBlock