Update text area component

This commit is contained in:
Hazem Krimi
2021-04-23 18:25:09 +01:00
parent d633a519eb
commit ad9a101d58
2 changed files with 26 additions and 36 deletions
+2
View File
@@ -49,6 +49,7 @@ const TextArea = ({
)} )}
</div> </div>
<div className='textarea'> <div className='textarea'>
<div>
<textarea <textarea
rows={10} rows={10}
value={value} value={value}
@@ -57,6 +58,7 @@ const TextArea = ({
placeholder={placeholder} placeholder={placeholder}
/> />
</div> </div>
</div>
</Wrapper> </Wrapper>
); );
}; };
+17 -29
View File
@@ -23,32 +23,20 @@ export const Wrapper = styled.div<WrapperProps>`
width: inherit; width: inherit;
height: inherit; height: inherit;
border-radius: 5px; border-radius: 5px;
padding: 1rem; padding: 2px;
position: relative;
color: ${({ theme }) => theme.colors.black.main}; color: ${({ theme }) => theme.colors.black.main};
background: ${({ theme }) => theme.colors.white.main};
background-clip: padding-box;
border: 2px solid transparent;
&:before { div {
content: ''; background: ${({ theme }) => theme.colors.white.main};
position: absolute; padding: 1rem;
top: 0; border-radius: 5px;
right: 0;
bottom: 0;
left: 0;
width: inherit;
height: inherit;
z-index: -1;
margin: -2px;
border-radius: inherit;
} }
} }
.info { .info {
margin-bottom: 5px; margin-bottom: 5px;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: 1fr auto;
align-items: center; align-items: center;
p { p {
@@ -78,61 +66,61 @@ export const Wrapper = styled.div<WrapperProps>`
switch (color) { switch (color) {
case 'client': case 'client':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.client.light}; background: ${theme.colors.client.light};
} }
`; `;
case 'productOwner': case 'productOwner':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.productOwner.light}; background: ${theme.colors.productOwner.light};
} }
`; `;
case 'developer': case 'developer':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.developer.light}; background: ${theme.colors.developer.light};
} }
`; `;
case 'admin': case 'admin':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.admin.light}; background: ${theme.colors.admin.light};
} }
`; `;
case 'success': case 'success':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.success.main}; background: ${theme.colors.success.main};
} }
`; `;
case 'warning': case 'warning':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.warning.main}; background: ${theme.colors.warning.main};
} }
`; `;
case 'error': case 'error':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.error.main}; background: ${theme.colors.error.main};
} }
`; `;
case 'black': case 'black':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.black.main}; background: ${theme.colors.black.main};
} }
`; `;
case 'white': case 'white':
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.white.main}; background: ${theme.colors.white.main};
} }
`; `;
default: default:
return css` return css`
.textarea:before { .textarea {
background: ${theme.colors.client.light}; background: ${theme.colors.client.light};
} }
`; `;
@@ -148,7 +136,7 @@ export const Wrapper = styled.div<WrapperProps>`
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
.textarea:before { .textarea {
background: ${theme.colors.error.main}; background: ${theme.colors.error.main};
} }
`} `}