120 in printWidth since rocky got md

This commit is contained in:
Christopher committed 2021-03-02 20:56:15 +01:00
1 parent f552c1212c
commit d27aeb3b0e
90 files changed
+398 -1146

No files matched your search

+2 -12
View File
@@ -23,23 +23,13 @@ const useStyles = makeStyles(() => ({
},
}));
export const AppContent = ({
children,
style,
backdrop,
onClickBackdrop,
...props
}: AppContentTypes & BoxProps) => {
export const AppContent = ({ children, style, backdrop, onClickBackdrop, ...props }: AppContentTypes & BoxProps) => {
const classes = useStyles();
return (
<Paper className={classes.wrapper} square>
<Box flexGrow={1} className={classes.box} {...props}>
<Paper square elevation={0} className={classes.paper}>
<Backdrop
className={classes.backdrop}
open={backdrop || false}
onClick={onClickBackdrop}
/>
<Backdrop className={classes.backdrop} open={backdrop || false} onClick={onClickBackdrop} />
{children}
</Paper>
</Box>
+21 -35
View File
@@ -5,38 +5,28 @@ import { green } from '@material-ui/core/colors';
import { Badge, Button, Tooltip, Zoom } from '@material-ui/core';
import { useTranslation } from 'react-i18next';
const useStyles = makeStyles<Theme, { color: string; backgroundColor: string }>(
(theme) => ({
root: {
padding: 0,
marginTop: theme.spacing(3),
const useStyles = makeStyles<Theme, { color: string; backgroundColor: string }>((theme) => ({
root: {
padding: 0,
marginTop: theme.spacing(3),
},
avatar: {
'&:hover': {
backgroundColor: ({ backgroundColor }) => darken(backgroundColor, 0.1),
},
avatar: {
'&:hover': {
backgroundColor: ({ backgroundColor }) => darken(backgroundColor, 0.1),
},
backgroundColor: ({ backgroundColor }) => backgroundColor,
color: ({ color }) => color,
boxShadow: theme.shadows[2],
width: theme.spacing(8),
height: theme.spacing(8),
fontSize: theme.typography.h4.fontSize,
},
tooltip: {
fontSize: 12,
},
}),
);
backgroundColor: ({ backgroundColor }) => backgroundColor,
color: ({ color }) => color,
boxShadow: theme.shadows[2],
width: theme.spacing(8),
height: theme.spacing(8),
fontSize: theme.typography.h4.fontSize,
},
tooltip: {
fontSize: 12,
},
}));
export const AppIcon = ({
id,
nameLocale,
name,
icon,
backgroundColor,
color,
notification,
}) => {
export const AppIcon = ({ id, nameLocale, name, icon, backgroundColor, color, notification }) => {
const { t } = useTranslation();
const classes = useStyles({
backgroundColor: backgroundColor || green[50],
@@ -53,11 +43,7 @@ export const AppIcon = ({
TransitionComponent={Zoom}
>
<Button className={classes.root}>
<Badge
color="error"
badgeContent={notification?.badge}
invisible={!notification || notification.badge < 2}
>
<Badge color="error" badgeContent={notification?.badge} invisible={!notification || notification.badge < 2}>
<Avatar className={classes.avatar}>{icon || name[0].toUpperCase()}</Avatar>
</Badge>
</Button>
+1 -5
View File
@@ -28,11 +28,7 @@ const useStyle = makeStyles(
);
// Taso: Maybe we should pass an icon (maybe fa?) as a prop as well at somepoint
// but need to think about the best way to do that for standardization sake.
export const AppTitle = ({
app: { backgroundColor, color, nameLocale },
variant = 'h5',
...props
}: IProps) => {
export const AppTitle = ({ app: { backgroundColor, color, nameLocale }, variant = 'h5', ...props }: IProps) => {
const classes = useStyle({ color, backgroundColor });
const { t } = useTranslation();
return (
+1 -6
View File
@@ -1,12 +1,7 @@
import React from 'react';
import { AppWrapperTypes } from '../interface/InterfaceUI';
export const AppWrapper = ({
children,
style,
handleClickAway,
...props
}: AppWrapperTypes) => {
export const AppWrapper = ({ children, style, handleClickAway, ...props }: AppWrapperTypes) => {
return (
<div
{...props}
+4 -13
View File
@@ -17,11 +17,9 @@ const useStyles = makeStyles(
},
},
outlined: {
border: ({ color }: IStatusButtonStyleProps) =>
`1px solid ${fade(theme.palette[color].main, 0.5)}`,
border: ({ color }: IStatusButtonStyleProps) => `1px solid ${fade(theme.palette[color].main, 0.5)}`,
'&:hover': {
border: ({ color }: IStatusButtonStyleProps) =>
`1px solid ${theme.palette[color].main}`,
border: ({ color }: IStatusButtonStyleProps) => `1px solid ${theme.palette[color].main}`,
},
'&$disabled': {
border: `1px solid ${theme.palette.action.disabled}`,
@@ -31,8 +29,7 @@ const useStyles = makeStyles(
color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText,
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main,
'&:hover': {
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
theme.palette[color].dark,
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].dark,
},
},
}),
@@ -46,11 +43,5 @@ export const StatusButton = ({
...props
}: Omit<ButtonProps, 'color'> & { color: StatusButtonStyleColor }) => {
const classes = useStyles({ color });
return (
<Button
variant={variant}
className={`${classes.root} ${classes[variant] || ''} ${className}`}
{...props}
/>
);
return <Button variant={variant} className={`${classes.root} ${classes[variant] || ''} ${className}`} {...props} />;
};
+4 -8
View File
@@ -13,16 +13,13 @@ const useStyles = makeStyles(
color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText,
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main,
'&:hover': {
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
theme.palette[color].light,
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].light,
},
},
outlined: {
border: ({ color }: IStatusButtonStyleProps) =>
`1px solid ${fade(theme.palette[color].main, 0.5)}`,
border: ({ color }: IStatusButtonStyleProps) => `1px solid ${fade(theme.palette[color].main, 0.5)}`,
'&:hover': {
border: ({ color }: IStatusButtonStyleProps) =>
`1px solid ${theme.palette[color].main}`,
border: ({ color }: IStatusButtonStyleProps) => `1px solid ${theme.palette[color].main}`,
},
'&$disabled': {
border: `1px solid ${theme.palette.action.disabled}`,
@@ -32,8 +29,7 @@ const useStyles = makeStyles(
color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText,
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main,
'&:hover': {
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
theme.palette[color].dark,
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].dark,
},
},
}),
+1 -6
View File
@@ -23,10 +23,5 @@ export const useContextMenu = (_options?): UseContextMenu => {
setOpen(true);
};
return [
onOpen,
onClose,
() => <ContextMenu open={open} onClose={onClose} options={options} />,
open,
];
return [onOpen, onClose, () => <ContextMenu open={open} onClose={onClose} options={options} />, open];
};
+1 -5
View File
@@ -16,11 +16,7 @@ function SnackbarProvider({ children }) {
return () => clearTimeout(timer.current);
}, [alert]);
return (
<SnackbarContext.Provider value={{ alert, addAlert: setAlert }}>
{children}
</SnackbarContext.Provider>
);
return <SnackbarContext.Provider value={{ alert, addAlert: setAlert }}>{children}</SnackbarContext.Provider>;
}
export default SnackbarProvider;