mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
more formatting
This commit is contained in:
1 parent
046447b0fb
commit
f552c1212c
157 files changed
+635
-1579
No files matched your search
@@ -16,12 +16,7 @@ const useStyles = makeStyles({
|
||||
export function Alert({ children, ...props }) {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<MuiAlert
|
||||
className={classes.root}
|
||||
elevation={6}
|
||||
variant='filled'
|
||||
{...props}
|
||||
>
|
||||
<MuiAlert className={classes.root} elevation={6} variant="filled" {...props}>
|
||||
<Typography className={classes.msg}>{children}</Typography>
|
||||
</MuiAlert>
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@ const useStyles = makeStyles<Theme, { color: string; backgroundColor: string }>(
|
||||
tooltip: {
|
||||
fontSize: 12,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
export const AppIcon = ({
|
||||
@@ -48,19 +48,17 @@ export const AppIcon = ({
|
||||
arrow
|
||||
key={id}
|
||||
title={t(nameLocale)}
|
||||
placement='top'
|
||||
placement="top"
|
||||
classes={{ tooltip: classes.tooltip }}
|
||||
TransitionComponent={Zoom}
|
||||
>
|
||||
<Button className={classes.root}>
|
||||
<Badge
|
||||
color='error'
|
||||
color="error"
|
||||
badgeContent={notification?.badge}
|
||||
invisible={!notification || notification.badge < 2}
|
||||
>
|
||||
<Avatar className={classes.avatar}>
|
||||
{icon || name[0].toUpperCase()}
|
||||
</Avatar>
|
||||
<Avatar className={classes.avatar}>{icon || name[0].toUpperCase()}</Avatar>
|
||||
</Badge>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
||||
@@ -24,7 +24,7 @@ const useStyle = makeStyles(
|
||||
text: ({ color }) => ({
|
||||
color: color || theme.palette.text.primary,
|
||||
}),
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 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.
|
||||
|
||||
@@ -3,7 +3,7 @@ import MaterialButton from '@material-ui/core/Button';
|
||||
|
||||
export const Button = ({ ...props }) => {
|
||||
return (
|
||||
<MaterialButton aria-label='button' {...props}>
|
||||
<MaterialButton aria-label="button" {...props}>
|
||||
{props.children}
|
||||
</MaterialButton>
|
||||
);
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Slide,
|
||||
makeStyles,
|
||||
Paper,
|
||||
} from '@material-ui/core';
|
||||
import { ListItemIcon, ListItemText, Slide, makeStyles, Paper } from '@material-ui/core';
|
||||
import { List } from './List';
|
||||
import { ListItem } from './ListItem';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -51,7 +45,7 @@ export const ContextMenu = ({ open, onClose, options }: IContextMenuProps) => {
|
||||
: options;
|
||||
|
||||
return (
|
||||
<Slide direction='up' in={open} mountOnEnter unmountOnExit>
|
||||
<Slide direction="up" in={open} mountOnEnter unmountOnExit>
|
||||
<Paper square className={classes.root}>
|
||||
<List disablePadding>
|
||||
{_options.map((option) => (
|
||||
@@ -65,10 +59,7 @@ export const ContextMenu = ({ open, onClose, options }: IContextMenuProps) => {
|
||||
}}
|
||||
>
|
||||
{option.icon && <ListItemIcon>{option.icon}</ListItemIcon>}
|
||||
<ListItemText
|
||||
primary={option.label}
|
||||
secondary={option.description}
|
||||
/>
|
||||
<ListItemText primary={option.label} secondary={option.description} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
@@ -5,12 +5,12 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
export const GridMenu = ({ items, Component = AppIcon, xs = undefined }) => {
|
||||
return (
|
||||
<Grid container alignItems='center' direction='row'>
|
||||
<Grid container alignItems="center" direction="row">
|
||||
{items &&
|
||||
items.length &&
|
||||
items.map((item) => (
|
||||
<Grid item xs={xs} key={item.id} alignItems='center' justify='center'>
|
||||
<Box textAlign='center'>
|
||||
<Grid item xs={xs} key={item.id} alignItems="center" justify="center">
|
||||
<Box textAlign="center">
|
||||
<Link to={item.path}>
|
||||
<Component {...item} />
|
||||
</Link>
|
||||
|
||||
@@ -3,7 +3,7 @@ import MaterialList from '@material-ui/core/List';
|
||||
|
||||
export const List = ({ ...props }) => {
|
||||
return (
|
||||
<MaterialList aria-label='list' {...props}>
|
||||
<MaterialList aria-label="list" {...props}>
|
||||
{props.children}
|
||||
</MaterialList>
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import MaterialListItem from '@material-ui/core/ListItem';
|
||||
|
||||
export const ListItem = ({ ...props }) => {
|
||||
return (
|
||||
<MaterialListItem aria-label='list item' {...props}>
|
||||
<MaterialListItem aria-label="list item" {...props}>
|
||||
{props.children}
|
||||
</MaterialListItem>
|
||||
);
|
||||
|
||||
@@ -49,9 +49,7 @@ export const Modal = ({ children, visible, handleClose }) => {
|
||||
return () => window.removeEventListener('keydown', _handleEscape);
|
||||
});
|
||||
|
||||
const showHideClassName = visible
|
||||
? classes.displayBlock
|
||||
: classes.displayNone;
|
||||
const showHideClassName = visible ? classes.displayBlock : classes.displayNone;
|
||||
|
||||
return (
|
||||
<div className={showHideClassName}>
|
||||
|
||||
@@ -27,9 +27,7 @@ export const Snackbar = () => {
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
{alert ? (
|
||||
<Alert severity={alert.type}>{t('APPS_' + alert.message)}</Alert>
|
||||
) : null}
|
||||
{alert ? <Alert severity={alert.type}>{t('APPS_' + alert.message)}</Alert> : null}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -28,17 +28,15 @@ const useStyles = makeStyles(
|
||||
},
|
||||
},
|
||||
contained: {
|
||||
color: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].contrastText,
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].main,
|
||||
color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText,
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main,
|
||||
'&:hover': {
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].dark,
|
||||
},
|
||||
},
|
||||
}),
|
||||
{ name: 'MuiButton' }
|
||||
{ name: 'MuiButton' },
|
||||
);
|
||||
|
||||
export const StatusButton = ({
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
fade,
|
||||
IconButton,
|
||||
IconButtonProps,
|
||||
makeStyles,
|
||||
} from '@material-ui/core';
|
||||
import { fade, IconButton, IconButtonProps, makeStyles } from '@material-ui/core';
|
||||
import React from 'react';
|
||||
|
||||
type StatusButtonStyleColor = 'success' | 'error' | 'warning' | 'info';
|
||||
@@ -15,10 +10,8 @@ interface IStatusButtonStyleProps {
|
||||
const useStyles = makeStyles(
|
||||
(theme) => ({
|
||||
root: {
|
||||
color: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].contrastText,
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].main,
|
||||
color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText,
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main,
|
||||
'&:hover': {
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].light,
|
||||
@@ -36,17 +29,15 @@ const useStyles = makeStyles(
|
||||
},
|
||||
},
|
||||
contained: {
|
||||
color: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].contrastText,
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].main,
|
||||
color: ({ color }: IStatusButtonStyleProps) => theme.palette[color].contrastText,
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) => theme.palette[color].main,
|
||||
'&:hover': {
|
||||
backgroundColor: ({ color }: IStatusButtonStyleProps) =>
|
||||
theme.palette[color].dark,
|
||||
},
|
||||
},
|
||||
}),
|
||||
{ name: 'MuiIconButton' }
|
||||
{ name: 'MuiIconButton' },
|
||||
);
|
||||
|
||||
export const StatusIconButton = ({
|
||||
@@ -56,11 +47,5 @@ export const StatusIconButton = ({
|
||||
...props
|
||||
}: Omit<IconButtonProps, 'color'> & { color: StatusButtonStyleColor }) => {
|
||||
const classes = useStyles({ color });
|
||||
return (
|
||||
<IconButton
|
||||
className={`${classes.root} ${className}`}
|
||||
size={size}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return <IconButton className={`${classes.root} ${className}`} size={size} {...props} />;
|
||||
};
|
||||
Reference in new issue
Block a user