Skip to content

Commit

Permalink
[FE] Feat #133: 댓글 입력 컴포넌트 개발
Browse files Browse the repository at this point in the history
Change-Id: I4d1a03063907920d80c30f48c907f0b70b6e206e
  • Loading branch information
leewooseong committed Feb 7, 2024
1 parent 941cf86 commit b40f01f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions frontend/src/pages/Bucket/BucketDetail/Comment/CommentInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ChangeEvent, useState } from 'react'

const CommentInput = () => {
const [commentText, setCommentText] = useState('')
const handleCommentChange = (event: ChangeEvent<HTMLInputElement>) => {
const text = event.currentTarget.value
setCommentText(text)
}

return (
<div className="fixed bottom-0 flex w-full px-6 py-3 bg-white border-t-[1px] border-gray">
<img src="/public/defaultProfile.svg" />
<input
type="text"
placeholder="댓글 입력하기..."
value={commentText}
onChange={handleCommentChange}
className="px-3 grow focus:outline-none"
/>
<button type="button" className={`${commentText ? 'text-point1' : 'text-gray'}`}>
등록
</button>
</div>
)
}

export default CommentInput
2 changes: 2 additions & 0 deletions frontend/src/pages/Bucket/BucketDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import WriteReviewButton from './WriteReviewButton'
import { useParams } from 'react-router-dom'
import Reaction from './Reaction'
import CommentList from './Comment/CommentList'
import CommentInput from './Comment/CommentInput'

const userInfo: UserInfoType = {
userId: 1,
Expand Down Expand Up @@ -98,6 +99,7 @@ const BucketDetail = () => {
<Reaction />
<CommentList />
</WithHeaderLayout>
<CommentInput />
</>
)
}
Expand Down
1 change: 1 addition & 0 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const colorPalette = {
point1: '#454645',
unActive: '#D9D9D9',
lightGray: '#F6F6F6',
gray: '#c4c4c4',
subText: '#ACADAD',
inputBg: '#F8F8F8',
disabled: '#737373',
Expand Down

0 comments on commit b40f01f

Please sign in to comment.