tabexseriescomponents 0.0.64 → 0.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/index.cjs.js +6838 -6468
  2. package/dist/index.esm.js +6841 -6471
  3. package/dist/index.umd.js +6841 -6472
  4. package/package.json +1 -1
  5. package/srcOLD/Contexts/LanguageContext.jsx +347 -0
  6. package/srcOLD/Contexts/ProductsCardsSectionContext.jsx +28 -0
  7. package/srcOLD/StylesJS/Customstyles.js +235 -0
  8. package/srcOLD/TabexComponents/Cards/CategoryCardwithhoveraction/CategoryCardwithhoveraction.jsx +214 -0
  9. package/srcOLD/TabexComponents/Cards/Categorycard_fullimage/Categorycard_fullimage.jsx +258 -0
  10. package/srcOLD/TabexComponents/Cards/Categorycard_slidebgscaled/Categorycard_slidebgscaled.jsx +206 -0
  11. package/srcOLD/TabexComponents/Cards/Categorycard_with_trianglebg/Categorycard_with_trianglebg.jsx +176 -0
  12. package/srcOLD/TabexComponents/Cards/Categorycard_with_twolinestransition/Categorycard_with_twolinestransition.jsx +207 -0
  13. package/srcOLD/TabexComponents/Cards/Categorycard_withshapes/Categorycard_withshapes.jsx +162 -0
  14. package/srcOLD/TabexComponents/Cards/Categorycard_withtext/Categorycard_withtext.jsx +193 -0
  15. package/srcOLD/TabexComponents/Cards/Classiccategorycard/Classiccategorycard.jsx +158 -0
  16. package/srcOLD/TabexComponents/Cards/Horizontalcard/Horizontalcard.jsx +286 -0
  17. package/srcOLD/TabexComponents/Cards/MenuCard/MenuCard.jsx +558 -0
  18. package/srcOLD/TabexComponents/Cards/ModernProductCard/ModernProductCard.jsx +486 -0
  19. package/srcOLD/TabexComponents/Cards/Productcard6/Productcard6.jsx +300 -0
  20. package/srcOLD/TabexComponents/Cards/Productcard7/Productcard7.jsx +288 -0
  21. package/srcOLD/TabexComponents/Cards/Productcard_animatedbuttons/Productcard_animatedbuttons.jsx +307 -0
  22. package/srcOLD/TabexComponents/Cards/Productcard_with_circularbg/Productcard_with_circularbg.jsx +295 -0
  23. package/srcOLD/TabexComponents/Cards/Productcard_with_circularhover/Productcard_with_circularhover.jsx +325 -0
  24. package/srcOLD/TabexComponents/Cards/Productcard_with_slideanimation/Productcard_with_slideanimation.jsx +290 -0
  25. package/srcOLD/TabexComponents/Cards/Productcard_with_variants/Productcard_with_variants.jsx +303 -0
  26. package/srcOLD/TabexComponents/Cards/Productcard_with_zoominonhover/Productcard_with_zoominonhover.jsx +466 -0
  27. package/srcOLD/TabexComponents/Cards/Productcarddefault/Productcarddefault.jsx +282 -0
  28. package/srcOLD/TabexComponents/Cards/Productccard_with_imageontopleft/Productccard_with_imageontopleft.jsx +298 -0
  29. package/srcOLD/TabexComponents/Cards/Prouductcard_with_zoomhover/Prouductcard_with_zoomhover.jsx +139 -0
  30. package/srcOLD/TabexComponents/Cards/Simplecategorycardwithtextbelow/Simplecategorycardwithtextbelow.jsx +135 -0
  31. package/srcOLD/TabexComponents/Cards/Simpleproductcard/Simpleproductcard.jsx +304 -0
  32. package/srcOLD/TabexComponents/Cards/StylishProductCard/StylishProductCard.jsx +291 -0
  33. package/srcOLD/TabexComponents/Footer/Footer1/Footer1.jsx +418 -0
  34. package/srcOLD/TabexComponents/Footer/Footer2/Footer2.jsx +382 -0
  35. package/srcOLD/TabexComponents/Footer/Footer3/Footer3.jsx +308 -0
  36. package/srcOLD/TabexComponents/Footer/Footer4/Footer4.jsx +438 -0
  37. package/srcOLD/TabexComponents/Footer/Footer5/Footer5.jsx +495 -0
  38. package/srcOLD/TabexComponents/Footer/Footer6/Footer6.jsx +295 -0
  39. package/srcOLD/TabexComponents/Footer/Footer7/Footer7.jsx +373 -0
  40. package/srcOLD/TabexComponents/Footer/Simplefooter/Simplefooter.jsx +238 -0
  41. package/srcOLD/TabexComponents/Generalfiles/images/egyptflag.png +0 -0
  42. package/srcOLD/TabexComponents/Generalfiles/images/noimage.png +0 -0
  43. package/srcOLD/TabexComponents/Generalfiles/images/payment/cod.png +0 -0
  44. package/srcOLD/TabexComponents/Generalfiles/images/payment/fawry.png +0 -0
  45. package/srcOLD/TabexComponents/Generalfiles/images/payment/payment.png +0 -0
  46. package/srcOLD/TabexComponents/Generalfiles/images/payment/paymob.png +0 -0
  47. package/srcOLD/TabexComponents/Generalfiles/images/payment/paypal.png +0 -0
  48. package/srcOLD/TabexComponents/Generalfiles/images/payment/visa.png +0 -0
  49. package/srcOLD/TabexComponents/Generalfiles/images/shoppingcart.png +0 -0
  50. package/srcOLD/TabexComponents/Generalfiles/images/tabexlogo.png +0 -0
  51. package/srcOLD/TabexComponents/Generalfiles/images/unknownmaleuser.png +0 -0
  52. package/srcOLD/TabexComponents/Generalfiles/images/usflag.png +0 -0
  53. package/srcOLD/TabexComponents/Generalfiles/images/whatsapp.png +0 -0
  54. package/srcOLD/TabexComponents/Headers/AllinoneHeader/AllinoneHeader.jsx +724 -0
  55. package/srcOLD/TabexComponents/Headers/ClassicHeader/ClassicHeader.jsx +687 -0
  56. package/srcOLD/TabexComponents/Headers/Header4/Header4.jsx +632 -0
  57. package/srcOLD/TabexComponents/Headers/Header6/Header6.jsx +669 -0
  58. package/srcOLD/TabexComponents/Headers/Header8/Header8.jsx +882 -0
  59. package/srcOLD/TabexComponents/Headers/HeaderRestaurant/HeaderRestaurant.jsx +754 -0
  60. package/srcOLD/TabexComponents/Headers/Header_threesectionslogocentered/Header_threesectionslogocentered.jsx +798 -0
  61. package/srcOLD/TabexComponents/Headers/Headerresponsive/Headerresponsive.jsx +686 -0
  62. package/srcOLD/TabexComponents/Headers/HeaderwithContactinfo/HeaderwithContactinfo.jsx +938 -0
  63. package/srcOLD/TabexComponents/Headers/Modernheader/Modernheader.jsx +706 -0
  64. package/srcOLD/TabexComponents/Headers/StylishHeader/StylishHeader.jsx +821 -0
  65. package/srcOLD/TabexComponents/Headers/Subheader/Subheader copy.jsx +228 -0
  66. package/srcOLD/TabexComponents/Headers/Subheader/Subheader.jsx +251 -0
  67. package/srcOLD/TabexComponents/Sections/BackgroundImages/Backgroundimage1/Backgroundimage1.jsx +312 -0
  68. package/srcOLD/TabexComponents/Sections/BackgroundImages/Backgroundimage_with_toppill/Backgroundimage_with_toppill.jsx +278 -0
  69. package/srcOLD/TabexComponents/Sections/BackgroundImages/BackgroundimageandTextsection/BackgroundimageandTextsection.jsx +138 -0
  70. package/srcOLD/TabexComponents/Sections/BackgroundImages/Section_with_rightbgcont/Section_with_rightbgcont.jsx +160 -0
  71. package/srcOLD/TabexComponents/Sections/BackgroundImages/Threebgimages/Threebgimages.jsx +295 -0
  72. package/srcOLD/TabexComponents/Sections/BackgroundImages/Twobgimages/Twobgimages.jsx +784 -0
  73. package/srcOLD/TabexComponents/Sections/Cards/CardsSection/CardsSection.jsx +861 -0
  74. package/srcOLD/TabexComponents/Sections/Cards/CardsSection2/CardsSection2.js +496 -0
  75. package/srcOLD/TabexComponents/Sections/Cards/CardsSection7/CardsSection7.js +888 -0
  76. package/srcOLD/TabexComponents/Sections/Cards/CardsSection8/CardsSection8.js +419 -0
  77. package/srcOLD/TabexComponents/Sections/Cards/Sixverticalcardssection/Sixverticalcardssection.js +552 -0
  78. package/srcOLD/TabexComponents/Sections/Slideshow/AboutSection/AboutSection.jsx +281 -0
  79. package/srcOLD/TabexComponents/Sections/Slideshow/Backgroundimage_with_topcircle/Backgroundimage_with_topcircle.jsx +166 -0
  80. package/srcOLD/TabexComponents/Sections/Slideshow/Freetextsection/Freetextsection.jsx +152 -0
  81. package/srcOLD/TabexComponents/Sections/Slideshow/Image_with_leftwords/Image_with_leftwords.jsx +284 -0
  82. package/srcOLD/TabexComponents/Sections/Slideshow/Image_with_rightwords/Image_with_rightwords.jsx +146 -0
  83. package/srcOLD/TabexComponents/Sections/Slideshow/Servicesection/Servicesection.jsx +209 -0
  84. package/srcOLD/TabexComponents/Sections/Slideshow/ServicesectionCenteredcards/ServicesectionCenteredcards.jsx +145 -0
  85. package/srcOLD/TabexComponents/Sections/Slideshow/Slideshow_with_rotatedsquare/Slideshow_with_rotatedsquare.jsx +252 -0
  86. package/srcOLD/TabexComponents/Sections/Slideshow/Slideshow_with_squarebg/Slideshow_with_squarebg.jsx +175 -0
  87. package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowdifferentanimations/Slideshowdifferentanimations.jsx +154 -0
  88. package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowfade/Slideshowfade.jsx +201 -0
  89. package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowslide/Slideshowslide.jsx +414 -0
  90. package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowzoom/Slideshowzoom.jsx +270 -0
  91. package/srcOLD/TabexComponents/StaticPages/Aboutus/Aboutus.js +175 -0
  92. package/srcOLD/TabexComponents/StaticPages/AccountInformation/AccountInformation.jsx +275 -0
  93. package/srcOLD/TabexComponents/StaticPages/CartSlider/CartSlider.jsx +459 -0
  94. package/srcOLD/TabexComponents/StaticPages/Categoriesdropdown/Categoriesdropdown.js +146 -0
  95. package/srcOLD/TabexComponents/StaticPages/Checkout/Checkout.jsx +1220 -0
  96. package/srcOLD/TabexComponents/StaticPages/Filter/Filter.jsx +542 -0
  97. package/srcOLD/TabexComponents/StaticPages/Login/FacebookLoginButton.jsx +51 -0
  98. package/srcOLD/TabexComponents/StaticPages/Login/GoogleLoginButton.jsx +35 -0
  99. package/srcOLD/TabexComponents/StaticPages/Login/Login.jsx +299 -0
  100. package/srcOLD/TabexComponents/StaticPages/OrderSuccess/OrderSuccess.js +192 -0
  101. package/srcOLD/TabexComponents/StaticPages/Ordershistory/Ordershistory.jsx +1285 -0
  102. package/srcOLD/TabexComponents/StaticPages/Policies/Policies.jsx +358 -0
  103. package/srcOLD/TabexComponents/StaticPages/Productinfo/Productinfo.jsx +1506 -0
  104. package/srcOLD/TabexComponents/StaticPages/Searchlist/Searchlist.jsx +225 -0
  105. package/srcOLD/TabexComponents/StaticPages/Signup/CustomerInformationForm.jsx +788 -0
  106. package/srcOLD/TabexComponents/StaticPages/Signup/Signup.jsx +157 -0
  107. package/srcOLD/TabexComponents/StaticPages/Staticpagesrouter/Staticpagesrouter.jsx +295 -0
  108. package/srcOLD/TabexComponents/StaticPages/Viewcart/Viewcart.js +1090 -0
  109. package/srcOLD/TabexComponents/StaticPages/Wishlist/Wishlist.jsx +629 -0
  110. package/srcOLD/assets/images/cod.png +0 -0
  111. package/srcOLD/assets/images/egyptflag.png +0 -0
  112. package/srcOLD/assets/images/fawry.png +0 -0
  113. package/srcOLD/assets/images/payment.png +0 -0
  114. package/srcOLD/assets/images/paymob.png +0 -0
  115. package/srcOLD/assets/images/paypal.png +0 -0
  116. package/srcOLD/assets/images/shoppingcart.png +0 -0
  117. package/srcOLD/assets/images/usflag.png +0 -0
  118. package/srcOLD/assets/images/visa.png +0 -0
  119. package/srcOLD/assets/images/whatsapp.png +0 -0
  120. package/srcOLD/button.jsx +40 -0
  121. package/srcOLD/index.jsx +175 -0
  122. package/srcOLD/styles/Home.module.css +129 -0
  123. package/srcOLD/styles/cards/Categorcycard_fullimage.module.css +10 -0
  124. package/srcOLD/styles/cards/Categorycard_slidebgscaled.module.css +73 -0
  125. package/srcOLD/styles/cards/Categorycard_withshapes.module.css +189 -0
  126. package/srcOLD/styles/cards/Productcard6.module.css +9 -0
  127. package/srcOLD/styles/cards/Productcard_with_circularbg.module.css +137 -0
  128. package/srcOLD/styles/cards/Productccard_with_zoominonhover.module.css +51 -0
  129. package/srcOLD/styles/cards/Prouductcard_with_zoomhover.module.css +61 -0
  130. package/srcOLD/styles/cards/categorycard.module.css +102 -0
  131. package/srcOLD/styles/cards/categorycard3.module.css +51 -0
  132. package/srcOLD/styles/cards/categorycardwithtext.module.css +40 -0
  133. package/srcOLD/styles/cards/productcard_animatedbuttons.module.css +104 -0
  134. package/srcOLD/styles/cards/productcard_with_textonhover.module.css +12 -0
  135. package/srcOLD/styles/cards/productccard_with_imageontopleft.module.css +85 -0
  136. package/srcOLD/styles/general/bootstrap.css +4420 -0
  137. package/srcOLD/styles/general/dropdown.css +199 -0
  138. package/srcOLD/styles/general/editorbardropdown.module.css +94 -0
  139. package/srcOLD/styles/general/filter.module.css +108 -0
  140. package/srcOLD/styles/general/form.module.css +273 -0
  141. package/srcOLD/styles/general/general.module.css +709 -0
  142. package/srcOLD/styles/general/image-gallery.css +481 -0
  143. package/srcOLD/styles/general/react-accessible-accordion.module.css +52 -0
  144. package/srcOLD/styles/general/react-phone-input-2.module.css +927 -0
  145. package/srcOLD/styles/general/scrollbtn.module.css +22 -0
  146. package/srcOLD/styles/general/slick.module.css +166 -0
  147. package/srcOLD/styles/general/tabs.module.css +110 -0
  148. package/srcOLD/styles/general/workplaceeditor.module.css +328 -0
  149. package/srcOLD/styles/globals.css +26 -0
  150. package/srcOLD/styles/headers/Allinoneheader.module.css +91 -0
  151. package/srcOLD/styles/headers/Header7.module.css +50 -0
  152. package/srcOLD/styles/headers/Header_threesectionslogocentered.module.css +97 -0
  153. package/srcOLD/styles/headers/Sideheader.module.css +108 -0
  154. package/srcOLD/styles/headers/classicheaderstyles.module.css +16 -0
  155. package/srcOLD/styles/headers/dropdown.css +0 -0
  156. package/srcOLD/styles/headers/header4.module.css +175 -0
  157. package/srcOLD/styles/headers/header5.module.css +30 -0
  158. package/srcOLD/styles/headers/header6.module.css +117 -0
  159. package/srcOLD/styles/headers/header_contactinfo.module.css +78 -0
  160. package/srcOLD/styles/headers/headerresturant.module.css +89 -0
  161. package/srcOLD/styles/headers/headerstyles.module.css +24 -0
  162. package/srcOLD/styles/headers/modernheader.module.css +78 -0
  163. package/srcOLD/styles/headers/subheader.module.css +114 -0
  164. package/srcOLD/styles/sections/Backgroundimage1.module.css +17 -0
  165. package/srcOLD/styles/sections/Backgroundimage_with_topcircle.module.css +28 -0
  166. package/srcOLD/styles/sections/Section_with_rightbgcont.module.css +49 -0
  167. package/srcOLD/styles/sections/Slideshow_with_rotatedsquare.module.css +35 -0
  168. package/srcOLD/styles/sections/Slideshow_with_squarebg.module.css +39 -0
  169. package/srcOLD/styles/staticpages/accordion.module.css +9 -0
  170. package/srcOLD/styles/staticpages/cart.module.css +108 -0
  171. package/srcOLD/styles/staticpages/dropdown.css +196 -0
  172. package/srcOLD/styles/staticpages/filter.module.css +139 -0
  173. package/srcOLD/styles/staticpages/login.module.css +146 -0
  174. package/srcOLD/styles/staticpages/productinfo.module.css +54 -0
  175. package/srcOLD/styles/staticpages/shop.module.css +191 -0
  176. package/srcOLD/styles/staticpages/signup.module.css +206 -0
  177. package/srcOLD/styles/staticpages/staticroutersidenav.module.css +129 -0
  178. package/srcOLD/styles/staticpages/viewcart.module.css +129 -0
  179. package/srcOLD/styles/staticpages/wishlist.module.css +29 -0
