feat: add Header and UserNav components, update layout to include Header and enhance profile page with settings link

This commit is contained in:
2025-09-06 21:21:53 +02:00
parent bf2e280cdd
commit 8b82a5e48e
5 changed files with 157 additions and 12 deletions

View File

@@ -70,7 +70,7 @@ export function ThoughtCard({
try {
await deleteThought(thought.id, token);
toast.success("Thought deleted successfully.");
router.refresh(); // Refresh the feed
router.refresh();
} catch (error) {
toast.error("Failed to delete thought.");
} finally {
@@ -101,13 +101,16 @@ export function ThoughtCard({
</div>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0">
<div className="flex items-center gap-4">
<Link
href={`/users/${author.username}`}
className="flex items-center gap-4"
>
<UserAvatar src={author.avatarUrl} alt={author.username} />
<div className="flex flex-col">
<span className="font-bold">{author.username}</span>
<span className="text-sm text-muted-foreground">{timeAgo}</span>
</div>
</div>
</Link>
{isAuthor && (
<DropdownMenu>
<DropdownMenuTrigger asChild>