diff --git a/src/Components/Home/Categories.tsx b/src/Components/Home/Categories.tsx new file mode 100644 index 0000000..7a028b4 --- /dev/null +++ b/src/Components/Home/Categories.tsx @@ -0,0 +1,15 @@ +import HomeSlider from "../../Components/Home/CategoriesSlider"; +import { useTranslation } from 'react-i18next'; + +const Categories = () => { + const {t} = useTranslation(); + return ( +
+

{t("What do you like")}?

+ + +
+ ) +} + +export default Categories \ No newline at end of file diff --git a/src/Components/Home/CategoriesSlider.tsx b/src/Components/Home/CategoriesSlider.tsx index 3e4dbb8..0b1c04d 100644 --- a/src/Components/Home/CategoriesSlider.tsx +++ b/src/Components/Home/CategoriesSlider.tsx @@ -12,15 +12,18 @@ import { useGetCategories } from "../../api/Categories"; import { Category } from "../../types/item"; import { useNavigate } from "react-router-dom"; import { addBaseUrlToSrc } from "../../utils/addBaseUrlToSrc"; +import { languageObject } from "../../utils/languageObject"; +import Loading from "../Utils/Loading/Loading"; const CategoriesSlider = () => { - const { data } = useGetCategories(); + const { data , isLoading} = useGetCategories(); const categories = (data?.categories as Category[]) || ([] as []); const navigate = useNavigate(); const handelNavigate = (data: Category) => { navigate(`/categories?category=${data?.id}`); }; - + console.log(categories); + return (
@@ -47,7 +50,7 @@ const CategoriesSlider = () => { }, }} > - {categories?.map((item: Category, index: number) => { + {isLoading ? :categories?.map((item: Category, index: number) => { return (
@@ -56,6 +59,7 @@ const CategoriesSlider = () => { src={addBaseUrlToSrc(item?.photo)} alt={`category ${index + 1}`} /> +

{languageObject(item?.name)}

); diff --git a/src/Components/Home/ProductCard.tsx b/src/Components/Home/ProductCard.tsx index 4d1c39d..371956c 100644 --- a/src/Components/Home/ProductCard.tsx +++ b/src/Components/Home/ProductCard.tsx @@ -78,16 +78,7 @@ const ProductCard = ({ item }: { item: Product }) => {
handle_click(item?.base_product_id)} />

{languageObject(item?.name)}

-
Description: {result}
- - {/*

{Currency} {oldPrice}

-
-

{price}

-

- {randomRate} -

-
*/} - {/* {discountAmount}% */} +
{t("Description")}: {result}