diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 118e637..b9afeef 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -21,11 +21,11 @@ export const metadata = { const About: NextPage = () => { return (
-
+

درباره ی داناک

-
+
قبل از تبدیل شدن داناک به یک شرکت ، یک ایده بودیم. ایده ای نه برای ساخت یک محصول یا خدمت جدید، ایده ای برای ساخت یک فرهنگ خلاقانه و ارزش محور. داناک با این باور متولد شده که استعداد ، توانایی و تعهد افراد می تواند موتور محرکه شرکتی رو به آینده باشد. شرکتی که توانایی انجام کارهای شگفت انگیز و فوق العاده ای دارد و غیر ممکن ها را ممکن می سازد. داناک ترکیبی از بهترین مهندسین ، توانمندترین متخصصین ، جدیدترین تکنولوژی ها و خلاقانه ترین ایده هاست. به پشتوانه این ترکیب فوق العاده می توانیم با ارائه راه کار های مبتنی بر نرم افزار ، هوش مصنوعی و آنالیز داده به شما کمک کنیم تا سازمان خود را بهتر رصد کنید و تصمیم های هوشمندانه تری اتخاذ نمایید.
diff --git a/src/app/blogs/components/BigBlogItem.tsx b/src/app/blogs/components/BigBlogItem.tsx index 7906889..adc4382 100644 --- a/src/app/blogs/components/BigBlogItem.tsx +++ b/src/app/blogs/components/BigBlogItem.tsx @@ -13,7 +13,7 @@ const BigBlogItem: FC = ({ item }) => { return (
- blog + blog
diff --git a/src/app/blogs/components/BlogList.tsx b/src/app/blogs/components/BlogList.tsx index 0482fd4..c825db0 100644 --- a/src/app/blogs/components/BlogList.tsx +++ b/src/app/blogs/components/BlogList.tsx @@ -27,7 +27,9 @@ const BlogList: FC = () => {
- +
+ +
{ @@ -68,6 +70,8 @@ const BlogList: FC = () => { } + +
@@ -76,6 +80,9 @@ const BlogList: FC = () => { ))}
+
+ +
diff --git a/src/app/blogs/components/CreateReview.tsx b/src/app/blogs/components/CreateReview.tsx index 7b6b8b6..a213d36 100644 --- a/src/app/blogs/components/CreateReview.tsx +++ b/src/app/blogs/components/CreateReview.tsx @@ -5,12 +5,12 @@ import Button from '../../../components/Button' import { useFormik } from 'formik' import * as Yup from 'yup' import { ErrorType } from '../../../helpers/types' -import { toast } from 'react-toastify' import { useCreateBlogComment } from '../hooks/useBlogsData' import { CreateBlogCommentType } from '../types/BlogTypes' import { useSharedStore } from '@/shared/store/sharedStore' import Link from 'next/link' import { LOGIN_URL } from '@/config/const' +import { toast } from '@/components/Toast' type Props = { refetch: () => void id: string @@ -41,7 +41,7 @@ const CreateReview: FC = ({ refetch, id }) => { if (error.response && 'status' in error.response && error.response.status === 401) { window.location.href = LOGIN_URL + '?redirect=' + window.location.href } else { - toast.error(error.response?.data?.error?.message?.[0] || 'An error occurred') + toast(error.response?.data?.error?.message?.[0] || 'An error occurred', 'error') } } }) diff --git a/src/app/contact/ContactForm.tsx b/src/app/contact/ContactForm.tsx index f2176bd..90904c3 100644 --- a/src/app/contact/ContactForm.tsx +++ b/src/app/contact/ContactForm.tsx @@ -8,8 +8,8 @@ import { CreateContactType } from './types/ContactTypes' import { useFormik } from 'formik' import * as Yup from 'yup' import { useCreateContact } from './hooks/useContactData' -import { toast } from 'react-toastify' import { ErrorType } from '@/helpers/types' +import { toast } from '@/components/Toast' const ContactForm = () => { @@ -33,11 +33,11 @@ const ContactForm = () => { onSubmit: (values) => { createContact.mutate(values, { onSuccess: () => { - toast.success('پیام شما با موفقیت ثبت شد') + toast('پیام شما با موفقیت ثبت شد', 'success') formik.resetForm() }, onError: (error: ErrorType) => { - toast.error(error.response?.data?.error.message[0]) + toast(error.response?.data?.error.message[0] || 'An error occurred', 'error') } }) }, diff --git a/src/app/home/HeroSection.tsx b/src/app/home/HeroSection.tsx index be616cc..fd95c58 100644 --- a/src/app/home/HeroSection.tsx +++ b/src/app/home/HeroSection.tsx @@ -27,13 +27,13 @@ const HeroSection: FC = () => { />
-
-

{item.title}

-

{item.description}

+
+

{item.title}

+

{item.description}

+ {/* */} diff --git a/src/app/products/ProductsPage.tsx b/src/app/products/ProductsPage.tsx index 78daf03..626744a 100644 --- a/src/app/products/ProductsPage.tsx +++ b/src/app/products/ProductsPage.tsx @@ -36,7 +36,7 @@ const Products: FC = () => {
product void; + +const ToastContainer: React.FC = () => { + const [toasts, setToasts] = useState([]); + + // ثبت toast جدید + const showToast = (toast: Toast) => { + setToasts((prev) => [...prev, toast]); + + // حذف خودکار بعد از ۳ ثانیه + setTimeout(() => { + setToasts((prev) => prev.filter((t) => t.id !== toast.id)); + }, 3000); + }; + + // تخصیص تابع نمایش toast به متغیر سراسری + useEffect(() => { + addToast = showToast; + }, []); + + return ( +
+ {toasts.map((toast) => ( +
+ { + toast.type === 'success' ? : + toast.type === 'error' ? : + + } + {toast.message} +
+ ))} +
+ ); +}; + +export const toast = (message: string, type: 'success' | 'error' | 'info' = 'info') => { + addToast({ id: Date.now().toString(), message, type }); +}; + +export default ToastContainer; \ No newline at end of file diff --git a/src/shared/Footer.tsx b/src/shared/Footer.tsx index 41b8a21..ab673a2 100644 --- a/src/shared/Footer.tsx +++ b/src/shared/Footer.tsx @@ -93,7 +93,7 @@ const Footer: FC = () => {
-
+
خبرنامه
@@ -173,6 +173,10 @@ const Footer: FC = () => { + + enamad trust seal + +
© 2025 Danak. All rights reserved.