formatted column titles to have a size grabber thing
This commit is contained in:
parent
7d8d0c1ec8
commit
0cd0921c63
1 changed files with 19 additions and 7 deletions
|
|
@ -139,7 +139,6 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
const columns = typeof(props.columns) === "function" ? props.columns() : props.columns
|
||||
const subtitle = typeof(props.subtitle) === "function" ? props.subtitle() : props.subtitle
|
||||
const title = typeof(props.title) === "function" ? props.title() : props.title
|
||||
// const order = props.order ? props.order : "asc"
|
||||
const endTitleElement = typeof(props.endTitleElement) === "function" ? props.endTitleElement() : props.endTitleElement
|
||||
|
||||
const isMobile = useMobile()
|
||||
|
|
@ -423,9 +422,9 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
const sortKey = column.sortKey ? column.sortKey : column.title.toLowerCase()
|
||||
if (sortKey === orderBy) {
|
||||
if (order === "asc") {
|
||||
return <ArrowDownward fontSize="small"/>
|
||||
return <ArrowDownward fontSize="small" sx={{ marginLeft: 1 }} />
|
||||
} else {
|
||||
return <ArrowUpward fontSize="small"/>
|
||||
return <ArrowUpward fontSize="small" sx={{ marginLeft: 1 }} />
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
@ -487,11 +486,24 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
return (
|
||||
<TableCell
|
||||
key={"header-cell-"+index}
|
||||
onClick={() => !column.disableSort && columnClick(column)}
|
||||
sx={{ cursor: column.disableSort ? "default" : "pointer" }}
|
||||
style={{ border: "1px solid red" }}
|
||||
// onClick={() => !column.disableSort && columnClick(column)}
|
||||
// sx={{ cursor: column.disableSort ? "default" : "pointer" }}
|
||||
>
|
||||
<Grid2 container spacing={1} alignItems={"center"}>
|
||||
{column.title} {showOrderIcon(column)}
|
||||
<Grid2 container spacing={1} justifyContent={"space-between"}>
|
||||
<Grid2
|
||||
alignItems="center"
|
||||
display="flex"
|
||||
onClick={() => !column.disableSort && columnClick(column)}
|
||||
sx={{ cursor: column.disableSort ? "default" : "pointer" }}
|
||||
>
|
||||
{column.title} {showOrderIcon(column)}
|
||||
</Grid2>
|
||||
<Grid2
|
||||
sx={{ cursor: "col-resize" }}
|
||||
>
|
||||
|
|
||||
</Grid2>
|
||||
</Grid2>
|
||||
</TableCell>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue