mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
added ui when richtext is required
This commit is contained in:
parent
0c14a06979
commit
01190a00b5
@ -26,6 +26,10 @@ const LabelAction = styled(Box)`
|
||||
}
|
||||
`;
|
||||
|
||||
const TypographyAsterisk = styled(Typography)`
|
||||
line-height: 0;
|
||||
`;
|
||||
|
||||
const Wysiwyg = ({
|
||||
description,
|
||||
disabled,
|
||||
@ -36,6 +40,7 @@ const Wysiwyg = ({
|
||||
onChange,
|
||||
placeholder,
|
||||
value,
|
||||
required,
|
||||
}) => {
|
||||
const { formatMessage } = useIntl();
|
||||
const textareaRef = useRef(null);
|
||||
@ -124,6 +129,7 @@ const Wysiwyg = ({
|
||||
<Stack horizontal size={1}>
|
||||
<Typography variant="pi" fontWeight="bold" textColor="neutral800">
|
||||
{label}
|
||||
{required && <TypographyAsterisk textColor="danger600">*</TypographyAsterisk>}
|
||||
</Typography>
|
||||
{labelAction && <LabelAction paddingLeft={1}>{labelAction}</LabelAction>}
|
||||
</Stack>
|
||||
@ -182,6 +188,7 @@ Wysiwyg.defaultProps = {
|
||||
error: '',
|
||||
labelAction: undefined,
|
||||
placeholder: null,
|
||||
required: false,
|
||||
value: '',
|
||||
};
|
||||
|
||||
@ -206,6 +213,7 @@ Wysiwyg.propTypes = {
|
||||
defaultMessage: PropTypes.string.isRequired,
|
||||
values: PropTypes.object,
|
||||
}),
|
||||
required: PropTypes.bool,
|
||||
value: PropTypes.string,
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user