ads and invoce

This commit is contained in:
hamid zarghami
2025-02-22 10:51:30 +03:30
parent e094736c0e
commit 06f7f6b3d8
10 changed files with 393 additions and 153 deletions
+18 -11
View File
@@ -1,5 +1,4 @@
import { FC, Fragment } from 'react'
import RobotImage from '../../assets/images/robot.jpeg'
import { useTranslation } from 'react-i18next'
import Button from '../../components/Button'
import Rate from 'rc-rate'
@@ -12,11 +11,14 @@ import { useGetDetailService } from './hooks/useServiceData'
import { useParams } from 'react-router-dom'
import PageLoading from '../../components/PageLoading'
import moment from 'moment-jalaali'
import { useGetAds } from '../ads/hooks/useAdsData'
import { AdsDisplayLocation } from '../ads/types/AdsTypes'
const DetailService: FC = () => {
const { id } = useParams()
const { t } = useTranslation('global')
const getAdsLeft = useGetAds(AdsDisplayLocation.SINGLE_SERVICE_PAGE)
const getDetailService = useGetDetailService(id ? id : '')
@@ -204,18 +206,23 @@ const DetailService: FC = () => {
</div>
</div>
</div>
<div className='bg-white w-sidebar h-fit hidden xl:block rounded-3xl overflow-hidden relative'>
<img
src={RobotImage}
className='w-full backdrop-blur-[100px] h-[550px] object-cover'
/>
<div className='absolute flex items-center px-4 w-full bottom-0 h-[86px] bg-black bg-opacity-5 backdrop-blur-[14px]'>
<div className='max-w-[80%] text-sm leading-6 text-white'>
سفارش نرمافزار اختصاصی: سرمایه‌ای برای آینده یا فقط هزینهای برای امروز؟
{
getAdsLeft.isSuccess && getAdsLeft.data.data.ads[0] &&
<a href={getAdsLeft.data?.data?.ads[0].link} target='_blank' className='bg-white w-sidebar h-fit hidden xl:block rounded-3xl overflow-hidden relative'>
<img
src={getAdsLeft.data.data.ads[0].imageUrl}
className='w-full backdrop-blur-[100px] h-[550px] object-cover'
/>
<div className='absolute flex items-center px-4 w-full bottom-0 h-[86px] bg-black bg-opacity-5 backdrop-blur-[14px]'>
<div className='max-w-[80%] text-sm leading-6 text-white'>
{getAdsLeft.data.data.ads[0].title}
</div>
</div>
</div>
</div>
</a>
}
</Fragment>
}
+17 -11
View File
@@ -3,17 +3,19 @@ import { useTranslation } from 'react-i18next'
import Input from '../../components/Input'
import ServiceSection from '../../components/ServiceSection'
import StatusCircle from '../../components/StatusCircle'
import BannerImage from '../../assets/images/banner.png'
import { Link } from 'react-router-dom'
import { Pages } from '../../config/Pages'
import { useGetMyServices } from './hooks/useServiceData'
import { MyServicesItem } from './types/ServiecTypes'
import { useGetAds } from '../ads/hooks/useAdsData'
import { AdsDisplayLocation } from '../ads/types/AdsTypes'
const MyServices: FC = () => {
const { t } = useTranslation('global')
const [search, setSearch] = useState<string>('')
const getServices = useGetMyServices(search)
const getAdsLeft = useGetAds(AdsDisplayLocation.MY_SERVICES_PAGE)
return (
<div className='w-full flex gap-6 mt-4'>
@@ -84,18 +86,22 @@ const MyServices: FC = () => {
</div>
</div>
<div className='bg-white w-sidebar hidden xl:block rounded-3xl overflow-hidden relative'>
<img
src={BannerImage}
className='w-full backdrop-blur-[100px] h-[550px] object-cover'
/>
<div className='absolute flex items-center px-4 w-full bottom-0 h-[86px] bg-black bg-opacity-5 backdrop-blur-[14px]'>
<div className='max-w-[80%] text-sm leading-6 text-white'>
سفارش نرمافزار اختصاصی: سرمایه‌ای برای آینده یا فقط هزینهای برای امروز؟
{
getAdsLeft.isSuccess && getAdsLeft.data.data.ads[0] &&
<a href={getAdsLeft.data?.data?.ads[0].link} target='_blank' className='bg-white w-sidebar h-fit hidden xl:block rounded-3xl overflow-hidden relative'>
<img
src={getAdsLeft.data.data.ads[0].imageUrl}
className='w-full backdrop-blur-[100px] h-[550px] object-cover'
/>
<div className='absolute flex items-center px-4 w-full bottom-0 h-[86px] bg-black bg-opacity-5 backdrop-blur-[14px]'>
<div className='max-w-[80%] text-sm leading-6 text-white'>
{getAdsLeft.data.data.ads[0].title}
</div>
</div>
</div>
</div>
</a>
}
</div>
)
}
+4 -4
View File
@@ -32,7 +32,7 @@ const OtherServices: FC = () => {
{
getAds.data?.data?.ads?.map((item: AdsItemType) => {
return (
<div key={item.id} className='relative drtl'>
<a target='_blank' key={item.id} className='relative drtl'>
<img src={item.imageUrl} className='w-full max-h-[300px] h-full object-cover rounded-3xl' />
<div className='absolute bg-black bg-opacity-20 size-full top-0 right-0 py-6 px-8 flex flex-col justify-between'>
<button className="px-8 w-fit py-1.5 bg-white bg-opacity-10 text-white text-sm rounded-full shadow-md ">
@@ -59,7 +59,7 @@ const OtherServices: FC = () => {
</div>
</div>
</div>
</a>
)
})
}
@@ -96,7 +96,7 @@ const OtherServices: FC = () => {
</div>
{
getAdsLeft.isSuccess && getAdsLeft.data.data.ads[0] &&
<div className='bg-white w-sidebar h-fit hidden xl:block rounded-3xl overflow-hidden relative'>
<a href={getAdsLeft.data?.data?.ads[0].link} target='_blank' className='bg-white w-sidebar h-fit hidden xl:block rounded-3xl overflow-hidden relative'>
<img
src={getAdsLeft.data.data.ads[0].imageUrl}
className='w-full backdrop-blur-[100px] h-[550px] object-cover'
@@ -107,7 +107,7 @@ const OtherServices: FC = () => {
{getAdsLeft.data.data.ads[0].title}
</div>
</div>
</div>
</a>
}
</div>
)