-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(public-layout): scaffold - CommentsPage
- Loading branch information
Showing
3 changed files
with
152 additions
and
5 deletions.
There are no files selected for viewing
66 changes: 61 additions & 5 deletions
66
app/(public)/users/[userHandle]/posts/[slug]/comments/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
|
||
import { Send } from 'lucide-react'; | ||
|
||
import { IconButton } from '@/components/ui/icon-button'; | ||
import { cn } from '@/lib/utils'; | ||
|
||
const ChatInput = () => { | ||
const [value, setValue] = useState<string>(''); | ||
|
||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const { value } = event.target; | ||
|
||
setValue(value); | ||
}; | ||
|
||
return ( | ||
<div | ||
className={cn( | ||
'mx-4 mt-4 flex items-center rounded-full bg-blccu-neutral-200/50 py-2 pl-7 pr-5', | ||
'transition-shadow focus-within:outline-none focus-within:ring-1 focus-within:ring-blccu-ring', | ||
)} | ||
> | ||
<input | ||
className={cn( | ||
'w-full bg-transparent', | ||
'focus:outline-none', | ||
'placeholder:text-blccu-neutral-400', | ||
)} | ||
placeholder="댓글을 작성하세요." | ||
value={value} | ||
onChange={handleChange} | ||
/> | ||
<IconButton className="ml-2"> | ||
<Send className="h-5 w-5 text-blccu-neutral-600" /> | ||
</IconButton> | ||
</div> | ||
); | ||
}; | ||
|
||
export { ChatInput }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import Link from 'next/link'; | ||
|
||
import { EllipsisVertical } from 'lucide-react'; | ||
|
||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; | ||
import { IconButton } from '@/components/ui/icon-button'; | ||
import { ROUTES } from '@/constants/routes'; | ||
import { ReportCommentBottomActionSheet } from '@/features/comments-page/report-comment-bottom-action-sheet'; | ||
|
||
type CommentableListItemProps = { | ||
username: string; | ||
handle: string; | ||
profileImage: string; | ||
content: string; | ||
}; | ||
|
||
const CommentableListItem = ({ | ||
username, | ||
handle, | ||
profileImage, | ||
content, | ||
}: CommentableListItemProps) => { | ||
return ( | ||
<div className="flex flex-col gap-2"> | ||
<div className="flex items-center justify-between"> | ||
<div className="flex items-center gap-2"> | ||
<Link href={ROUTES.USER_HANDLE_OF(handle)}> | ||
<Avatar size="xs"> | ||
<AvatarImage src={profileImage} /> | ||
<AvatarFallback className="bg-blccu-neutral-400" /> | ||
</Avatar> | ||
</Link> | ||
<p className="text-sm font-medium">{username}</p> | ||
</div> | ||
<ReportCommentBottomActionSheet | ||
trigger={ | ||
<IconButton> | ||
<EllipsisVertical className="h-4 w-4 text-blccu-neutral-400" /> | ||
</IconButton> | ||
} | ||
/> | ||
</div> | ||
<p className="text-sm text-blccu-neutral-600">{content}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export { CommentableListItem }; |