From e3bfe65d9c1916252dee1b2923d115e3480909be Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 22 Dec 2025 16:33:01 +0330 Subject: [PATCH] setting --- .../(Profile)/profile/settings/page.tsx | 44 +++++++++++-------- src/locales/fa/settings.json | 5 +++ src/types/i18n/settings.ts | 7 +++ 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/src/app/[name]/(Profile)/profile/settings/page.tsx b/src/app/[name]/(Profile)/profile/settings/page.tsx index 1b5d879..3cf37f2 100644 --- a/src/app/[name]/(Profile)/profile/settings/page.tsx +++ b/src/app/[name]/(Profile)/profile/settings/page.tsx @@ -12,19 +12,27 @@ import { getI18nObject } from '@/lib/i18n'; import { SettingsData } from '@/types/i18n/settings'; import { Key, KeySquare, Notification1, ArrowLeft, TickCircle } from 'iconsax-react' import { useRouter } from 'next/navigation'; -import React, { Fragment } from 'react' +import React, { Fragment, useState } from 'react' import { useTranslation } from 'react-i18next'; function UserSettingsIndex() { const router = useRouter(); const { t } = useTranslation('settings'); const data: SettingsData = getI18nObject(t, "data"); + const [statisticalParticipation, setStatisticalParticipation] = useState(true); const onSwitched = (e: React.MouseEvent) => { const target = e.target as HTMLElement; console.log('Save changed setting?', target.id); } + const handleStatisticalToggle = (checked: boolean) => { + setStatisticalParticipation(checked); + console.log('Statistical participation:', checked); + } + + + const notifsTab = () => { return ( @@ -227,23 +235,23 @@ function UserSettingsIndex() { onClick={() => { router.back() }} /> - - } - /> - } - /> - } - /> - + +
+
+

{data.StatisticalParticipation.Heading}

+ +
+

+ {data.StatisticalParticipation.Description} +

+
+ ) } diff --git a/src/locales/fa/settings.json b/src/locales/fa/settings.json index b251aa9..78bb351 100644 --- a/src/locales/fa/settings.json +++ b/src/locales/fa/settings.json @@ -121,6 +121,11 @@ } ], "ButtonSubmit": "راه‌اندازی کد دو مرحله‌ای" + }, + "StatisticalParticipation": { + "Heading": "مشارکت در اطلاعات آماری", + "Description": "اطلاعات آماری در تحقیقات بازاریابی و برای بهبود تجربه استفاده از خدمات به کار میرود.", + "HtmlName": "statistical-participation" } } } \ No newline at end of file diff --git a/src/types/i18n/settings.ts b/src/types/i18n/settings.ts index 4354eed..7b00db1 100644 --- a/src/types/i18n/settings.ts +++ b/src/types/i18n/settings.ts @@ -61,9 +61,16 @@ export interface TabAuthenticator { ButtonSubmit: string; } +export interface StatisticalParticipation { + Heading: string; + Description: string; + HtmlName: string; +} + export interface SettingsData { Heading: string; TabNotifications: TabNotifications; TabPassword: TabPassword; TabAuthenticator: TabAuthenticator; + StatisticalParticipation: StatisticalParticipation; }