mirror of
https://github.com/strapi/strapi.git
synced 2025-11-19 19:50:46 +00:00
Add title to bullet
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
509e38561c
commit
4fedad09c9
@ -1,19 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
// import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
// import { Tooltip } from '@strapi/parts/Tooltip';
|
|
||||||
import { pxToRem } from '@strapi/helper-plugin';
|
import { pxToRem } from '@strapi/helper-plugin';
|
||||||
// import { getTrad } from '../../../utils';
|
import { getTrad } from '../../../utils';
|
||||||
|
|
||||||
// TODO
|
|
||||||
// const CustomBullet = styled(Bullet)`
|
|
||||||
// width: ${pxToRem(6)};
|
|
||||||
// height: ${pxToRem(6)};
|
|
||||||
// * {
|
|
||||||
// fill: ${({ theme, $bulletColor }) => theme.colors[$bulletColor]};
|
|
||||||
// }
|
|
||||||
// `;
|
|
||||||
|
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
'did-not-create-locale': {
|
'did-not-create-locale': {
|
||||||
@ -28,12 +18,11 @@ const statusMap = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO
|
const statusToTitleMap = {
|
||||||
// const statusToTitleMap = {
|
draft: 'content-manager.components.Select.draft-info-title',
|
||||||
// draft: 'content-manager.components.Select.draft-info-title',
|
published: 'content-manager.components.Select.publish-info-title',
|
||||||
// published: 'content-manager.components.Select.publish-info-title',
|
'did-not-create-locale': getTrad('components.Select.locales.not-available'),
|
||||||
// 'did-not-create-locale': getTrad('components.Select.locales.not-available'),
|
};
|
||||||
// };
|
|
||||||
|
|
||||||
const StyledBullet = styled.div`
|
const StyledBullet = styled.div`
|
||||||
width: ${pxToRem(6)};
|
width: ${pxToRem(6)};
|
||||||
@ -41,19 +30,13 @@ const StyledBullet = styled.div`
|
|||||||
border: ${({ theme, status }) => `1px solid ${theme.colors[statusMap[status].borderColor]}`};
|
border: ${({ theme, status }) => `1px solid ${theme.colors[statusMap[status].borderColor]}`};
|
||||||
background: ${({ theme, status }) => theme.colors[statusMap[status].backgroundColor]};
|
background: ${({ theme, status }) => theme.colors[statusMap[status].backgroundColor]};
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Bullet = ({ status }) => {
|
const Bullet = ({ status }) => {
|
||||||
// const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
|
|
||||||
return <StyledBullet status={status} />;
|
return <StyledBullet status={status} title={formatMessage({ id: statusToTitleMap[status] })} />;
|
||||||
|
|
||||||
// FIXME
|
|
||||||
// return (
|
|
||||||
// <Tooltip description={formatMessage({ id: statusToTitleMap[status] })}>
|
|
||||||
// <StyledBullet status={status} />
|
|
||||||
// </Tooltip>
|
|
||||||
// );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Bullet.propTypes = {
|
Bullet.propTypes = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user