From 1d501927339b00c10e317111507194d9805ddceb Mon Sep 17 00:00:00 2001 From: minjeoong Date: Fri, 17 Jan 2025 02:15:26 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20textArea=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/TextArea/TextArea.css.ts | 24 +++++++++++++++++++ .../community/component/TextArea/TextArea.tsx | 21 ++++++++++++++++ src/page/community/write/Write.tsx | 24 +++++++++++++++---- 3 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 src/page/community/component/TextArea/TextArea.css.ts create mode 100644 src/page/community/component/TextArea/TextArea.tsx diff --git a/src/page/community/component/TextArea/TextArea.css.ts b/src/page/community/component/TextArea/TextArea.css.ts new file mode 100644 index 00000000..538871e2 --- /dev/null +++ b/src/page/community/component/TextArea/TextArea.css.ts @@ -0,0 +1,24 @@ +import { color, font } from "@style/styles.css"; +import { style } from "@vanilla-extract/css"; + +export const textareaContainer = style([ + font.body01, + { + fontWeight: 500, + color: color.gray.gray900, + width: "100%", + minHeight: "23.5rem", + padding: "1.2rem", + borderRadius: "0.8rem", + border: `0.1rem solid ${color.gray.gray200}`, + background: color.gray.gray000, + "::placeholder": { + color: color.gray.gray600, + }, + ":focus": { + outline: "none", + }, + }, +]); + +export const child = style({}); diff --git a/src/page/community/component/TextArea/TextArea.tsx b/src/page/community/component/TextArea/TextArea.tsx new file mode 100644 index 00000000..80112f7c --- /dev/null +++ b/src/page/community/component/TextArea/TextArea.tsx @@ -0,0 +1,21 @@ +import React from "react"; +import { textareaContainer } from "./TextArea.css"; + +interface TextAreaProps { + value: string; + onChange: (e: React.ChangeEvent) => void; + placeholder?: string; +} + +const TextArea = ({ value, onChange, placeholder }: TextAreaProps) => { + return ( + + ); +}; + +export default TextArea; diff --git a/src/page/community/write/Write.tsx b/src/page/community/write/Write.tsx index d7988f0d..7df94e17 100644 --- a/src/page/community/write/Write.tsx +++ b/src/page/community/write/Write.tsx @@ -1,8 +1,24 @@ +import TextArea from "@page/community/component/TextArea/TextArea.tsx"; +import React, { useState } from "react"; const Write = () => { + const [value, setValue] = useState(""); + const onChange = (e: React.ChangeEvent) => { + setValue(e.target.value); + }; return ( -
Write
- ) -} +
+