From a6c4ab9873a7ad845fb3af804751c749dc69b094 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Tue, 20 Apr 2021 23:23:14 +0100 Subject: [PATCH] Complete textarea component --- src/components/TextArea/index.tsx | 52 +++++++++- src/components/TextArea/styles.ts | 161 +++++++++++++++++++++++++++++- 2 files changed, 210 insertions(+), 3 deletions(-) diff --git a/src/components/TextArea/index.tsx b/src/components/TextArea/index.tsx index 60d089f..45ff034 100644 --- a/src/components/TextArea/index.tsx +++ b/src/components/TextArea/index.tsx @@ -1,7 +1,55 @@ import { Wrapper } from './styles'; +import { Text } from '..'; -const TextArea = () => { - return ; +type TextAreaProps = { + className?: string; + color?: + | 'client' + | 'productOwner' + | 'developer' + | 'admin' + | 'success' + | 'warning' + | 'error' + | 'black' + | 'white'; + error?: boolean; + errorMessage?: string; + value: string; + label: string; + placeholder?: string; + fullWidth?: boolean; + onChange: (event: React.ChangeEvent) => void; +}; + +const TextArea = ({ + color = 'client', + label, + value, + onChange, + error, + errorMessage, + ...props +}: TextAreaProps) => { + return ( + +
+ {label && ( + + {label} + + )} + {error && errorMessage && ( + + {errorMessage} + + )} +
+
+