mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
CM: Move PublicationState and ReviewWorkflowsStage into cell content
This commit is contained in:
parent
53b07d527d
commit
27753fc03b
@ -1,28 +1,23 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useIntl } from 'react-intl';
|
||||
import styled from 'styled-components';
|
||||
import { Status, Typography } from '@strapi/design-system';
|
||||
|
||||
import { getTrad } from '../../../utils';
|
||||
|
||||
const StyledStatus = styled(Status)`
|
||||
width: min-content;
|
||||
`;
|
||||
import { getTrad } from '../../../../utils';
|
||||
|
||||
export function PublicationState({ isPublished }) {
|
||||
const { formatMessage } = useIntl();
|
||||
const variant = isPublished ? 'success' : 'secondary';
|
||||
|
||||
return (
|
||||
<StyledStatus showBullet={false} variant={variant} size="S">
|
||||
<Status showBullet={false} variant={variant} size="S" width="min-content">
|
||||
<Typography fontWeight="bold" textColor={`${variant}700`}>
|
||||
{formatMessage({
|
||||
id: getTrad(`containers.List.${isPublished ? 'published' : 'draft'}`),
|
||||
defaultMessage: isPublished ? 'Published' : 'Draft',
|
||||
})}
|
||||
</Typography>
|
||||
</StyledStatus>
|
||||
</Status>
|
||||
);
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import { getTrad } from '../../utils';
|
||||
import TableRows from './TableRows';
|
||||
import ConfirmDialogDeleteAll from './ConfirmDialogDeleteAll';
|
||||
import ConfirmDialogDelete from './ConfirmDialogDelete';
|
||||
import { PublicationState } from './PublicationState/PublicationState';
|
||||
import { ReviewWorkflowsStage } from './ReviewWorkflowsStage';
|
||||
import { PublicationState } from './CellContent/PublicationState/PublicationState';
|
||||
import { ReviewWorkflowsStage } from './CellContent/ReviewWorkflowsStage';
|
||||
|
||||
const DynamicTable = ({
|
||||
canCreate,
|
||||
@ -90,7 +90,7 @@ const DynamicTable = ({
|
||||
sortable: false,
|
||||
},
|
||||
cellFormatter({ strapi_reviewWorkflows_stage }) {
|
||||
return <ReviewWorkflowsStage {...strapi_reviewWorkflows_stage} />;
|
||||
return <ReviewWorkflowsStage name={strapi_reviewWorkflows_stage.name} />;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user