Fix dialog tables on mobile
This commit is contained in:
parent
f2caca15fe
commit
89d351ccc6
1 changed files with 11 additions and 13 deletions
|
@ -1,20 +1,20 @@
|
||||||
import { Theme } from "@material-ui/core/styles";
|
|
||||||
import Table from "@material-ui/core/Table";
|
import Table from "@material-ui/core/Table";
|
||||||
import { makeStyles } from "@material-ui/styles";
|
import makeStyles from "@material-ui/core/styles/makeStyles";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
(theme: Theme) => ({
|
theme => ({
|
||||||
|
root: {
|
||||||
[theme.breakpoints.up("sm")]: {
|
[theme.breakpoints.up("sm")]: {
|
||||||
"& table": {
|
"& table": {
|
||||||
tableLayout: "fixed"
|
tableLayout: "fixed"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
root: {
|
|
||||||
"& table": {
|
"& table": {
|
||||||
tableLayout: "auto"
|
tableLayout: "auto"
|
||||||
},
|
},
|
||||||
overflowX: "auto"
|
overflowX: "auto",
|
||||||
|
width: "100%"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
|
@ -29,15 +29,13 @@ interface ResponsiveTableProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ResponsiveTable: React.FC<ResponsiveTableProps> = props => {
|
const ResponsiveTable: React.FC<ResponsiveTableProps> = props => {
|
||||||
const { children, className, key } = props;
|
const { children, className } = props;
|
||||||
|
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<Table className={className} key={key}>
|
<Table className={className}>{children}</Table>
|
||||||
{children}
|
|
||||||
</Table>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue