diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 75afbd4..87ebe55 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -1,4 +1,4 @@ -import { FC, InputHTMLAttributes, useState } from 'react' +import { FC, InputHTMLAttributes, useEffect, useState } from 'react' import { clx } from '../helpers/utils'; import EyeIcon from '../assets/images/eye.svg' import { SearchNormal } from 'iconsax-react'; @@ -15,11 +15,22 @@ type Props = { unit?: string; seprator?: boolean; isNotRequired?: boolean; + onChangeSearchFinal?: (value: string) => void; } & InputHTMLAttributes const Input: FC = (props: Props) => { const [showPassword, setShowPassword] = useState(false) + const [search, setSearch] = useState('') + + useEffect(() => { + if (props.variant === 'search' && props.onChangeSearchFinal) { + const timeout = setTimeout(() => { + props.onChangeSearchFinal?.(search) + }, 1000) + return () => clearTimeout(timeout) + } + }, [search, props]) const inputClass = clx( 'w-full h-10 text-black block px-4 text-xs rounded-xl border border-border', @@ -36,7 +47,10 @@ const Input: FC = (props: Props) => {
- + { + setSearch(e.target.value) + props.onChange?.(e) + }} type={props.type === 'password' && showPassword ? 'text' : props.type === 'password' ? 'password' : undefined} className={inputClass} /> { props.type === 'password' && diff --git a/src/components/Radio.tsx b/src/components/Radio.tsx index a8282af..4f7dcdc 100644 --- a/src/components/Radio.tsx +++ b/src/components/Radio.tsx @@ -2,8 +2,8 @@ import { FC } from 'react' type Props = { isActive: boolean, - value: 'year' | '3month' | 'month', - onChange: (value: 'year' | '3month' | 'month') => void + value: string, + onChange: (value: string) => void } const Radio: FC = (props: Props) => { diff --git a/src/components/RadioGroup.tsx b/src/components/RadioGroup.tsx index f68c939..0421109 100644 --- a/src/components/RadioGroup.tsx +++ b/src/components/RadioGroup.tsx @@ -5,10 +5,10 @@ import Radio from './Radio' type Props = { items: { label: string - value: 'year' | '3month' | 'month' + value: string }[] selected: string - onChange: (value: 'year' | '3month' | 'month') => void + onChange: (value: string) => void } const RadioGroup: FC = (props: Props) => { diff --git a/src/config/func.ts b/src/config/func.ts index 09e5992..771066a 100644 --- a/src/config/func.ts +++ b/src/config/func.ts @@ -4,7 +4,8 @@ export function isEmail(input: string): boolean { } export function NumberFormat(number: number): string { - return Intl.NumberFormat("fa-IR").format(number); + return Intl.NumberFormat().format(number); + // return Intl.NumberFormat("fa-IR").format(number); } export const timeAgo = (date: string | Date): string => { diff --git a/src/pages/criticisms/Add.tsx b/src/pages/criticisms/Add.tsx index 1d4057d..e873ba3 100644 --- a/src/pages/criticisms/Add.tsx +++ b/src/pages/criticisms/Add.tsx @@ -57,7 +57,7 @@ const AddCriticisms: FC = () => {
- {t('ticket.title_hint')} + انتقادات و پیشنهادهای شما برای ما راه گشاست:
@@ -66,7 +66,7 @@ const AddCriticisms: FC = () => {
- سوالات - مشکلاتی که به یک موضوع مربوط میشوند را در یک درخواست پشتیبانی پیگیر باشید و چند درخواست برای یک موضوع باز نکنید. + در صورتیکه از دپارتمان خاصی انتقادی دارید لطفا در متن توضیحات مشخص نمایید تا ما راحت تر بتوانیم نقد شما را بررسی کنیم.
@@ -74,7 +74,7 @@ const AddCriticisms: FC = () => {
- لطفاً برای بررسی و رفع مشکلات احتمالی صبور باشید بررسی و رفع مشکلات در برخی موارد زمان گیر است. + نظرات ارزشمند شما به ما کمک میکند تا بهتر بتوانید خدمات و محصولاتمان را مطابق خواسته و نیاز شما تنظیم کنیم ، از این رو خواهشمندیم نظرات و نقد های ارزشمند خود را برای ما ارسال نمایید.
@@ -82,7 +82,7 @@ const AddCriticisms: FC = () => {
- پاسخگویی 24 ساعته تلفنی را تنها از میهن وب هاست می توانید انتظار داشته باشید .بخش پشتیبانی در هر ساعتی حتی در روز های تعطیل آماده پیگیری سریع مشکلات کاربران است. + تمامی نظرات توسط داناک بررسی و پردازش شده و در صورت نیاز شما را در جریان پردازش اطلاعات قرار خواهیم داد، ممکن است همکاران ما در واحد تجربه مشتری با شما تماس گرفته و جزییات بیشتری را پیرامون نقد و نظر شما جویا شوند.
diff --git a/src/pages/service/MyServices.tsx b/src/pages/service/MyServices.tsx index cec4d1f..49c0b41 100644 --- a/src/pages/service/MyServices.tsx +++ b/src/pages/service/MyServices.tsx @@ -1,16 +1,19 @@ -import { FC } from 'react' +import { FC, useState } from 'react' import { useTranslation } from 'react-i18next' import Input from '../../components/Input' -import Select from '../../components/Select' 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' const MyServices: FC = () => { const { t } = useTranslation('global') + const [search, setSearch] = useState('') + const getServices = useGetMyServices(search) return (
@@ -25,10 +28,11 @@ const MyServices: FC = () => { variant='search' placeholder={t('service.search')} className='bg-white w-full' + onChangeSearchFinal={(value) => setSearch(value)} />
-
+ {/*