1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: simplified empty archive list page

This commit is contained in:
Tymoteusz Czech 2022-06-14 11:28:40 +02:00
parent 349106a2be
commit 7bfe7201c0

View File

@ -283,14 +283,7 @@ export const ArchiveTable = ({
/> />
} }
> >
<ConditionallyRender <SearchHighlightProvider value={getSearchText(searchValue)}>
condition={!loading && data.length === 0}
show={<TablePlaceholder />}
elseShow={() => (
<>
<SearchHighlightProvider
value={getSearchText(searchValue)}
>
<Table <Table
{...getTableProps()} {...getTableProps()}
rowHeight={rowHeight} rowHeight={rowHeight}
@ -323,8 +316,7 @@ export const ArchiveTable = ({
display: 'flex', display: 'flex',
top: top:
index * rowHeight + index * rowHeight +
theme.shape theme.shape.tableRowHeightCompact,
.tableRowHeightCompact,
}} }}
className={classes.row} className={classes.row}
> >
@ -332,9 +324,7 @@ export const ArchiveTable = ({
<TableCell <TableCell
{...cell.getCellProps({ {...cell.getCellProps({
style: { style: {
flex: cell flex: cell.column.minWidth
.column
.minWidth
? '1 0 auto' ? '1 0 auto'
: undefined, : undefined,
}, },
@ -351,9 +341,7 @@ export const ArchiveTable = ({
</Table> </Table>
</SearchHighlightProvider> </SearchHighlightProvider>
<ConditionallyRender <ConditionallyRender
condition={ condition={rows.length === 0 && searchValue?.length > 0}
rows.length === 0 && searchValue?.length > 0
}
show={ show={
<TablePlaceholder> <TablePlaceholder>
No feature toggles found matching &ldquo; No feature toggles found matching &ldquo;
@ -361,8 +349,13 @@ export const ArchiveTable = ({
</TablePlaceholder> </TablePlaceholder>
} }
/> />
</> <ConditionallyRender
)} condition={rows.length === 0 && searchValue?.length === 0}
show={
<TablePlaceholder>
None of the feature toggles where archived yet.
</TablePlaceholder>
}
/> />
</PageContent> </PageContent>
); );