From 002e420d859fb289ec756e8ffd3683681bc26711 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Tue, 4 Mar 2025 10:16:47 +0330 Subject: [PATCH] box services --- src/components/ServiceItem.tsx | 26 +++++-- src/langs/fa.json | 5 +- src/pages/notification/Notification.tsx | 9 ++- src/pages/service/MyServices.tsx | 50 ++----------- .../service/components/OtherServices.tsx | 72 ++++++++++++------- src/pages/service/types/ServiecTypes.ts | 1 + 6 files changed, 85 insertions(+), 78 deletions(-) diff --git a/src/components/ServiceItem.tsx b/src/components/ServiceItem.tsx index 0ceff18..4728637 100644 --- a/src/components/ServiceItem.tsx +++ b/src/components/ServiceItem.tsx @@ -9,7 +9,8 @@ import { ItemServiceType } from '../pages/service/types/ServiecTypes' type Props = { item: ItemServiceType, className?: string, - isLinkPanel?: boolean + isLinkPanel?: boolean, + businessName?: string } const ServiceItem: FC = (props: Props) => { @@ -18,13 +19,21 @@ const ServiceItem: FC = (props: Props) => { const { item } = props return ( -
+
{item.name}
-
- {item.name} +
+
+ {item.name} +
+ { + props.isLinkPanel && +
+ {props.businessName} +
+ }
@@ -32,12 +41,17 @@ const ServiceItem: FC = (props: Props) => {
- + diff --git a/src/langs/fa.json b/src/langs/fa.json index 93e1a9d..35d805c 100644 --- a/src/langs/fa.json +++ b/src/langs/fa.json @@ -94,6 +94,7 @@ "not_active_service": "شما هنوز سرویس فعالی ندارید", "detail": "جزییات بیشتر" }, + "panel_service": "پنل سرویس", "all": "همه", "service": { "my_service": "سرویس های من", @@ -206,11 +207,11 @@ "company_name": "نام شرکت/ سازمان :", "registration_number": "شماره ثبت :", "tel_company": "تلفن شرکت :", - "national_code": "کد ملی نماینده :", + "national_code": " شناسه ملی :", "postal_code": "کد پستی :", "state": "استان :", "city": "شهر :", - "address": "آدرس :", + "address": "آدرس ثبتی :", "detail_receip": "مشخصات صورتحساب", "not_paid": "پرداخت نشده", "description": "توضیحات", diff --git a/src/pages/notification/Notification.tsx b/src/pages/notification/Notification.tsx index 8e53b46..81e25e1 100644 --- a/src/pages/notification/Notification.tsx +++ b/src/pages/notification/Notification.tsx @@ -144,9 +144,12 @@ const Notifications: FC = () => { { posts.map((item: NotificationItemType) => (
handleRedirect(item.type)} className="bg-white cursor-pointer h-fit gap-4 items-start rounded-xl bg-opacity-60 p-3 mb-4 flex" key={item.id}> -
- -
+ { + !item.isRead && +
+ +
+ }
{item.message}
diff --git a/src/pages/service/MyServices.tsx b/src/pages/service/MyServices.tsx index 5291b9c..0770d87 100644 --- a/src/pages/service/MyServices.tsx +++ b/src/pages/service/MyServices.tsx @@ -1,15 +1,13 @@ import { FC, useState } from 'react' import { useTranslation } from 'react-i18next' import Input from '../../components/Input' -import ServiceSection from '../../components/ServiceSection' -import StatusCircle from '../../components/StatusCircle' import { useGetMyServices } from './hooks/useServiceData' import { MyServicesItem } from './types/ServiecTypes' import { useGetAds } from '../ads/hooks/useAdsData' import { AdsDisplayLocation } from '../ads/types/AdsTypes' import { Helmet } from 'react-helmet-async' import ServiceItemSkeleton from './components/ServiceItemSkeleton' -import { clx } from '../../helpers/utils' +import ServiceItem from '../../components/ServiceItem' const MyServices: FC = () => { @@ -59,46 +57,12 @@ const MyServices: FC = () => { : getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => { return ( - -
- -
-
- -
- { - item.status === 'ACTIVE' ? - t('active') - : - t('inactive') - } -
-
-
+ ) }) } diff --git a/src/pages/service/components/OtherServices.tsx b/src/pages/service/components/OtherServices.tsx index 9ac048f..2c979bf 100644 --- a/src/pages/service/components/OtherServices.tsx +++ b/src/pages/service/components/OtherServices.tsx @@ -5,11 +5,7 @@ import { useGetCategoriesPublic, useGetServicesByCategory } from '../hooks/useSe import { SwiperSlide, Swiper } from 'swiper/react' import { CategoryItemType, ItemServiceType } from '../types/ServiecTypes' import { clx } from '../../../helpers/utils' -import ServiceSection from '../../../components/ServiceSection' -import { Link } from 'react-router-dom' -import Button from '../../../components/Button' -import { ArrowLeft } from 'iconsax-react' -import { Pages } from '../../../config/Pages' +import ServiceItem from '../../../components/ServiceItem' const OtherServicesComponent: FC = () => { @@ -62,31 +58,59 @@ const OtherServicesComponent: FC = () => { { getServices.data?.data?.services?.map((item: ItemServiceType) => { return ( -
-
- - - - -
- -
+ ) }) } +
-
+ + {/* +
+ +
+
+ +
+ { + item.status === 'ACTIVE' ? + t('active') + : + t('inactive') + } +
+
+
*/} +
) } diff --git a/src/pages/service/types/ServiecTypes.ts b/src/pages/service/types/ServiecTypes.ts index b05180e..f0d08ce 100644 --- a/src/pages/service/types/ServiecTypes.ts +++ b/src/pages/service/types/ServiecTypes.ts @@ -81,6 +81,7 @@ export type MyServicesItem = { endDate: string; id: string; isCanceled: boolean; + businessName: string; plan: { id: string; createdAt: string;