diff --git a/src/App.tsx b/src/App.tsx index 28c2406..64c3359 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import './App.css' -import { CommentItem, CommentListContainer, CommentPagination, SubCommentData } from './Comment'; +import { CommentInput, CommentItem, CommentListContainer, CommentPagination, SubCommentData } from './Comment'; import CommentHeader from './CommentHeader'; import { Footer } from './Footer'; import { GalleryContent } from './Gallery'; @@ -163,6 +163,7 @@ const comments: SubCommentData[] = [ function App() { return (
+
@@ -198,6 +199,7 @@ function App() { }} /> +
@@ -205,6 +207,7 @@ function App() {
+
) diff --git a/src/Comment.tsx b/src/Comment.tsx index 511c9ad..c9a17b8 100644 --- a/src/Comment.tsx +++ b/src/Comment.tsx @@ -1,6 +1,7 @@ import { Separator } from "./Separator"; import { AuthorData } from "./table"; import { cn } from "./util/cn"; +import React, { useState } from 'react'; interface CommentDataBase { id: number; @@ -261,4 +262,209 @@ export const CommentPagination: React.FC = ({ ); -}; \ No newline at end of file +}; + +export function CommentInput() { + const [isNicknameTooltipVisible, setIsNicknameTooltipVisible] = useState(true); // Show initially based on HTML + const [isDcConInfoVisible, setIsDcConInfoVisible] = useState(false); // Hidden initially + + // TODO: Implement state for input values + // const [nickname, setNickname] = useState(''); + // const [password, setPassword] = useState(''); + // const [comment, setComment] = useState(''); + + const toggleDcConInfo = () => setIsDcConInfoVisible(!isDcConInfoVisible); + const hideNicknameTooltip = () => setIsNicknameTooltipVisible(false); + + return ( +
+ {/* Use flexbox for layout instead of floats */} +
+ + {/* Left Column: Nickname/Password */} +
+ {/* Nickname Input */} +
+ + + {/* Nickname Tooltip */} + {isNicknameTooltipVisible && ( +
+
+

+ ㅇㅇ는 갤러리에서 권장하는 비회원 전용
+ 갤닉네임입니다. (삭제 시 닉네임 등록 가능) +

+ +
+
+
+ )} + + {/* Actual Input */} + setNickname(e.target.value)} + className="align-top text-xs font-apple w-[126px] h-[28px] leading-tight-29 py-[1px] px-[7px] text-custom-blue-dark border-none outline-none" + placeholder="닉네임" // Use placeholder attribute + /> + {/* Delete Button (Implement functionality if needed) */} + + + {/* Hidden 'Use Gallery Nickname' Button */} + +
+ + {/* Password Input */} +
+ + setPassword(e.target.value)} + className="align-top text-xs font-apple w-[126px] h-[28px] leading-tight-29 py-[1px] px-[7px] border-none outline-none" + placeholder="비밀번호" // Use placeholder attribute + /> +
+
+ + {/* Right Column: Textarea and Buttons */} + {/* Calculate width: 100% - left column width - gap. Or use flex-grow */} +
{/* Adjust margin as needed */} + {/* Textarea */} +
+ +