From 7756e20a9f2bfeb163e6662df06f168b33d6a23d Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sun, 29 Dec 2024 11:27:56 +0330 Subject: [PATCH] ticket --- src/components/DefaulModal.tsx | 2 +- src/components/ServiceSection.tsx | 19 ++++++ src/components/StatusCircle.tsx | 15 +++++ src/components/Tabs.tsx | 38 +++++++++++ src/components/Td.tsx | 22 +++++++ src/index.css | 22 +++++++ src/langs/fa.json | 22 ++++++- src/pages/auth/store/AuthStore.ts | 2 +- src/pages/service/MyServices.tsx | 99 ++++++++++++++++++++++++++++ src/pages/ticket/TicketList.tsx | 103 ++++++++++++++++++++++++++++++ src/router/Main.tsx | 4 ++ 11 files changed, 345 insertions(+), 3 deletions(-) create mode 100644 src/components/ServiceSection.tsx create mode 100644 src/components/StatusCircle.tsx create mode 100644 src/components/Tabs.tsx create mode 100644 src/components/Td.tsx create mode 100644 src/pages/service/MyServices.tsx create mode 100644 src/pages/ticket/TicketList.tsx diff --git a/src/components/DefaulModal.tsx b/src/components/DefaulModal.tsx index 0024fd7..b9d1561 100644 --- a/src/components/DefaulModal.tsx +++ b/src/components/DefaulModal.tsx @@ -45,7 +45,7 @@ const DefaulModal: FC = (props: Props) => { -
+
) } diff --git a/src/components/ServiceSection.tsx b/src/components/ServiceSection.tsx new file mode 100644 index 0000000..5a6c1bc --- /dev/null +++ b/src/components/ServiceSection.tsx @@ -0,0 +1,19 @@ +import { FC } from 'react' + +const ServiceSection: FC = () => { + return ( +
+
+
+
+ دی منو +
+
+ منو رستوران +
+
+
+ ) +} + +export default ServiceSection \ No newline at end of file diff --git a/src/components/StatusCircle.tsx b/src/components/StatusCircle.tsx new file mode 100644 index 0000000..97fa12a --- /dev/null +++ b/src/components/StatusCircle.tsx @@ -0,0 +1,15 @@ +import { FC } from 'react' + +type Props = { + color: string +} + +const StatusCircle: FC = (props: Props) => { + return ( +
+ +
+ ) +} + +export default StatusCircle \ No newline at end of file diff --git a/src/components/Tabs.tsx b/src/components/Tabs.tsx new file mode 100644 index 0000000..1e01baa --- /dev/null +++ b/src/components/Tabs.tsx @@ -0,0 +1,38 @@ +import { FC, ReactNode } from 'react' +import { clx } from '../helpers/utils' + +type Item = { + icon: ReactNode, + label: string, + value: string, +} + +type Props = { + items: Item[], + onChange: (value: string) => void, + active: string, +} + +const Tabs: FC = (props: Props) => { + return ( +
+ { + props.items.map((item: Item) => { + return ( +
props.onChange(item.value)} key={item.value} className={clx( + 'flex flex-col items-center gap-2 cursor-pointer', + props.active === item.value && 'text-black' + )}> + {item.icon} +
+ {item.label} +
+
+ ) + }) + } +
+ ) +} + +export default Tabs \ No newline at end of file diff --git a/src/components/Td.tsx b/src/components/Td.tsx new file mode 100644 index 0000000..1c90952 --- /dev/null +++ b/src/components/Td.tsx @@ -0,0 +1,22 @@ +import { FC, ReactNode } from 'react' + +interface Props { + text: string, + children?: ReactNode, + dir?: string, +} + +const Td: FC = (props: Props) => { + return ( + + { + props.text ? + props.text + : + props.children + } + + ) +} + +export default Td \ No newline at end of file diff --git a/src/index.css b/src/index.css index 1386a20..bc72ff0 100644 --- a/src/index.css +++ b/src/index.css @@ -34,6 +34,28 @@ textarea::placeholder { .rowTwoInput { @apply flex flex-col sm:flex-row sm:gap-5 gap-5; } + .td { + @apply px-6 py-4 whitespace-nowrap text-xs; + } + .thead { + @apply h-[69px] bg-white text-sm text-[#8C90A3] rounded-3xl overflow-hidden; + } + .tr { + @apply w-full h-[74px] bg-white border-t border-[#EAEDF5] hover:bg-secondary; + } +} + +tbody tr { + background-color: white; +} + +.thead tr td:first-child { + border-top-right-radius: 23px; + /* border-bottom-right-radius: 23px; */ +} +.thead tr td:last-child { + border-top-left-radius: 23px; + /* border-bottom-left-radius: 23px; */ } .rmdp-input { min-height: 40px; diff --git a/src/langs/fa.json b/src/langs/fa.json index 237392d..55b23f4 100644 --- a/src/langs/fa.json +++ b/src/langs/fa.json @@ -75,5 +75,25 @@ "see_all": "دیدن همه", "create_new_access": "ایجاد دسترسی سریع" }, - "all": "همه" + "all": "همه", + "service": { + "my_service": "سرویس های من", + "search": "جستجو در سرویس ها", + "active_menu": "منو فعال" + }, + "ticket": { + "tickets": "تیکت ها", + "new_ticket": "تیکت جدید", + "answered": "پاسخ داده شده", + "checking": "در حال بررسی", + "wait_answered": "در انتظار پاسخ", + "closed": "بسته شده", + "number": "شماره", + "title": "عنوان", + "team": "تیم", + "date": "تاریخ", + "status": "وضعیت", + "priority": "الویت", + "detail": "جزییات" + } } diff --git a/src/pages/auth/store/AuthStore.ts b/src/pages/auth/store/AuthStore.ts index 6ba50c5..a6cb566 100644 --- a/src/pages/auth/store/AuthStore.ts +++ b/src/pages/auth/store/AuthStore.ts @@ -1,5 +1,5 @@ import { create } from "zustand"; -import { AuthStoreType } from "../auth/types/AuthTypes"; +import { AuthStoreType } from "../../auth/types/AuthTypes"; export const useAuthStore = create((set) => ({ phone: "", diff --git a/src/pages/service/MyServices.tsx b/src/pages/service/MyServices.tsx new file mode 100644 index 0000000..99ea95e --- /dev/null +++ b/src/pages/service/MyServices.tsx @@ -0,0 +1,99 @@ +import { FC } from 'react' +import { SIDEBAR_SIZE_LEFT } from '../../config/Const' +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' + +const MyServices: FC = () => { + + const { t } = useTranslation('global') + + return ( +
+
+
+ {t('service.my_service')} +
+ +
+
+ +
+ +