@@ -0,0 +1,496 @@
1
+ // All take sectionidprops & sectionindexprops
2
+ import React, { useEffect, useState, useContext } from 'react';
3
+ import { serverbaselink, instapikey } from '../../../../../../../../Env_Variables_Server';
4
+ import { WebsiteDesignWorkPlaceContext } from '../../../../../../../../Contexts/WebsiteDesignWorkPlaceContext';
5
+ import { TemplateRoutingContext } from '../../../../../../../../Contexts/TemplateRoutingContext';
6
+ import { LanguageContext } from '../../../../../../../../Contexts/LanguageContext';
7
+ import { FetchingContext } from '../../../../../../../../Contexts/FetchingContext';
8
+ import generalstyles from '../../../../../../../../styles/general/general.module.css';
9
+
10
+ import { css } from 'glamor';
11
+ import { ProductsCardsSectionContext } from '../../../../../../../../Contexts/ProductsCardsSectionContext';
12
+ import Filter from '../../../StaticPages/Filter/Filter';
13
+ import Pagepreloader from '../../../StaticPages/Pagepreloader/Pagepreloader';
14
+ import { useQuery, useQueryClient, useMutation, useInfiniteQuery } from 'react-query';
15
+ import { useInView } from 'react-intersection-observer';
16
+ import filterstyles from '../../../../../../../../styles/staticpages/filter.module.css';
17
+ import { fetchproducts_API } from '../../../../../../../../components/API/API';
18
+ import { MdOutlineLayersClear } from 'react-icons/md';
19
+ import { BsSearch, BsFillArrowRightCircleFill } from 'react-icons/bs';
20
+ import Searchlist from '../../../StaticPages/Searchlist/Searchlist';
21
+ import { FiFilter } from 'react-icons/fi';
22
+ import { ScrollMenu, VisibilityContext } from 'react-horizontal-scrolling-menu';
23
+
24
+ // import { LeftArrow, RightArrow, onWheel } from './Arrows.js';
25
+ import axios from 'axios';
26
+ // import CircularProgress from 'react-cssfx-loading/lib/CircularProgress';
27
+
28
+ const CardsSection2 = (props) => {
29
+ const { ref, inView } = useInView();
30
+ const { lang, langdetect } = useContext(LanguageContext);
31
+ const queryClient = useQueryClient();
32
+ const { fetch_inst_tabex_websitetemplatesQueryContext, TabexSectionsComponentsContext, StatePagePropertiesContext } = useContext(WebsiteDesignWorkPlaceContext);
33
+ const { fetchcollectionsQueryContext, FetchQueriesEngineContext, setFetchQueriesEngineContext, SearchHeaderMutationContext, favoriteprojectscountContext } = useContext(FetchingContext);
34
+ const { ProductFilterObjContext, setProductFilterObjContext } = useContext(ProductsCardsSectionContext);
35
+ const [sectionproperties, setsectionproperties] = useState('');
36
+ const [cardsarray, setcardsarray] = useState([]);
37
+ const [fetchingtype, setfetchingtype] = useState('');
38
+ const [searchinput, setsearchinput] = useState('');
39
+ const FetchProductsAxios = (axiosdatatemp) => {
40
+ var tempProductFilterObjContext = { ...ProductFilterObjContext };
41
+ tempProductFilterObjContext.page = axiosdatatemp;
42
+ // setProductFilterObjContext({ ...tempProductFilterObjContext });
43
+ if (fetch_inst_tabex_websitetemplatesQueryContext.data.data.template.instid == 'tabex') {
44
+ tempProductFilterObjContext.instapikey = 'tabex';
45
+ } else {
46
+ tempProductFilterObjContext.instapikey = instapikey();
47
+ }
48
+
49
+ var serverbaselinktemp = window.location.hostname;
50
+ if (serverbaselinktemp == 'localhost') {
51
+ serverbaselinktemp = 'https://tabex-co.com';
52
+ } else {
53
+ serverbaselinktemp = 'https://' + serverbaselinktemp;
54
+ }
55
+
56
+ const axiosfetch = axios({
57
+ method: 'post',
58
+ url: serverbaselinktemp + '/customer/webapp/fetchproducts',
59
+ headers: {
60
+ Accept: 'application/json',
61
+ 'Content-Type': 'application/json',
62
+ },
63
+ data: tempProductFilterObjContext,
64
+ });
65
+ return axiosfetch;
66
+ };
67
+ const fetchProductsQuery = useInfiniteQuery(['fetchproducts_API' + JSON.stringify(ProductFilterObjContext)], ({ pageParam = 0 }) => FetchProductsAxios(pageParam), {
68
+ keepPreviousData: true,
69
+ staleTime: Infinity,
70
+ enabled:
71
+ instapikey().length != 0 && fetchingtype == 'products' && ProductFilterObjContext.ProductFetchingType != undefined && ProductFilterObjContext.ProductFetchingType.length != 0
72
+ ? true
73
+ : false,
74
+ initialPageParam: 0,
75
+ getNextPageParam: (lastPage, allPages) => {
76
+ var currentpagefrombackend = lastPage.data.page;
77
+
78
+ if (currentpagefrombackend == 'full') {
79
+ return undefined;
80
+ } else {
81
+ var nextpage = parseInt(currentpagefrombackend) + 1;
82
+ return nextpage;
83
+ }
84
+ },
85
+
86
+ getPreviousPageParam: (firstPage, allPages) => firstPage.data.page - 1,
87
+ });
88
+ React.useEffect(() => {
89
+ if (inView) {
90
+ fetchProductsQuery.fetchNextPage();
91
+ }
92
+ }, [inView]);
93
+ const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '' });
94
+ useEffect(() => {
95
+ StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
96
+ if (sectionitem.sectionid == props.sectionidprops) {
97
+ var secpropobj = {};
98
+ sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
99
+ secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
100
+ });
101
+ setsectionproperties({ ...secpropobj });
102
+
103
+ if (props.srcfromprops == 'GeneralProductsComponent') {
104
+ setfetchingtype('products');
105
+ setProductsFetchingTypeSectionObj({
106
+ productfetchingtype: 'Random',
107
+ collectionid: props.collectionidprops,
108
+ });
109
+ } else {
110
+ setfetchingtype(sectionitem.fetchingtype);
111
+ setProductsFetchingTypeSectionObj({
112
+ productfetchingtype: sectionitem.productsfetchingtype,
113
+ collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
114
+ });
115
+ }
116
+ }
117
+ });
118
+ }, [StatePagePropertiesContext]);
119
+ useEffect(() => {
120
+ SearchHeaderMutationContext.reset();
121
+ const delayDebounceFn = setTimeout(() => {
122
+ if (searchinput.length != 0) {
123
+ SearchHeaderMutationContext.mutate({
124
+ SearchHeaderValue: searchinput,
125
+ });
126
+ }
127
+ }, 1000);
128
+
129
+ return () => clearTimeout(delayDebounceFn);
130
+ }, [searchinput]);
131
+ useEffect(() => {
132
+ if (sectionproperties.length != 0) {
133
+ if (cardsarray.length == 0) {
134
+ if (fetchingtype == 'collections') {
135
+ if (fetchcollectionsQueryContext.isSuccess) {
136
+ cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
137
+ }
138
+ } else if (fetchingtype == 'products') {
139
+ if (fetchProductsQuery.isSuccess) {
140
+ var allpagesarr = [];
141
+ fetchProductsQuery.data.pages.forEach((page) => {
142
+ page.data.products.forEach((productobj) => {
143
+ allpagesarr.push(productobj);
144
+ });
145
+ });
146
+ cardobjassigner(allpagesarr);
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }, [sectionproperties]);
152
+ useEffect(() => {
153
+ if (fetchingtype.length != 0) {
154
+ var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
155
+
156
+ if (fetchingtype == 'collections') {
157
+ tempFetchQueriesEngineContext.collections = true;
158
+ }
159
+ if (fetchingtype == 'products') {
160
+ var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
161
+ tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
162
+ tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
163
+
164
+ setProductFilterObjContext({ ...tempfetchproductsfilerobjcontext });
165
+ }
166
+
167
+ setFetchQueriesEngineContext({ ...tempFetchQueriesEngineContext });
168
+ }
169
+ }, [fetchingtype, ProductsFetchingTypeSectionObj]);
170
+ useEffect(() => {
171
+ if (fetchingtype == 'products') {
172
+ if (fetchProductsQuery.isSuccess) {
173
+ var allpagesarr = [];
174
+ fetchProductsQuery.data.pages.forEach((page) => {
175
+ page.data.products.forEach((productobj) => {
176
+ allpagesarr.push(productobj);
177
+ });
178
+ });
179
+ cardobjassigner(allpagesarr);
180
+ }
181
+ }
182
+ }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data]);
183
+ useEffect(() => {
184
+ if (fetchingtype == 'collections') {
185
+ if (fetchcollectionsQueryContext.isSuccess) {
186
+ cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
187
+ }
188
+ }
189
+ }, [fetchcollectionsQueryContext.isSuccess]);
190
+ useEffect(() => {
191
+ favassigner();
192
+ }, [favoriteprojectscountContext]);
193
+ const favassigner = () => {
194
+ if (fetchingtype == 'products') {
195
+ if (cardsarray.length != 0) {
196
+ if (favoriteprojectscountContext != undefined && Array.isArray(favoriteprojectscountContext)) {
197
+ var tempcardsarray = [...cardsarray];
198
+ tempcardsarray.forEach(function (arrayItem, arrayindex) {
199
+ arrayItem.IsFavExists = false;
200
+ });
201
+ tempcardsarray.forEach(function (arrayItem, arrayindex) {
202
+ favoriteprojectscountContext.forEach(function (favitem, favindex) {
203
+ if (arrayItem.productid == favitem) {
204
+ arrayItem.IsFavExists = true;
205
+ }
206
+ });
207
+ });
208
+ setcardsarray([...tempcardsarray]);
209
+ }
210
+ }
211
+ }
212
+ };
213
+ const cardobjassigner = (fetchedarray) => {
214
+ var temparray = [];
215
+ fetchedarray.forEach(function (arrayItem, arrayindex) {
216
+ var cardobj = {
217
+ name: '',
218
+ image: '',
219
+ };
220
+ if (fetchingtype == 'products') {
221
+ if (langdetect == 'en') {
222
+ cardobj.name = arrayItem.productinfo.name_en;
223
+ } else {
224
+ cardobj.name = arrayItem.productinfo.name_ar;
225
+ }
226
+ cardobj.image = arrayItem.productinfo.productmainimage;
227
+ cardobj.hassale = arrayItem.productinfo.hassale;
228
+ cardobj.productid = arrayItem.productinfo.productid;
229
+ cardobj.hasvariants = arrayItem.productinfo.hasvariants;
230
+ cardobj.description_en = arrayItem.productinfo.description_en;
231
+ cardobj.description_ar = arrayItem.productinfo.description_ar;
232
+ cardobj.defaultprice = arrayItem.productinfo.defaultprice;
233
+ cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
234
+ cardobj.productimages = arrayItem.productinfo.productimages;
235
+ cardobj.timestamp = arrayItem.productinfo.timestamp;
236
+ if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
237
+ favoriteprojectscountContext.forEach(function (favitem, favindex) {
238
+ if (arrayItem.productinfo.productid == favitem) {
239
+ cardobj.IsFavExists = true;
240
+ }
241
+ });
242
+ }
243
+ } else if (fetchingtype == 'collections') {
244
+ cardobj.collectionid = arrayItem.collectionid;
245
+ if (langdetect == 'en') {
246
+ cardobj.name = arrayItem.title_en;
247
+ } else if (langdetect == 'ar') {
248
+ cardobj.name = arrayItem.title_ar;
249
+ }
250
+ cardobj.image = arrayItem.collectionlogo;
251
+ } else if (fetchingtype == 'custom') {
252
+ }
253
+ temparray.push(cardobj);
254
+ });
255
+
256
+ setcardsarray([...temparray]);
257
+ };
258
+ const section_cssstyles = {
259
+ sectiontitlespan: css({
260
+ ':after': {
261
+ width: sectionproperties.sectitle_lineafterwidth + '%',
262
+ backgroundColor: sectionproperties.linebgcolor,
263
+ },
264
+ }),
265
+ cards_sections: css({
266
+ width: sectionproperties.width + 'vw',
267
+ marginTop: sectionproperties.marginTop + 'px',
268
+ marginBottom: sectionproperties.marginBottom + 'px',
269
+ paddingLeft: sectionproperties.paddingLeft + 'px',
270
+ paddingRight: sectionproperties.paddingRight + 'px',
271
+ paddingTop: sectionproperties.paddingTop + 'px',
272
+ paddingBottom: sectionproperties.paddingBottom + 'px',
273
+ background: sectionproperties.backgroundColor,
274
+ borderBottomLeftRadius: sectionproperties.borderBottomLeftRadius + 'px',
275
+ borderBottomRightRadius: sectionproperties.borderBottomRightRadius + 'px',
276
+ borderTopLeftRadius: sectionproperties.borderTopLeftRadius + 'px',
277
+ borderTopRightRadius: sectionproperties.borderTopRightRadius + 'px',
278
+ boxShadow: sectionproperties.sectioncardshadow == 'Show' ? '0 0 10px ' + sectionproperties.sectioncardshadowcolor : 'none',
279
+ borderColor: sectionproperties.sectioncardbordercolor,
280
+ border: sectionproperties.sectioncardborderwidth + 'px solid',
281
+ }),
282
+ loadbtn: css({
283
+ width: sectionproperties.loadbtn_Width + 'px',
284
+ height: sectionproperties.loadbtn_Height + 'px',
285
+ background: sectionproperties.loadbtn_bgtransparent == 'Transparent' ? 'transparent' : sectionproperties.loadbtn_bgColor,
286
+ borderBottomLeftRadius: sectionproperties.loadbtn_borderBottomLeftRadius + 'px',
287
+ borderBottomRightRadius: sectionproperties.loadbtn_borderBottomRightRadius + 'px',
288
+ borderTopLeftRadius: sectionproperties.loadbtn_borderTopLeftRadius + 'px',
289
+ borderTopRightRadius: sectionproperties.loadbtn_borderTopRightRadius + 'px',
290
+ color: sectionproperties.loadbtn_Textcolor,
291
+ boxShadow: sectionproperties.loadbtn_showshadow == 'Show' ? '0 0 10px ' + sectionproperties.loadbtn_shadowcolor : '',
292
+ transition: '.3s',
293
+ ':hover': {
294
+ background: sectionproperties.loadbtn_transparentbgcoloronhover == 'Transparent' ? 'transparent' : sectionproperties.loadbtn_bgColoronhover,
295
+ color: sectionproperties.loadbtn_Textcoloronhover,
296
+ },
297
+ }),
298
+ scrollmenuclassnameitemSimpleproductcard: css({
299
+ minWidth: sectionproperties.card_widthhorizontal + 'px',
300
+ maxWidth: sectionproperties.card_widthhorizontal + 'px',
301
+ }),
302
+ };
303
+
304
+ const cardsrender = () => {
305
+ return (
306
+ <div
307
+ className="row m-0 w-100"
308
+ style={{
309
+ height: '100%',
310
+ }}
311
+ >
312
+ <div className="col-lg-12 p-0">
313
+ {sectionproperties.length != 0 && (
314
+ <div className="row m-0 w-100 d-flex align-items-center" style={{ position: 'relative' }}>
315
+ <p
316
+ className="m-0 p-0 d-block d-md-none"
317
+ style={{
318
+ position: 'absolute',
319
+ top: langdetect == 'en' ? sectionproperties.slideshowText1Content_marginTop + 'px' : '',
320
+ left: langdetect == 'en' ? sectionproperties.slideshowText1Content_marginLeft + 'px' : '-' + sectionproperties.slideshowText1Content_marginLeft + 'px',
321
+ textTransform: sectionproperties.slideshowText1ContentTextTransform,
322
+ color: sectionproperties.slideshowText1ContentColor,
323
+ fontSize: sectionproperties.slideshowText1ContentFontSize + 'px',
324
+ fontWeight: sectionproperties.slideshowText1ContentFontWeight,
325
+ letterSpacing: langdetect == 'en' ? '5px' : 0,
326
+ opacity: 0.7,
327
+ transform: langdetect == 'en' ? 'rotate(-90deg)' : 'rotate(90deg)',
328
+ }}
329
+ >
330
+ {langdetect == 'en' ? sectionproperties.slideshowText1Content : sectionproperties.slideshowText1Content_ar}
331
+ </p>
332
+ <div className={langdetect == 'en' ? 'col-lg-10 col-md-12 d-flex justify-content-center ml-auto p-0' : 'col-lg-10 col-md-12 d-flex justify-content-center mr-auto p-0'}>
333
+ <div className="row m-0 w-100">
334
+ <div className="col-lg-12 d-flex justify-content-center">
335
+ <p
336
+ className="m-0 p-0 d-none d-md-flex"
337
+ style={{
338
+ textTransform: sectionproperties.slideshowText1ContentTextTransform,
339
+ color: sectionproperties.slideshowText1ContentColor,
340
+ fontSize: '25px',
341
+ fontWeight: sectionproperties.slideshowText1ContentFontWeight,
342
+ letterSpacing: langdetect == 'en' ? '5px' : 0,
343
+ opacity: 0.7,
344
+ }}
345
+ >
346
+ {sectionproperties.slideshowText1Content}
347
+ </p>
348
+ </div>
349
+ <div className="col-lg-12 d-flex align-items-center justify-content-center" style={{ marginBottom: sectionproperties.slideshowText2Content_marginBottom + 'px' }}>
350
+ <p
351
+ className="font-md-23"
352
+ style={{
353
+ fontSize: sectionproperties.slideshowText2ContentFontSize + 'px',
354
+ color: sectionproperties.slideshowText2ContentColor,
355
+ fontWeight: sectionproperties.slideshowText2ContentFontWeight,
356
+ textTransform: sectionproperties.slideshowText2ContentTextTransform,
357
+ }}
358
+ >
359
+ {langdetect == 'en' ? sectionproperties.slideshowText2Content : sectionproperties.slideshowText2Content_Ar}
360
+ </p>
361
+ </div>
362
+ {!fetchProductsQuery.isFetching && cardsarray.length == 0 && (
363
+ <div className="row m-0 w-100 d-flex align-items-center" style={{ height: '50vh' }}>
364
+ <div className="col-lg-12 text-light d-flex align-items-center justify-content-center flex-column">
365
+ <MdOutlineLayersClear
366
+ style={{
367
+ fontSize: sectionproperties.noprod_iconfontSize + 'px',
368
+ color: sectionproperties.noprod_iconcolor,
369
+ }}
370
+ />
371
+ <p
372
+ style={{
373
+ fontSize: sectionproperties.noprod_fontSize + 'px',
374
+ fontWeight: sectionproperties.noprod_fontWeight,
375
+ textTransform: sectionproperties.noprod_textTransform,
376
+ color: sectionproperties.noprod_color,
377
+ }}
378
+ >
379
+ No Products Found
380
+ </p>
381
+ </div>
382
+ </div>
383
+ )}
384
+ {cardsarray.length != 0 &&
385
+ StatePagePropertiesContext.pageobj.sections[props.sectionindexprops].childsections.map((item, index) => {
386
+ if (item.tabexsectioninfo != null) {
387
+ if (item.sectionstructype == 'child' && TabexSectionsComponentsContext[item.tabexsectioninfo.sectioncompname] != undefined) {
388
+ var sectioncomp = TabexSectionsComponentsContext[item.tabexsectioninfo.sectioncompname];
389
+ return (
390
+ <div className="row m-0 w-100 d-flex justify-content-center">
391
+ <div className={langdetect == 'en' ? 'col-lg-12 p-0 pl-md-2 pr-md-0' : 'col-lg-12 p-0 pl-md-0 pr-md-2 '}>
392
+ <ScrollMenu
393
+ // onWheel={onWheel}
394
+ transitionBehavior={'auto'}
395
+ wrapperClassName={''}
396
+ itemClassName={
397
+ item.tabexsectioninfo.sectioncompname == 'Productcard6'
398
+ ? 'scrollmenuclassnameitemProductcard6'
399
+ : item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
400
+ ? 'scrollmenuclassnameitemProductcardcircularhover'
401
+ : item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularbg'
402
+ ? 'scrollmenuclassnameitemProductcard_with_circularbg'
403
+ : item.tabexsectioninfo.sectioncompname == 'Categorycard_with_twolinestransition'
404
+ ? 'scrollmenuclassnameitemCategorycard_with_twolinestransition'
405
+ : item.tabexsectioninfo.sectioncompname == 'Productcard_with_slideanimation'
406
+ ? 'scrollmenuclassnameitemProductcard_with_slideanimation'
407
+ : item.tabexsectioninfo.sectioncompname == 'Categorycard_withtext'
408
+ ? 'scrollmenuclassnameitemCategorycard_withtext'
409
+ : item.tabexsectioninfo.sectioncompname == 'Productcard_animatedbuttons'
410
+ ? 'scrollmenuclassnameitemProductcard_animatedbuttons'
411
+ : item.tabexsectioninfo.sectioncompname == 'Productcard_with_variants'
412
+ ? 'scrollmenuclassnameitemProductcard_with_variants'
413
+ : item.tabexsectioninfo.sectioncompname == 'Productcarddefault'
414
+ ? 'scrollmenuclassnameitemProductcarddefault'
415
+ : item.tabexsectioninfo.sectioncompname == 'Simpleproductcard'
416
+ ? section_cssstyles.scrollmenuclassnameitemSimpleproductcard + ' scrollmenuclassnameitemSimpleproductcard '
417
+ : item.tabexsectioninfo.sectioncompname == 'Categorycard_with_trianglebg'
418
+ ? 'scrollmenuclassnameitemCategorycard_with_trianglebg'
419
+ : item.tabexsectioninfo.sectioncompname == 'Productcard_with_textonhover'
420
+ ? 'scrollmenuclassnameitemProductcard_with_textonhover'
421
+ : item.tabexsectioninfo.sectioncompname == 'Categorycard_slidebgscaled'
422
+ ? 'scrollmenuclassnameitemCategorycard_slidebgscaled'
423
+ : 'scrollmenuclassnameitem'
424
+ }
425
+ scrollContainerClassName={'scrollmenuclasssubscrollbar'}
426
+ >
427
+ {cardsarray.map((cardinfoitem, cardinfoindex) => {
428
+ return (
429
+ <div
430
+ className={' col-xl-12 p-0 col-lg-12 col-md-12 col-sm-12 '}
431
+ style={{
432
+ paddingRight: sectionproperties.card_marginRight + 'px',
433
+ paddingLeft: sectionproperties.card_marginLeft + 'px',
434
+ }}
435
+ >
436
+ {React.createElement(sectioncomp, {
437
+ sectionidprops: item.sectionid,
438
+ sectionindexprops: index,
439
+ cardinfoitemprops: cardinfoitem,
440
+ cardinfoindexprops: cardinfoindex,
441
+ fetchingtypeprops: fetchingtype,
442
+ })}
443
+ </div>
444
+ );
445
+ })}
446
+ {fetchingtype == 'products' && (
447
+ <button
448
+ className={section_cssstyles.loadbtn + ' d-flex justify-content-end align-items-center '}
449
+ ref={ref}
450
+ onClick={() => fetchProductsQuery.fetchNextPage()}
451
+ disabled={!fetchProductsQuery.hasNextPage || fetchProductsQuery.isFetchingNextPage}
452
+ >
453
+ {fetchProductsQuery.isFetchingNextPage ? (
454
+ <CircularProgress color={sectionproperties.loadbtn_Textcolor} width="20px" height="20px" duration="1s" />
455
+ ) : fetchProductsQuery.hasNextPage ? (
456
+ <i className="fa fa-spinner"></i>
457
+ ) : (
458
+ <i className="fa fa-spinner"></i>
459
+ )}
460
+ </button>
461
+ )}
462
+ </ScrollMenu>
463
+ </div>
464
+ </div>
465
+ );
466
+ }
467
+ }
468
+ })}
469
+ </div>
470
+ </div>
471
+ </div>
472
+ )}
473
+ </div>
474
+ </div>
475
+ );
476
+ };
477
+ return (
478
+ <div className="row m-0 d-flex w-100 justify-content-center mb-md-4 " style={{ zIndex: 2 }}>
479
+ <div className="col-lg-12 p-0 d-flex justify-content-center">
480
+ {sectionproperties.length != 0 && (
481
+ <div
482
+ className={
483
+ langdetect == 'en'
484
+ ? section_cssstyles.cards_sections + ' row ml-0 mr-0 d-flex justify-content-center w-md-100 h-md-100 pr-md-0 '
485
+ : section_cssstyles.cards_sections + ' row ml-0 mr-0 d-flex justify-content-center w-md-100 h-md-100 pl-md-0 '
486
+ }
487
+ >
488
+ {fetchingtype == 'custom' && <>{cardsrender()}</>}
489
+ {fetchingtype != 'custom' && cardsrender()}
490
+ </div>
491
+ )}
492
+ </div>
493
+ </div>
494
+ );
495
+ };
496
+ export default CardsSection2;