diff options
| author | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-04-27 13:45:25 +0300 |
|---|---|---|
| committer | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-04-27 13:45:25 +0300 |
| commit | ab330c64eeed9edfc2a6ef6a6f5cd38587ba0996 (patch) | |
| tree | 9ca46c6552e427a9461387dc63362be0f9301acb /src/app/profile | |
| parent | c7d2526afec5ffb8918c20d7c1c58852f1c647bd (diff) | |
add username change and logout
Diffstat (limited to 'src/app/profile')
| -rw-r--r-- | src/app/profile/AccountButton.tsx | 17 | ||||
| -rw-r--r-- | src/app/profile/[username]/page.tsx | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/app/profile/AccountButton.tsx b/src/app/profile/AccountButton.tsx new file mode 100644 index 0000000..6eb0519 --- /dev/null +++ b/src/app/profile/AccountButton.tsx @@ -0,0 +1,17 @@ +'use client'; + +import Link from 'next/link'; +import { Button } from '@/components/ui'; +import { useUser } from '@/lib/contexts/Auth.context'; + +export default function AccountButton() { + const user = useUser(); + + if (!user) return null; + + return ( + <Button asChild> + <Link href="/settings">Управление аккаунтом</Link> + </Button> + ); +} diff --git a/src/app/profile/[username]/page.tsx b/src/app/profile/[username]/page.tsx index ea13b36..cb79b7b 100644 --- a/src/app/profile/[username]/page.tsx +++ b/src/app/profile/[username]/page.tsx @@ -1,4 +1,4 @@ -import AccountButton from '@/components/settings/AccountButton'; +import AccountButton from '../AccountButton'; import { getUserByUsername } from '@/lib/api/user'; import { User } from '@/lib/contexts/Auth.context'; |
