copy icon background was removed / margin was added

This commit is contained in:
Vladimir Khvan 2023-11-08 19:19:14 +05:00
parent 3477dc9f7d
commit 3269138865
2 changed files with 8 additions and 4 deletions

View File

@ -103,9 +103,10 @@ const Textarea = ({
<Wrapper
className="textarea-wrapper"
isJSONField={isJSONField}
enableCopy={enableCopy}
onFocus={enableCopy ? onTextareaClick : undefined}
>
{isJSONField && (
{enableCopy && (
<CopyIconWrapper
className={classNameCopyIcon}
isJSONField={isJSONField}

View File

@ -76,7 +76,7 @@ const StyledTextarea = styled(ClearTextareaAutosize).attrs(
outline: none;
resize: none;
overflow: ${(props) => (props.isJSONField ? "visible !important" : "hidden")};
padding: ${(props) => (props.enableCopy ? "5px 28px 2px" : "5px 8px 2px")};
padding: 5px 8px 2px;
${(props) =>
props.theme.interfaceDirection === "rtl"
@ -129,7 +129,7 @@ const StyledTextarea = styled(ClearTextareaAutosize).attrs(
`
&:placeholder-shown {
text-align: right;
}`}}
}`}
`;
StyledTextarea.defaultProps = { theme: Base };
@ -164,7 +164,6 @@ const CopyIconWrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
background-color: ${(props) => props.theme.backgroundColor};
`;
CopyIconWrapper.defaultProps = { theme: Base };
@ -173,6 +172,10 @@ const Wrapper = styled.div`
position: relative;
max-width: 1200px;
.scroll-wrapper {
margin-right: ${(props) => (props.enableCopy ? props.isJSONField ? "36px" : "8px" : "0")};
}
`;
const Numeration = styled.pre`