diff --git a/src/components/input/AccountInput.tsx b/src/components/input/AccountInput.tsx new file mode 100644 index 0000000..97ec397 --- /dev/null +++ b/src/components/input/AccountInput.tsx @@ -0,0 +1,39 @@ +import { useId } from 'react'; + +import Input from './Input'; +import { AccountInputProps } from './types/types'; +import styles from './styles/AccountInput.module.css'; + +/** + * 프로필 페이지용 계정 정보 표시 컴포넌트. + * 이메일과 비밀번호를 읽기 전용으로 보여줍니다. + * children 슬롯에 변경하기 버튼 등을 주입할 수 있습니다. + */ +export default function AccountInput({ email, children }: AccountInputProps) { + const emailId = useId(); + const passwordId = useId(); + + return ( +
+
+ + +
+
+ + +
+ {children &&
{children}
} +
+ ); +} diff --git a/src/components/input/ActionTextArea.tsx b/src/components/input/ActionTextArea.tsx new file mode 100644 index 0000000..27652f3 --- /dev/null +++ b/src/components/input/ActionTextArea.tsx @@ -0,0 +1,59 @@ +'use client'; + +import { useRef, useState } from 'react'; +import Image from 'next/image'; +import clsx from 'clsx'; +import TextArea from './TextArea'; +import { ActionTextAreaProps } from './types/types'; +import arrowActive from '@/assets/buttons/arrow/arrowUpActivedButton.svg'; +import arrowInactive from '@/assets/buttons/arrow/arrowUpNonActivedButton.svg'; +import styles from './styles/ActionTextArea.module.css'; + +/** + * 전송 버튼이 포함된 텍스트 입력 컴포넌트. + * 텍스트를 입력하면 전송 버튼이 활성화되고, 높이가 내용에 맞게 자동 조절됩니다. + * CommentInput의 기반 컴포넌트로, 단독으로도 사용할 수 있습니다. + */ +export default function ActionTextArea({ + onSubmit, + wrapperClassName, + className, + onChange, + ...props +}: ActionTextAreaProps) { + const [hasValue, setHasValue] = useState(false); + const textareaRef = useRef(null); + + return ( +
+