chore: merge web repo history into monorepo at web/
git-subtree-dir: web git-subtree-mainline:75a0ba593dgit-subtree-split:8f624e7416
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Bell, Shield, HelpCircle, LogOut, ChevronLeft } from "lucide-react";
|
||||
import { Card } from "@/components/ui/Card";
|
||||
import { Button } from "@/components/ui/Button";
|
||||
import { useAuth } from "@/lib/auth-context";
|
||||
|
||||
const settingsLinks = [
|
||||
{ icon: Bell, label: "اعلانها", href: "/settings/notifications" },
|
||||
{ icon: Shield, label: "حریم خصوصی و امنیت", href: "/settings/privacy" },
|
||||
{ icon: HelpCircle, label: "راهنما و پشتیبانی", href: "/settings/help" },
|
||||
];
|
||||
|
||||
export default function SettingsPage() {
|
||||
const router = useRouter();
|
||||
const { user, logout } = useAuth();
|
||||
|
||||
function handleLogout() {
|
||||
logout();
|
||||
router.push("/login");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 px-5 pt-[calc(env(safe-area-inset-top)+16px)] pb-8">
|
||||
<h1 className="font-[var(--font-display)] font-extrabold text-[22px] px-1">
|
||||
تنظیمات ⚙️
|
||||
</h1>
|
||||
|
||||
<Card className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-[13px] text-(--color-content-tertiary)">شماره موبایل</p>
|
||||
<p dir="ltr" className="text-[15px] font-bold text-(--color-content-primary)">
|
||||
{user?.phone}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card padded={false} className="overflow-hidden">
|
||||
{settingsLinks.map((item, i) => {
|
||||
const Icon = item.icon;
|
||||
return (
|
||||
<button
|
||||
key={item.label}
|
||||
onClick={() => router.push(item.href)}
|
||||
className={`w-full flex items-center gap-3 px-4 py-3.5 text-right hover:bg-(--color-bg-secondary) transition-colors ${
|
||||
i !== settingsLinks.length - 1 ? "border-b border-(--color-border-subtle)" : ""
|
||||
}`}
|
||||
>
|
||||
<Icon size={18} className="text-(--color-content-secondary) shrink-0" />
|
||||
<span className="flex-1 text-[14px] text-(--color-content-primary)">
|
||||
{item.label}
|
||||
</span>
|
||||
<ChevronLeft size={16} className="text-(--color-content-tertiary)" />
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</Card>
|
||||
|
||||
<Button
|
||||
variant="tertiary"
|
||||
size="lg"
|
||||
isBlock
|
||||
icon={<LogOut size={17} />}
|
||||
onClick={handleLogout}
|
||||
className="!text-(--color-status-error) !border-red-200 mt-4"
|
||||
>
|
||||
خروج از حساب
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user