fix deploy
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { useGetDetailService } from './hooks/useServiceData'
|
import { useGetDetailService } from './hooks/useServiceData'
|
||||||
import ServiceHeader from './components/ServiceHeader'
|
|
||||||
import HeaderBuy from './components/HeaderBuy'
|
import HeaderBuy from './components/HeaderBuy'
|
||||||
import PageLoading from '../../components/PageLoading'
|
import PageLoading from '../../components/PageLoading'
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
import { FC, useEffect, useState } from 'react'
|
import { FC, useEffect, useState } from 'react'
|
||||||
import RadioGroup from '../../../components/RadioGroup'
|
import RadioGroup from '../../../components/RadioGroup'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import ShareIcon from '../../../assets/images/share.svg'
|
|
||||||
import Button from '../../../components/Button'
|
import Button from '../../../components/Button'
|
||||||
import { ArrowLeft } from 'iconsax-react'
|
import { ArrowLeft } from 'iconsax-react'
|
||||||
import { PlanItemType, ServiceDetailDataType } from '../types/ServiecTypes'
|
import { PlanItemType, ServiceDetailDataType } from '../types/ServiecTypes'
|
||||||
import { NumberFormat } from '../../../config/func'
|
import { NumberFormat } from '../../../config/func'
|
||||||
import { useBuyService } from '../hooks/useServiceData'
|
import { useBuyService } from '../hooks/useServiceData'
|
||||||
import { toast } from 'react-toastify'
|
import { Link } from 'react-router-dom'
|
||||||
import { Link, useNavigate } from 'react-router-dom'
|
|
||||||
import { Pages } from '../../../config/Pages'
|
import { Pages } from '../../../config/Pages'
|
||||||
import { ErrorType } from '../../../helpers/types'
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
data: ServiceDetailDataType,
|
data: ServiceDetailDataType,
|
||||||
@@ -18,7 +15,6 @@ type Props = {
|
|||||||
|
|
||||||
const ServiceHeader: FC<Props> = (props: Props) => {
|
const ServiceHeader: FC<Props> = (props: Props) => {
|
||||||
|
|
||||||
const navigate = useNavigate()
|
|
||||||
const { data } = props
|
const { data } = props
|
||||||
const { t } = useTranslation('global')
|
const { t } = useTranslation('global')
|
||||||
const [planSelected, setPlanSelected] = useState<string>(data?.subscriptionPlans[0]?.id)
|
const [planSelected, setPlanSelected] = useState<string>(data?.subscriptionPlans[0]?.id)
|
||||||
@@ -38,18 +34,6 @@ const ServiceHeader: FC<Props> = (props: Props) => {
|
|||||||
|
|
||||||
}, [planSelected])
|
}, [planSelected])
|
||||||
|
|
||||||
const handleBuy = () => {
|
|
||||||
buyService.mutate({ serviceId: data.id, planId: planSelected }, {
|
|
||||||
onSuccess: () => {
|
|
||||||
toast.success(t('success'))
|
|
||||||
navigate(Pages.services.mine)
|
|
||||||
},
|
|
||||||
onError: (error: ErrorType) => {
|
|
||||||
toast.error(error.response?.data?.error?.message[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full p-6 bg-white rounded-3xl flex xl:flex-row flex-col items-end xl:justify-between'>
|
<div className='w-full p-6 bg-white rounded-3xl flex xl:flex-row flex-col items-end xl:justify-between'>
|
||||||
|
|||||||
Reference in New Issue
Block a user