1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-08 01:15:49 +02:00

formatting

This commit is contained in:
andreas-unleash 2022-06-10 16:04:06 +03:00
parent f44bc9a849
commit 9536a1b78f
3 changed files with 23 additions and 8 deletions

View File

@ -9,7 +9,7 @@ import {
TableRow,
TableSearch,
} from 'component/common/Table';
import {SortingRule, useFlexLayout, useSortBy, useTable} from 'react-table';
import { SortingRule, useFlexLayout, useSortBy, useTable } from 'react-table';
import { SearchHighlightProvider } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext';
import { useMediaQuery } from '@mui/material';
import { sortTypes } from 'utils/sortTypes';
@ -40,9 +40,18 @@ export interface IFeaturesArchiveTableProps {
refetch: () => void;
loading: boolean;
storedParams: SortingRule<string>;
setStoredParams: (newValue: (SortingRule<string> | ((prev: SortingRule<string>) => SortingRule<string>))) => SortingRule<string>;
setStoredParams: (
newValue:
| SortingRule<string>
| ((prev: SortingRule<string>) => SortingRule<string>)
) => SortingRule<string>;
searchParams: URLSearchParams;
setSearchParams: (nextInit: URLSearchParamsInit, navigateOptions?: ({replace?: boolean | undefined, state?: any} | undefined)) => void;
setSearchParams: (
nextInit: URLSearchParamsInit,
navigateOptions?:
| { replace?: boolean | undefined; state?: any }
| undefined
) => void;
}
export const ArchiveTable = ({
@ -283,7 +292,8 @@ export const ArchiveTable = ({
<TableBody {...getTableBodyProps()}>
{rows.map((row, index) => {
const isVirtual =
index < firstRenderedIndex || index > lastRenderedIndex;
index < firstRenderedIndex ||
index > lastRenderedIndex;
if (isVirtual) {
return null;
@ -291,12 +301,17 @@ export const ArchiveTable = ({
prepareRow(row);
return (
<TableRow hover {...row.getRowProps()}>
<TableRow
hover
{...row.getRowProps()}
>
{row.cells.map(cell => (
<TableCell
{...cell.getCellProps({
style: {
flex: cell.column.minWidth
flex: cell
.column
.minWidth
? '1 0 auto'
: undefined,
},

View File

@ -23,7 +23,7 @@ export const FeaturesArchiveTable = () => {
return (
<ArchiveTable
title='Archived'
title="Archived"
archivedFeatures={archivedFeatures}
loading={loading}
searchParams={searchParams}

View File

@ -27,7 +27,7 @@ export const ProjectFeaturesArchiveTable = ({
return (
<ArchiveTable
title='Project Features Archive'
title="Project Features Archive"
archivedFeatures={archivedFeatures}
loading={loading}
searchParams={searchParams}