dynamic table

This commit is contained in:
ronronscelestes 2021-11-09 16:06:55 +01:00
parent 8e617c7e64
commit 325a7d1e14
2 changed files with 7 additions and 6 deletions

View File

@ -3,7 +3,7 @@ import { BaseCheckbox } from '@strapi/design-system/BaseCheckbox';
import { IconButton } from '@strapi/design-system/IconButton';
import { Tooltip } from '@strapi/design-system/Tooltip';
import { VisuallyHidden } from '@strapi/design-system/VisuallyHidden';
import { TableLabel } from '@strapi/design-system/Text';
import { Typography } from '@strapi/design-system/Typography';
import { Th, Thead, Tr } from '@strapi/design-system/Table';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
@ -78,14 +78,15 @@ const TableHead = ({
}
>
<Tooltip label={isSortable ? sortLabel : intlLabel}>
<TableLabel
<Typography
textColor="neutral600"
as={!isSorted && isSortable ? 'button' : 'span'}
label={intlLabel}
onClick={() => handleClickSort(!isSorted)}
variant="sigma"
>
{intlLabel}
</TableLabel>
</Typography>
</Tooltip>
</Th>
);

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex';
import { Button } from '@strapi/design-system/Button';
import { Subtitle } from '@strapi/design-system/Text';
import { Typography } from '@strapi/design-system/Typography';
import { Table as TableCompo } from '@strapi/design-system/Table';
import { useIntl } from 'react-intl';
import Trash from '@strapi/icons/Trash';
@ -129,7 +129,7 @@ const Table = ({
<Box paddingBottom={4}>
<Flex justifyContent="space-between">
<BlockActions>
<Subtitle textColor="neutral600">
<Typography variant="epsilon" textColor="neutral600">
{formatMessage(
{
id: 'content-manager.components.TableDelete.label',
@ -137,7 +137,7 @@ const Table = ({
},
{ number: entriesToDelete.length }
)}
</Subtitle>
</Typography>
<Button
onClick={handleToggleConfirmDeleteAll}
startIcon={<Trash />}