diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 87b97a3..35f1ebf 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -1,7 +1,8 @@ import InfoBox from '@/components/InfoBox' -import { AddCircle, TickCircle } from 'iconsax-react' +import { TickCircle } from 'iconsax-react' import { NextPage } from 'next' import React from 'react' +import Accordion from '@/components/Accordion' import WhyDanak from '../home/WhyDanak' const About: NextPage = () => { @@ -63,19 +64,19 @@ const About: NextPage = () => { صادرکنندگان نرم افزار
- صادرکنندگان نرم افزار + مشاوره استقرار ISMS
- صادرکنندگان نرم افزار + نظام صنفی
- صادرکنندگان نرم افزار + GDPR
- صادرکنندگان نرم افزار + ISO:27001
- صادرکنندگان نرم افزار + SSAE18
@@ -93,42 +94,9 @@ const About: NextPage = () => {
-
-
-
- تعهد -
- - -
-
-
-
-
- تعهد -
- - -
-
-
-
-
- تعهد -
- - -
-
+ + +
diff --git a/src/app/blogs/[id]/page.tsx b/src/app/blogs/[id]/page.tsx index 91fbed1..8a66de3 100644 --- a/src/app/blogs/[id]/page.tsx +++ b/src/app/blogs/[id]/page.tsx @@ -14,7 +14,6 @@ interface PageProps { const SingleBlog: NextPage = async ({ params }) => { const { id } = await params - console.log("loading", id); return ( }> @@ -24,7 +23,6 @@ const SingleBlog: NextPage = async ({ params }) => { } async function BlogContent({ id }: { id: string }) { - console.log(id) const queryClient = new QueryClient() await Promise.all([ diff --git a/src/app/blogs/components/CreateReview.tsx b/src/app/blogs/components/CreateReview.tsx new file mode 100644 index 0000000..5b13b40 --- /dev/null +++ b/src/app/blogs/components/CreateReview.tsx @@ -0,0 +1,112 @@ +import { FC } from 'react' +import Input from '../../../components/Input' +import Textarea from '../../../components/Textarea' +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' +type Props = { + refetch: () => void + id: string +} + +const CreateReview: FC = ({ refetch, id }) => { + + const { isLogin } = useSharedStore() + + const createReview = useCreateBlogComment() + + const formik = useFormik({ + initialValues: { + title: '', + content: '' + }, + validationSchema: Yup.object({ + title: Yup.string().required('این فیلد الزامی است'), + content: Yup.string().required('این فیلد الزامی است'), + }), + onSubmit: (values) => { + createReview.mutate({ id: id, params: values }, { + onSuccess: () => { + formik.resetForm() + refetch() + }, + onError: (error: ErrorType) => { + 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') + } + } + }) + }, + + }) + + return ( +
+
+ ارسال نظر +
+ + + { + !isLogin ? ( +
+
+ برای ارسال نظر لطفا وارد حساب کاربری خود شوید +
+ +
+ + +
+ + +
+ ) : ( +
+ +
+ +
+ +
+