DynamicTable: avoid wrapping single components in flex components

This commit is contained in:
Gustav Hansen 2022-02-14 09:01:23 +01:00 committed by Gustav Hansen
parent f58b78c39e
commit 37468e0824

View File

@ -1,9 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Flex } from '@strapi/design-system/Flex';
import { Tooltip } from '@strapi/design-system/Tooltip'; import { Tooltip } from '@strapi/design-system/Tooltip';
import { Typography } from '@strapi/design-system/Typography'; import { Typography } from '@strapi/design-system/Typography';
import { stopPropagation } from '@strapi/helper-plugin';
import CellValue from '../CellValue'; import CellValue from '../CellValue';
@ -12,13 +10,11 @@ const SingleComponentCell = ({ value, metadatas }) => {
const content = value[mainField.name]; const content = value[mainField.name];
return ( return (
<Flex {...stopPropagation}> <Tooltip label={content}>
<Tooltip label={content}> <Typography textColor="neutral800" ellipsis>
<Typography textColor="neutral800" ellipsis> <CellValue type={mainField.type} value={content} />
<CellValue type={mainField.type} value={content} /> </Typography>
</Typography> </Tooltip>
</Tooltip>
</Flex>
); );
}; };