refactor(profile): move edit action to profile page

This commit is contained in:
2026-06-12 15:09:04 +03:30
parent 492bfd9918
commit 971b709169
2 changed files with 7 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
import type { ReactNode } from "react"; import type { ReactNode } from "react";
import { useMemo } from "react"; import { useMemo } from "react";
import { LayoutDashboard, LogOut, PencilLine, RotateCcw, UserRound } from "lucide-react"; import { LayoutDashboard, LogOut, RotateCcw, UserRound } from "lucide-react";
import { Link, NavLink } from "@/lib/router"; import { Link, NavLink } from "@/lib/router";
import { useAuth } from "@/contexts/AuthContext"; import { useAuth } from "@/contexts/AuthContext";
import ModeToggle from "@/components/ModeToggle"; import ModeToggle from "@/components/ModeToggle";
@@ -89,12 +89,6 @@ function ProfileAvatarMenu() {
<UserRound className="h-4 w-4" /> <UserRound className="h-4 w-4" />
</Link> </Link>
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl">
<Link to="/profile?edit=1">
ویرایش پروفایل
<PencilLine className="h-4 w-4" />
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl"> <DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl">
<Link to="/reset-password"> <Link to="/reset-password">
تغییر یا بازیابی رمز تغییر یا بازیابی رمز

View File

@@ -545,6 +545,12 @@ export default function Profile() {
<> <>
<Card className="overflow-hidden rounded-[2rem] border border-border/70 shadow-lg"> <Card className="overflow-hidden rounded-[2rem] border border-border/70 shadow-lg">
<CardContent className="space-y-6 p-6 text-center"> <CardContent className="space-y-6 p-6 text-center">
<div className="flex justify-start">
<Button variant="outline" size="sm" className="rounded-full" onClick={() => setEditing(true)}>
<PencilLine className="ml-2 h-4 w-4" />
ویرایش
</Button>
</div>
<div className="flex justify-center">{renderAvatarControl()}</div> <div className="flex justify-center">{renderAvatarControl()}</div>
<div> <div>
<h1 className="text-2xl font-bold">{fullName}</h1> <h1 className="text-2xl font-bold">{fullName}</h1>