Added translation to all site with edit style
All checks were successful
Build frontend / build (push) Successful in 1m40s
All checks were successful
Build frontend / build (push) Successful in 1m40s
This commit is contained in:
@ -3,12 +3,14 @@
|
||||
import { useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { motion } from 'framer-motion';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ShieldAlert, LogOut, MessageSquare, Send, Loader2 } from 'lucide-react';
|
||||
import toast, { Toaster } from 'react-hot-toast';
|
||||
import AuthService from '../services/AuthService';
|
||||
import { sendGeneralReport } from '../utils/api';
|
||||
|
||||
export default function BlockedPage() {
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
const [form, setForm] = useState({ subject: '', body: '' });
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
@ -28,7 +30,7 @@ export default function BlockedPage() {
|
||||
event.preventDefault();
|
||||
|
||||
if (!form.subject.trim() || !form.body.trim()) {
|
||||
toast.error('يرجى تعبئة الموضوع والرسالة');
|
||||
toast.error(t('blocked.fillAllFields'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -38,9 +40,9 @@ export default function BlockedPage() {
|
||||
await sendGeneralReport(form.subject.trim(), form.body.trim());
|
||||
setIsSent(true);
|
||||
setForm({ subject: '', body: '' });
|
||||
toast.success('تم إرسال طلب الدعم بنجاح');
|
||||
toast.success(t('blocked.reportSent'));
|
||||
} catch (error) {
|
||||
toast.error('حدث خطأ أثناء إرسال طلب الدعم. حاول مرة أخرى');
|
||||
toast.error(t('blocked.sendError'));
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
@ -63,9 +65,9 @@ export default function BlockedPage() {
|
||||
>
|
||||
<ShieldAlert className="w-12 h-12 text-red-600" />
|
||||
</motion.div>
|
||||
<h1 className="text-4xl font-bold text-gray-900 mb-3">الحساب محظور</h1>
|
||||
<h1 className="text-4xl font-bold text-gray-900 mb-3">{t('blocked.title')}</h1>
|
||||
<p className="text-gray-600 text-lg max-w-2xl mx-auto">
|
||||
تم تقييد وصولك إلى التطبيق. يمكنك تسجيل الخروج أو مراسلة دعم العملاء للمساعدة في حل المشكلة.
|
||||
{t('blocked.description')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -80,9 +82,9 @@ export default function BlockedPage() {
|
||||
<div className="w-14 h-14 bg-red-50 rounded-2xl flex items-center justify-center mb-6">
|
||||
<LogOut className="w-7 h-7 text-red-600" />
|
||||
</div>
|
||||
<h2 className="text-2xl font-bold text-gray-900 mb-3">تسجيل الخروج</h2>
|
||||
<h2 className="text-2xl font-bold text-gray-900 mb-3">{t('blocked.logoutTitle')}</h2>
|
||||
<p className="text-gray-600 leading-7">
|
||||
إنهاء الجلسة الحالية وإزالة بيانات الدخول من هذا الجهاز.
|
||||
{t('blocked.logoutDesc')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -92,13 +94,13 @@ export default function BlockedPage() {
|
||||
className="mt-8 w-full bg-red-600 hover:bg-red-700 text-white rounded-2xl py-4 font-bold transition-colors flex items-center justify-center gap-3"
|
||||
>
|
||||
<LogOut className="w-5 h-5" />
|
||||
تسجيل الخروج
|
||||
{t('blocked.logoutButton')}
|
||||
</button>
|
||||
</motion.div>
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, x: 24 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: 0.2 }}
|
||||
className="bg-white rounded-3xl shadow-sm border border-gray-200 p-8"
|
||||
>
|
||||
@ -107,30 +109,30 @@ export default function BlockedPage() {
|
||||
<MessageSquare className="w-7 h-7 text-amber-600" />
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-gray-900">مراسلة دعم العملاء</h2>
|
||||
<p className="text-gray-600 mt-1">أرسل تفاصيل المشكلة وسنقوم بمراجعتها.</p>
|
||||
<h2 className="text-2xl font-bold text-gray-900">{t('blocked.contactSupportTitle')}</h2>
|
||||
<p className="text-gray-600 mt-1">{t('blocked.contactSupportDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-5">
|
||||
<div>
|
||||
<label className="block text-sm font-bold text-gray-700 mb-2">الموضوع</label>
|
||||
<label className="block text-sm font-bold text-gray-700 mb-2">{t('subject')}</label>
|
||||
<input
|
||||
type="text"
|
||||
value={form.subject}
|
||||
onChange={(event) => updateField('subject', event.target.value)}
|
||||
placeholder="اكتب موضوع الرسالة"
|
||||
placeholder={t('blocked.subjectPlaceholder')}
|
||||
className="w-full px-4 py-3 bg-white border border-gray-200 rounded-2xl focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent text-gray-900 placeholder-gray-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-bold text-gray-700 mb-2">الرسالة</label>
|
||||
<label className="block text-sm font-bold text-gray-700 mb-2">{t('blocked.messageLabel')}</label>
|
||||
<textarea
|
||||
value={form.body}
|
||||
onChange={(event) => updateField('body', event.target.value)}
|
||||
rows={6}
|
||||
placeholder="اشرح المشكلة بالتفصيل"
|
||||
placeholder={t('blocked.messagePlaceholder')}
|
||||
className="w-full px-4 py-3 bg-white border border-gray-200 rounded-2xl focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent text-gray-900 placeholder-gray-400 resize-none"
|
||||
/>
|
||||
</div>
|
||||
@ -143,17 +145,17 @@ export default function BlockedPage() {
|
||||
{isSubmitting ? (
|
||||
<>
|
||||
<Loader2 className="w-5 h-5 animate-spin" />
|
||||
جاري الإرسال...
|
||||
{t('blocked.sending')}
|
||||
</>
|
||||
) : isSent ? (
|
||||
<>
|
||||
<Send className="w-5 h-5" />
|
||||
تم الإرسال
|
||||
{t('blocked.sentButton')}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Send className="w-5 h-5" />
|
||||
إرسال الرسالة
|
||||
{t('blocked.sendButton')}
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
@ -163,4 +165,4 @@ export default function BlockedPage() {
|
||||
</motion.div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user