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

View File

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