From 592fe49be7d45512a6095a832f305fb5b61c1e2d Mon Sep 17 00:00:00 2001 From: rohithbalaji123 Date: Sun, 5 Jul 2020 20:21:47 +0530 Subject: [PATCH 1/3] Add textarea form component --- frontend/src/component/form/TextArea.scss | 18 +++++++++++ frontend/src/component/form/TextAreaField.tsx | 32 +++++++++++++++++++ frontend/src/component/form/TextField.scss | 2 +- frontend/src/component/styles/color.scss | 3 ++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 frontend/src/component/form/TextArea.scss create mode 100644 frontend/src/component/form/TextAreaField.tsx diff --git a/frontend/src/component/form/TextArea.scss b/frontend/src/component/form/TextArea.scss new file mode 100644 index 000000000..55a8ce4f4 --- /dev/null +++ b/frontend/src/component/form/TextArea.scss @@ -0,0 +1,18 @@ +@import '../styles/color'; +@import '../styles/corner'; +@import '../styles/font'; + +.text-area { + @include default-font(); + border: 2px solid $color-text-field-border; + box-sizing: border-box; + font-size: 16px; + @include round-corner; + outline: none; + padding: 8px 20px; + width: 100%; + + &:focus { + border-color: $color-primary; + } +} diff --git a/frontend/src/component/form/TextAreaField.tsx b/frontend/src/component/form/TextAreaField.tsx new file mode 100644 index 000000000..bf5d799c7 --- /dev/null +++ b/frontend/src/component/form/TextAreaField.tsx @@ -0,0 +1,32 @@ +import React, { ChangeEvent, Component } from 'react'; +import './TextArea.scss'; + +interface IProps { + rows?: number; + value?: string; + placeholder?: string; + onChange?: (value: string) => void; + onBlur?: () => void; +} + +export class TextAreaField extends Component { + render() { + return ( +