diff --git a/public/Layout/CarImage.jpg b/public/Layout/CarImage.jpg deleted file mode 100644 index 1cc4e1f..0000000 Binary files a/public/Layout/CarImage.jpg and /dev/null differ diff --git a/public/Layout/CarImage2.svg b/public/Layout/CarImage2.svg deleted file mode 100644 index ef12e51..0000000 --- a/public/Layout/CarImage2.svg +++ /dev/null @@ -1,1582 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/Layout/KarimLogo.svg b/public/Layout/KarimLogo.svg deleted file mode 100644 index 0544713..0000000 --- a/public/Layout/KarimLogo.svg +++ /dev/null @@ -1,27 +0,0 @@ - - \ No newline at end of file diff --git a/public/Layout/KarimLogo.tsx b/public/Layout/KarimLogo.tsx deleted file mode 100644 index 6c147ee..0000000 --- a/public/Layout/KarimLogo.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react' - -const KarimLogo = () => { - return ( -<> - - - - - - - - - - - - - - - - - - - - ) -} - -export default KarimLogo \ No newline at end of file diff --git a/public/Layout/Logo.png b/public/Layout/Logo.png deleted file mode 100644 index 0434d20..0000000 Binary files a/public/Layout/Logo.png and /dev/null differ diff --git a/public/Layout/MainLogo.png b/public/Layout/MainLogo.png deleted file mode 100644 index 84d4dcb..0000000 Binary files a/public/Layout/MainLogo.png and /dev/null differ diff --git a/public/Layout/body_background.png b/public/Layout/body_background.png deleted file mode 100644 index e8afd9e..0000000 Binary files a/public/Layout/body_background.png and /dev/null differ diff --git a/public/Layout/dark.svg b/public/Layout/dark.svg deleted file mode 100644 index a5020a5..0000000 --- a/public/Layout/dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/Layout/desktop.ini b/public/Layout/desktop.ini deleted file mode 100644 index e901dec..0000000 --- a/public/Layout/desktop.ini +++ /dev/null @@ -1,2 +0,0 @@ -[LocalizedFileNames] -Screenshot 2023-11-29 134655.png=@Screenshot 2023-11-29 134655.png,0 diff --git a/public/Layout/etaxlogo.svg b/public/Layout/etaxlogo.svg deleted file mode 100644 index eaefa77..0000000 --- a/public/Layout/etaxlogo.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/public/Layout/light.svg b/public/Layout/light.svg deleted file mode 100644 index f484697..0000000 --- a/public/Layout/light.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/Layout/logorayan.png b/public/Layout/logorayan.png deleted file mode 100644 index 9b72f17..0000000 Binary files a/public/Layout/logorayan.png and /dev/null differ diff --git a/public/Layout/mac.webp b/public/Layout/mac.webp deleted file mode 100644 index 443a039..0000000 Binary files a/public/Layout/mac.webp and /dev/null differ diff --git a/public/Layout/order.gif b/public/Layout/order.gif deleted file mode 100644 index 703871d..0000000 Binary files a/public/Layout/order.gif and /dev/null differ diff --git a/public/Layout/Ar.svg b/public/language/ar.svg similarity index 100% rename from public/Layout/Ar.svg rename to public/language/ar.svg diff --git a/public/Layout/De.svg b/public/language/de.svg similarity index 100% rename from public/Layout/De.svg rename to public/language/de.svg diff --git a/public/Layout/En.svg b/public/language/en.svg similarity index 100% rename from public/Layout/En.svg rename to public/language/en.svg diff --git a/src/Components/Utils/Translate.tsx b/src/Components/Utils/Translate.tsx index ad2c79f..a5aa816 100644 --- a/src/Components/Utils/Translate.tsx +++ b/src/Components/Utils/Translate.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { Menu, MenuItem, MenuButton } from '@szhsin/react-menu'; -import { useTranslation } from 'react-i18next'; +import { Menu, Dropdown } from 'antd'; import { useLanguage, useLanguageMenu } from '../../Hooks/useChangeLanguage'; import i18next from 'i18next'; +import type { MenuProps } from 'antd'; export default function Translate() { const { changeLanguage } = useLanguage(); @@ -12,23 +12,31 @@ export default function Translate() { changeLanguage(newLanguage); }; + const items : MenuProps['items'] = languageOptions.map((option:any,index:number) => ({ + key: index, + label: ( +
handleLanguageChange(option.code)}> + + {option.label} +
+ ) + })); + + + return (
- - {languageOptions.map((option:any,index:number) => ( - option.code === i18next.language ? - - {option.label} - - : null - ))} - } transition> - {languageOptions.map((option:any) => ( - handleLanguageChange(option.code)}> - {option.label} - - ))} - + + +
); } diff --git a/src/Components/ValidationField/View/Date.tsx b/src/Components/ValidationField/View/Date.tsx index 1a21512..dde451d 100644 --- a/src/Components/ValidationField/View/Date.tsx +++ b/src/Components/ValidationField/View/Date.tsx @@ -34,7 +34,7 @@ const DateField = ({ name, label, picker = "date", isDisabled, props, onChange, > { - const searchParams = new URLSearchParams(window?.location?.search); + const searchParams = new URLSearchParams(location?.search); setSearchQuery(searchParams?.get('search') || ''); - }, []); + console.log(searchParams); + + }, [location]); diff --git a/src/Hooks/useChangeLanguage.tsx b/src/Hooks/useChangeLanguage.tsx index c455ee8..2e52a1f 100644 --- a/src/Hooks/useChangeLanguage.tsx +++ b/src/Hooks/useChangeLanguage.tsx @@ -1,85 +1,75 @@ - import { useEffect } from 'react'; - import { initReactI18next, useTranslation } from 'react-i18next'; - import i18n from 'i18next'; - import translationEN from '../translate/en.json'; - import translationAR from '../translate/ar.json'; - import translationDE from '../translate/de.json'; +import { useEffect } from 'react'; +import { initReactI18next, useTranslation } from 'react-i18next'; +import i18n from 'i18next'; +import translationEN from '../translate/en.json'; +import translationAR from '../translate/ar.json'; +import translationDE from '../translate/de.json'; +const language = localStorage.getItem('language') ?? 'en'; - let language = localStorage.getItem('language') ?? 'en'; - - i18n.use(initReactI18next).init({ - resources: { - en: { - translation: translationEN - }, - ar: { - translation: translationAR - }, - de: { - translation: translationDE - } +i18n.use(initReactI18next).init({ + resources: { + en: { + translation: translationEN }, - lng: language ?? "en", - interpolation: { - escapeValue: false + ar: { + translation: translationAR + }, + de: { + translation: translationDE } - }); - - // console.log(navigator.language,"navigator.language"); - - export function useLanguage() { - useEffect(() => { - // Define a function to handle language change events - const handleLanguageChange = () => { - const newLanguage = localStorage.getItem('language') ?? 'en'; - changeLanguage(newLanguage); - }; - - // Add an event listener to detect changes in localStorage - window.addEventListener('storage', handleLanguageChange); - - // Clean up by removing the event listener when the component unmounts - return () => { - window.removeEventListener('storage', handleLanguageChange); - }; - }, []); - - const changeLanguage = (newLanguage:any) => { - i18n.changeLanguage(newLanguage); - localStorage.setItem('language', newLanguage); - applyLanguageStyles(newLanguage); - // Refresh the page to apply the language changes - window.location.reload(); - }; - - return { changeLanguage }; - } - - function applyLanguageStyles(language:any) { - if (language === 'ar') { - document.body.setAttribute('dir', 'rtl'); - document.body.classList.remove('de'); - document.body.classList.add('ar'); - } else if (language === 'en') { - document.body.setAttribute('dir', 'ltr'); - document.body.classList.remove('ar', 'de'); - document.body.classList.add('en'); - } else if (language === 'de') { - document.body.setAttribute('dir', 'ltr'); - document.body.classList.remove('ar'); - document.body.classList.add('de'); + }, + lng: language, + interpolation: { + escapeValue: false } + }); + + +export function useLanguage() { + useEffect(() => { + changeLanguage(language); + }, [language]); + + const changeLanguage = (newLanguage:any) => { + i18n.changeLanguage(newLanguage); + localStorage.setItem('language', newLanguage); + applyLanguageStyles(newLanguage); + }; + + return { changeLanguage }; +} + +function applyLanguageStyles(language:any) { + if (language === 'ar') { + document.body.setAttribute('dir', 'rtl'); + document.body.classList.remove('de'); + document.body.classList.add('ar'); + } else if (language === 'en') { + document.body.setAttribute('dir', 'ltr'); + document.body.classList.remove('ar', 'de'); + document.body.classList.add('en'); + } else if (language === 'de') { + document.body.setAttribute('dir', 'ltr'); + document.body.classList.remove('ar'); + document.body.classList.add('de'); } - export function useLanguageMenu() { - const { t } = useTranslation(); +} - const languageOptions = [ - { code: 'ar', icon: '/Layout/Ar.svg', label: t('Arabic') }, - { code: 'en', icon: '/Layout/En.svg', label: t('English') }, - { code: 'de', icon: '/Layout/De.svg', label: t('German') } - ]; +export function useLanguageMenu() { + const { t } = useTranslation(); + const { changeLanguage } = useLanguage(); - return { languageOptions }; - } + const languageOptions = [ + { code: 'ar', icon: '/language/ar.svg', label: t('Arabic') }, + { code: 'en', icon: '/language/en.svg', label: t('English') }, + { code: 'de', icon: '/language/de.svg', label: t('German') } + ]; + + const handleLanguageChange = (code:any) => { + changeLanguage(code); + }; + + return { languageOptions, handleLanguageChange }; +} diff --git a/src/Layout/app/Header.tsx b/src/Layout/app/Header.tsx index aad55cb..5abb651 100644 --- a/src/Layout/app/Header.tsx +++ b/src/Layout/app/Header.tsx @@ -2,22 +2,12 @@ import React from 'react' import { UserImageURL } from './Const' import Translate from '../../Components/Utils/Translate' import { useTranslation } from 'react-i18next' -import { Menu, MenuItem, MenuButton } from '@szhsin/react-menu'; -import '@szhsin/react-menu/dist/index.css'; -import '@szhsin/react-menu/dist/transitions/slide.css'; -import Theme from '../../Components/Utils/Theme'; -import { TOKEN_KEY } from '../../config/AppKey'; import { useNavigate } from 'react-router-dom'; import useAuthState from '../../lib/state mangment/AuthState'; import { GiHamburgerMenu } from 'react-icons/gi'; import WithDrawer from './WithDrawer'; import Sidebar from './SideBar'; - -type TUserData = - { - username: string | null, - role: string | null - } +import { Dropdown, type MenuProps } from 'antd'; const Header = () => { @@ -33,6 +23,14 @@ const Header = () => { } + const items: MenuProps['items'] = [ + { + key: '1', + label: ( +
{t("Log Out")}
+ ), + }, + ]; return (
@@ -49,23 +47,14 @@ const Header = () => {
- {/* */} - - -
-
- {/*
{user?.full_name}
*/} - {/*

{user?.role_type}

*/} -
+ +
- } transition> - {t("Log Out")} - -
- + +
diff --git a/src/Pages/Categories/View/Add/AttributeValueTab/TabsContainer.tsx b/src/Pages/Categories/View/Add/AttributeValueTab/TabsContainer.tsx index 0e9ce46..9813c1d 100644 --- a/src/Pages/Categories/View/Add/AttributeValueTab/TabsContainer.tsx +++ b/src/Pages/Categories/View/Add/AttributeValueTab/TabsContainer.tsx @@ -69,7 +69,7 @@ export const TabsContainer= ({parentKey}:any) => { setItems([...items, newItem]); setActiveKey(newKey); - const originalValues = values?.Attribute[parentKey].AttributeValue[targetKey]; + const originalValues = values?.Attribute[parentKey]?.AttributeValue?.[targetKey]; setFieldValue(`Attribute[${parentKey}].AttributeValue[${newKey}]`, {...originalValues,id:null}); } }; diff --git a/src/Pages/Categories/View/AddPage.tsx b/src/Pages/Categories/View/AddPage.tsx index 471888f..2ad656f 100644 --- a/src/Pages/Categories/View/AddPage.tsx +++ b/src/Pages/Categories/View/AddPage.tsx @@ -227,9 +227,9 @@ const AddcategoriesPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
-
{t("attributes")}
+
{t("attributes")}
diff --git a/src/Pages/Categories/View/EditPage.tsx b/src/Pages/Categories/View/EditPage.tsx index 804cb14..5bfc146 100644 --- a/src/Pages/Categories/View/EditPage.tsx +++ b/src/Pages/Categories/View/EditPage.tsx @@ -506,8 +506,8 @@ const EditPage = () => { -
{t("BasicInfo")}
-
{t("attributes")}
+
{t("BasicInfo")}
+
{t("attributes")}
diff --git a/src/Pages/Coupon/View/AddPage.tsx b/src/Pages/Coupon/View/AddPage.tsx index 9e3b52d..1e1f3e3 100644 --- a/src/Pages/Coupon/View/AddPage.tsx +++ b/src/Pages/Coupon/View/AddPage.tsx @@ -55,7 +55,7 @@ const AddCouponPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Coupon/View/EditPage.tsx b/src/Pages/Coupon/View/EditPage.tsx index 6b18b3e..d808216 100644 --- a/src/Pages/Coupon/View/EditPage.tsx +++ b/src/Pages/Coupon/View/EditPage.tsx @@ -85,7 +85,7 @@ const EditPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Home/HomePage.tsx b/src/Pages/Home/HomePage.tsx index a83d6b7..6cd3365 100644 --- a/src/Pages/Home/HomePage.tsx +++ b/src/Pages/Home/HomePage.tsx @@ -17,21 +17,21 @@ export default function HomePage() { { icon: , count: data?.userCount, // Example count - pathWhenClick: '/', + pathWhenClick: '/users', titleKey: "userCount", contentKey: "user_in_your_Application" }, { icon: , count: data?.productCount, // Example count - pathWhenClick: "/", + pathWhenClick: "/products", titleKey: "productCount", contentKey: "Product_Count_in_your_Application" }, { icon: , count: data?.orderCount, // Example count - pathWhenClick: "/", + pathWhenClick: "/order", titleKey: "orderCount", contentKey: "order_count_in_your_Application" } @@ -49,8 +49,8 @@ export default function HomePage() { diff --git a/src/Pages/Notifcation/View/AddForm.tsx b/src/Pages/Notifcation/View/AddForm.tsx index 9cc139b..47888c5 100644 --- a/src/Pages/Notifcation/View/AddForm.tsx +++ b/src/Pages/Notifcation/View/AddForm.tsx @@ -55,7 +55,7 @@ function Form() { {/* */} - + diff --git a/src/Pages/Notifcation/View/AddPage.tsx b/src/Pages/Notifcation/View/AddPage.tsx index 21ce48a..56bc64e 100644 --- a/src/Pages/Notifcation/View/AddPage.tsx +++ b/src/Pages/Notifcation/View/AddPage.tsx @@ -64,7 +64,7 @@ const AddPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Products/View/AddPage.tsx b/src/Pages/Products/View/AddPage.tsx index 57141d8..708442f 100644 --- a/src/Pages/Products/View/AddPage.tsx +++ b/src/Pages/Products/View/AddPage.tsx @@ -83,9 +83,9 @@ const AddProductPage = () => { -
{t("Base_info")}
+
{t("Base_info")}
-
{t("VarianInfo")}
+
{t("VarianInfo")}
diff --git a/src/Pages/Products/View/EditPage.tsx b/src/Pages/Products/View/EditPage.tsx index 9dd46de..52332d0 100644 --- a/src/Pages/Products/View/EditPage.tsx +++ b/src/Pages/Products/View/EditPage.tsx @@ -352,9 +352,9 @@ console.log(mappedAttributes, "mappedAttributes"); -
{t("Base_info")}
+
{t("Base_info")}
-
{t("VarianInfo")}
+
{t("VarianInfo")}
diff --git a/src/Pages/Slider/View/AddPage.tsx b/src/Pages/Slider/View/AddPage.tsx index efd222f..f8097bb 100644 --- a/src/Pages/Slider/View/AddPage.tsx +++ b/src/Pages/Slider/View/AddPage.tsx @@ -35,7 +35,7 @@ const AddSliderPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Slider/View/EditPage.tsx b/src/Pages/Slider/View/EditPage.tsx index fa1fe20..d6e4165 100644 --- a/src/Pages/Slider/View/EditPage.tsx +++ b/src/Pages/Slider/View/EditPage.tsx @@ -60,7 +60,7 @@ const EditPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/SupportMessages/View/AddPage.tsx b/src/Pages/SupportMessages/View/AddPage.tsx index c463281..cdb7258 100644 --- a/src/Pages/SupportMessages/View/AddPage.tsx +++ b/src/Pages/SupportMessages/View/AddPage.tsx @@ -34,7 +34,7 @@ const AddSupportMessagesPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Users/SendNotifcation/View/AddPage.tsx b/src/Pages/Users/SendNotifcation/View/AddPage.tsx index e2a9817..e15e250 100644 --- a/src/Pages/Users/SendNotifcation/View/AddPage.tsx +++ b/src/Pages/Users/SendNotifcation/View/AddPage.tsx @@ -57,7 +57,7 @@ const AddPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Users/View/EditPage.tsx b/src/Pages/Users/View/EditPage.tsx index 8b9069d..e6d8022 100644 --- a/src/Pages/Users/View/EditPage.tsx +++ b/src/Pages/Users/View/EditPage.tsx @@ -46,7 +46,7 @@ const EditPage = () => { -
{t("BasicInfo")}
+
{t("BasicInfo")}
diff --git a/src/Pages/Users/useTableColumns.tsx b/src/Pages/Users/useTableColumns.tsx index 895bc44..fb4bda8 100644 --- a/src/Pages/Users/useTableColumns.tsx +++ b/src/Pages/Users/useTableColumns.tsx @@ -102,7 +102,7 @@ const useTableColumns: any = () => { }, ], - [] + [t] ); }; diff --git a/src/Pages/order/Edit/EditForm.tsx b/src/Pages/order/Edit/EditForm.tsx index cf1a739..8588700 100644 --- a/src/Pages/order/Edit/EditForm.tsx +++ b/src/Pages/order/Edit/EditForm.tsx @@ -3,17 +3,19 @@ import React from 'react' import { Col, Row } from 'reactstrap'; import ValidationField from '../../../Components/ValidationField/ValidationField'; import { FaCheck, FaTimes, FaClock, FaBan } from 'react-icons/fa'; +import { useTranslation } from 'react-i18next'; function Form() { + const [t] = useTranslation() // 'pending_approve', 'approved', 'rejected', 'pending_cancellation', 'cancelled' const stateSelect = [ - { label:
Pending Approve
, value: "pending_approve" }, - { label:
Approved
, value: "approved" }, - { label:
Rejected
, value: "rejected" }, - { label:
Pending Cancellation
, value: "pending_cancellation" } + { label:
{t("Pending Approve")}
, value: "pending_approve" }, + { label:
{t("Approved")}
, value: "approved" }, + { label:
{t("Rejected")}
, value: "rejected" }, + { label:
{t("Pending Cancellation")}
, value: "pending_cancellation" } ]; diff --git a/src/Pages/order/EditPage.tsx b/src/Pages/order/EditPage.tsx index c55f4b4..cc0c8a6 100644 --- a/src/Pages/order/EditPage.tsx +++ b/src/Pages/order/EditPage.tsx @@ -79,9 +79,9 @@ const EditPage = () => { -
{t("EditDetails")}
-
{t("BasicInfo")}
-
{t("OrderItems")}
+
{t("EditDetails")}
+
{t("BasicInfo")}
+
{t("OrderItems")}
diff --git a/src/Pages/order/OrderPage.tsx b/src/Pages/order/OrderPage.tsx index 257d309..153fd1c 100644 --- a/src/Pages/order/OrderPage.tsx +++ b/src/Pages/order/OrderPage.tsx @@ -26,12 +26,13 @@ const OrderPage = () => { const columns = useTableColumns(); - /// Coupon status Created from -> to Price from => to + const [t] = useTranslation() + // 'pending_approve', 'approved', 'rejected', 'pending_cancellation', 'cancelled' const stateSelect = [ - { label:
Pending Approve
, value: "pending_approve" }, - { label:
Approved
, value: "approved" }, - { label:
Rejected
, value: "rejected" }, - { label:
Pending Cancellation
, value: "pending_cancellation" } + { label:
{t("Pending Approve")}
, value: "pending_approve" }, + { label:
{t("Approved")}
, value: "approved" }, + { label:
{t("Rejected")}
, value: "rejected" }, + { label:
{t("Pending Cancellation")}
, value: "pending_cancellation" } ]; const { data: Coupon } = useGetCoupon() @@ -49,8 +50,9 @@ const OrderPage = () => { const handleSubmit = () => { let queryParams = []; - - if (username !== null) { + console.log(username); + + if (username !== null && username!== "" ) { queryParams.push(`username=${username}`); } if (coupon !== null) { @@ -86,7 +88,6 @@ const OrderPage = () => { } - const [t] = useTranslation() return ( diff --git a/src/Pages/order/ui/CustomDateRange.tsx b/src/Pages/order/ui/CustomDateRange.tsx index 0558de4..eedf3b6 100644 --- a/src/Pages/order/ui/CustomDateRange.tsx +++ b/src/Pages/order/ui/CustomDateRange.tsx @@ -25,7 +25,7 @@ const CustomDateRange = () => { format={dateFormat} onChange={onCalendarChange} className="CustomDateRange" - placeholder={[t(`PriceFrom`),t(`PriceTo`)]} + placeholder={[t(`DateFrom`),t(`DateTo`)]} /> ) } diff --git a/src/Pages/order/ui/CustomSearchField.tsx b/src/Pages/order/ui/CustomSearchField.tsx index be9c27b..e46bd8c 100644 --- a/src/Pages/order/ui/CustomSearchField.tsx +++ b/src/Pages/order/ui/CustomSearchField.tsx @@ -18,7 +18,7 @@ const CustomSearchField = ({ searchBy }: any) => { if (value || value !== "") { setUsername(value) } else { - setUsername(value) + setUsername(null) } } diff --git a/src/Styles/AppStyle/Import.scss b/src/Styles/AppStyle/Import.scss index 07f8d11..36643f3 100644 --- a/src/Styles/AppStyle/Import.scss +++ b/src/Styles/AppStyle/Import.scss @@ -11,7 +11,7 @@ @import '../component/printButton.scss'; @import '../component/DarkStyle.scss'; @import '../component/ErrorPage.scss'; -@import '../component/SingleDriverInfo.scss'; +@import '../component/Tab_Info.scss'; @import '../component/DriverInfoSocket.scss'; @import '../component/radio.scss'; diff --git a/src/Styles/AppStyle/Mixing.scss b/src/Styles/AppStyle/Mixing.scss index b463517..5641f40 100644 --- a/src/Styles/AppStyle/Mixing.scss +++ b/src/Styles/AppStyle/Mixing.scss @@ -12,20 +12,7 @@ } -@mixin GlassModeBG{ - background-image: url("../../../public/Layout/mac.webp"); - width: 100%; - background-size: cover; - background-position: center; - min-height: 100vh; - display: flex; justify-content: center; align-items: center; -} -@mixin GlassBG{ - background-image: url("../../../public/Layout/mac.webp"); - width: 100%; - background-size: cover; - background-position: center; -} + @mixin GlassModeCover{ diff --git a/src/Styles/Layout/Header.scss b/src/Styles/Layout/Header.scss index b2ca97d..84cd0b3 100644 --- a/src/Styles/Layout/Header.scss +++ b/src/Styles/Layout/Header.scss @@ -43,7 +43,7 @@ } .Header_Right{ padding-inline: 5px; - + direction: ltr; @include Flex ; .Setting{ @@ -109,4 +109,12 @@ display: block; } } +} + +.ant-dropdown-link{ + all: unset; +} +.MenuPropsItem{ + display: flex; + gap: 10px; } \ No newline at end of file diff --git a/src/Styles/Layout/Layout.scss b/src/Styles/Layout/Layout.scss index 2e9a1a3..9a63f31 100644 --- a/src/Styles/Layout/Layout.scss +++ b/src/Styles/Layout/Layout.scss @@ -139,128 +139,7 @@ background: var(--bg); - .glass{ - .Layout_Children{ - max-height: 500px; - overflow-y: auto; - overflow-x: hidden - } - .modal { @include GlassModeBG; } - .DashboardLayout { - - background-image: url("../../../public/Layout/mac.webp"); - max-height: 200px; - - } - .modal-content{ - @include GlassModeCover; - - } - .DashboardLayout_Cover{ - @include GlassModeCover; - - - - } - .LayoutBody{ - // overflow-y: scroll; - height: 400px; - overflow-y: auto; - - - } - - ::-webkit-scrollbar { min-width: 15px; width: 100%; } - ::-webkit-scrollbar-track { box-shadow: inset 0 0 5px var(--primary); } - ::-webkit-scrollbar-thumb { - background:transparent no-repeat center center ; - background-size: cover; - &:hover{ - - background:var(--primary) no-repeat center center ; - cursor: pointer !important; - - } - - - } - .react-tabs__tab::after{ - border-bottom: 4px solid var(--primary) !important; - - } - .progress, .progress-stacked{ - background-color: var(--bg2) !important; - } - - button{ - background: none !important; - color: var(--primary); - - } - .react-confirm-alert div .sweet-alert{ - background-color:transparent !important; - @include GlassModeCover; - border: 1px solid var(--primary); - color: var(--primary); - .btn-primary{ - background-color: transparent ; - border: 1px solid var(--primary); - &:hover { - background-color: rgba(16 18 27 / 40%); - backdrop-filter: blur(24px); - } - } - } - .react-confirm-alert{ - max-height: 100px; - - } - .react-confirm-alert > div > div > div{ - @include GlassModeBG; - max-height: 100px; - - } - .Add_Button{ - button { - box-shadow: 2px 2px 1px 0 var(--primary); - - } - - - button:hover { - background-color: rgba(16 18 27 / 40%); - backdrop-filter: blur(24px); - } - } - .btn-secondary{ - box-shadow: 2px 2px 1px 0 var(--primary); - - - &:hover { - background-color: rgba(16 18 27 / 40%); - backdrop-filter: blur(24px); - } - } - .sc-bdvvtL .sc-hGPBjI .sc-pVTFL{ - background-color:transparent; - color:var(--text); -} -.react-tabs__tab-panel--selected .ValidationField .ant-input-affix-wrapper,.modal-body .ValidationField .ant-input-affix-wrapper{ - background-color:transparent; -} - -/* Input */ -.react-tabs__tab-panel--selected .ValidationField input[type=text],.modal-body .ValidationField input{ - background-color:transparent; - color:var(--text)!important; - &::placeholder{ - color: var(--text); - } -} - - - - } + .ViewPage{ .card-header{ @@ -484,6 +363,9 @@ padding: 10px 40px; display:none; } + .Page_Header{ + flex-wrap: wrap; + } } @@ -524,7 +406,21 @@ padding: 10px 40px; } } - +.ar{ + .AddNewTabText{ + text-wrap: nowrap !important; + margin-right: 60px; + transform: translateY(-30px); + } + @media screen and (max-width: 1000px) { + + .AddNewTabText{ + transform: translateY(-50px); + + + } + } +} /* Dynamic form complex */ #dynamic_form_complex{ margin-bottom:5px; @@ -617,7 +513,7 @@ padding: 10px 40px; } .CustomDateRange{ - width: 300px; + width: 240px; } .OrderDetails{ padding: 20px 4vw ; @@ -641,4 +537,12 @@ padding: 10px 40px; white-space: nowrap; } +} + + +.ar{ + .ant-tabs >.ant-tabs-nav{ + direction: ltr !important; + + } } \ No newline at end of file diff --git a/src/Styles/component/SingleDriverInfo.scss b/src/Styles/component/Tab_Info.scss similarity index 76% rename from src/Styles/component/SingleDriverInfo.scss rename to src/Styles/component/Tab_Info.scss index 931d462..7b2b1b2 100644 --- a/src/Styles/component/SingleDriverInfo.scss +++ b/src/Styles/component/Tab_Info.scss @@ -1,9 +1,10 @@ -.SignleDriverContainer{ +.Tab_Info_Container{ display: flex;justify-content: start;align-items: center; - .SingleDriverInfo{ + .Tab_Info{ font-size: 1.4vw; padding-left: .5vw; + margin-bottom: 0; } .SignleDriverInfoIcon{ svg{ diff --git a/src/api/auth.ts b/src/api/auth.ts index 84804f7..001260e 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -8,4 +8,4 @@ const API = { LOGIN: `admin/login`, LOGOUT: `/api/admin/logout`, }; -export const useLoginAdmin = ()=>useAddMutation(KEY , API.LOGIN) \ No newline at end of file +export const useLoginAdmin = ()=>useAddMutation(KEY , API.LOGIN,"login_successful") \ No newline at end of file diff --git a/src/api/helper/useAddMutation.ts b/src/api/helper/useAddMutation.ts index 538ff34..88ffb5d 100644 --- a/src/api/helper/useAddMutation.ts +++ b/src/api/helper/useAddMutation.ts @@ -9,7 +9,7 @@ type AxiosResponse = { success:true }; -function useAddMutation(key: string, url: string): UseMutationResult { +function useAddMutation(key: string, url: string,message?:string): UseMutationResult { const axios = useAxios(); const [t] = useTranslation(); const queryClient = useQueryClient(); @@ -26,7 +26,7 @@ function useAddMutation(key: string, url: string): UseMutationResult { queryClient.invalidateQueries([key]); - toast.success(data.message || t("added_successful")); + toast.success(data.message || t(message??"") || t("added_successful")); }, onError: (error:any) => { const message = error?.response?.data?.message || t("failed_to_add_data"); diff --git a/src/translate/ar.json b/src/translate/ar.json index f992062..e7f7553 100644 --- a/src/translate/ar.json +++ b/src/translate/ar.json @@ -174,7 +174,17 @@ "id": "المعرف", "submite": "تقديم", "PriceFrom": "السعر من", - "PriceTo": "السعر إلى" + "PriceTo": "السعر إلى", + "Pending Approve": "قيد الموافقة", + "Approved": "تمت الموافقة عليه", + "Rejected": "مرفوض", + "Pending Cancellation": "في انتظار الإلغاء", + "user_ids": "معرفات المستخدمين", + "user": "مستخدم", + "login_successful": "تسجيل الدخول ناجح", + "DateFrom": "تاريخ البدء", + "DateTo": "تاريخ الانتهاء" + diff --git a/src/translate/de.json b/src/translate/de.json index 30eeae7..618b8e7 100644 --- a/src/translate/de.json +++ b/src/translate/de.json @@ -172,7 +172,18 @@ "id": "ID", "submite": "Einreichen", "PriceFrom": "Preis ab", -"PriceTo": "Preis bis" +"PriceTo": "Preis bis", +"Pending Approve": "Ausstehende Genehmigung", +"Approved": "Genehmigt", +"Rejected": "Abgelehnt", +"Pending Cancellation": "Ausstehende Stornierung", +"user_ids": "Benutzer-IDs", +"user": "Benutzer", +"login_successful": "Anmeldung erfolgreich", + + "DateFrom": "Datum von", + "DateTo": "Datum bis" + diff --git a/src/translate/en.json b/src/translate/en.json index bf06d24..f473476 100644 --- a/src/translate/en.json +++ b/src/translate/en.json @@ -177,6 +177,15 @@ "id": "ID", "submite": "Submit", "PriceFrom": "Price From", -"PriceTo": "Price To" +"PriceTo": "Price To", +"Pending Approve": "Pending Approve", +"Approved": "Approved", +"Rejected": "Rejected", +"Pending Cancellation": "Pending Cancellation", +"user_ids": "User IDs", + "user": "User", + "login_successful": "Login successful", + "DateFrom": "Date From", + "DateTo": "Date To" } \ No newline at end of file