mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
Merge branch 'main' into archive_table
This commit is contained in:
commit
c3c7c07c05
@ -80,25 +80,29 @@ export const ApiTokenTable = () => {
|
|||||||
<Box sx={{ mb: 4 }}>
|
<Box sx={{ mb: 4 }}>
|
||||||
<ApiTokenDocs />
|
<ApiTokenDocs />
|
||||||
</Box>
|
</Box>
|
||||||
<SearchHighlightProvider value={globalFilter}>
|
<Box sx={{ overflowX: 'auto' }}>
|
||||||
<Table {...getTableProps()}>
|
<SearchHighlightProvider value={globalFilter}>
|
||||||
<SortableTableHeader headerGroups={headerGroups as any} />
|
<Table {...getTableProps()}>
|
||||||
<TableBody {...getTableBodyProps()}>
|
<SortableTableHeader
|
||||||
{rows.map(row => {
|
headerGroups={headerGroups as any}
|
||||||
prepareRow(row);
|
/>
|
||||||
return (
|
<TableBody {...getTableBodyProps()}>
|
||||||
<TableRow hover {...row.getRowProps()}>
|
{rows.map(row => {
|
||||||
{row.cells.map(cell => (
|
prepareRow(row);
|
||||||
<TableCell {...cell.getCellProps()}>
|
return (
|
||||||
{cell.render('Cell')}
|
<TableRow hover {...row.getRowProps()}>
|
||||||
</TableCell>
|
{row.cells.map(cell => (
|
||||||
))}
|
<TableCell {...cell.getCellProps()}>
|
||||||
</TableRow>
|
{cell.render('Cell')}
|
||||||
);
|
</TableCell>
|
||||||
})}
|
))}
|
||||||
</TableBody>
|
</TableRow>
|
||||||
</Table>
|
);
|
||||||
</SearchHighlightProvider>
|
})}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</SearchHighlightProvider>
|
||||||
|
</Box>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={rows.length === 0 && !loading}
|
condition={rows.length === 0 && !loading}
|
||||||
show={
|
show={
|
||||||
@ -125,7 +129,6 @@ export const ApiTokenTable = () => {
|
|||||||
|
|
||||||
const useHiddenColumns = (): string[] => {
|
const useHiddenColumns = (): string[] => {
|
||||||
const { uiConfig } = useUiConfig();
|
const { uiConfig } = useUiConfig();
|
||||||
const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'));
|
|
||||||
const isMediumScreen = useMediaQuery(theme.breakpoints.down('md'));
|
const isMediumScreen = useMediaQuery(theme.breakpoints.down('md'));
|
||||||
|
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
@ -141,12 +144,8 @@ const useHiddenColumns = (): string[] => {
|
|||||||
hidden.push('createdAt');
|
hidden.push('createdAt');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSmallScreen) {
|
|
||||||
hidden.push('username');
|
|
||||||
}
|
|
||||||
|
|
||||||
return hidden;
|
return hidden;
|
||||||
}, [uiConfig, isSmallScreen, isMediumScreen]);
|
}, [uiConfig, isMediumScreen]);
|
||||||
};
|
};
|
||||||
|
|
||||||
const COLUMNS = [
|
const COLUMNS = [
|
||||||
@ -161,7 +160,6 @@ const COLUMNS = [
|
|||||||
Header: 'Username',
|
Header: 'Username',
|
||||||
accessor: 'username',
|
accessor: 'username',
|
||||||
Cell: HighlightCell,
|
Cell: HighlightCell,
|
||||||
width: '60%',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Type',
|
Header: 'Type',
|
||||||
|
Loading…
Reference in New Issue
Block a user