tabexseriescomponents 0.0.64 → 0.0.66
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.
- package/dist/index.cjs.js +25023 -16634
- package/dist/index.esm.js +25033 -16645
- package/dist/index.umd.js +24824 -16437
- package/package.json +1 -1
- package/src1-10/Contexts/LanguageContext.jsx +347 -0
- package/src1-10/Contexts/ProductsCardsSectionContext.jsx +28 -0
- package/src1-10/StylesJS/Customstyles.js +235 -0
- package/src1-10/TabexComponents/Cards/CategoryCardwithhoveraction/CategoryCardwithhoveraction.jsx +205 -0
- package/src1-10/TabexComponents/Cards/Categorycard_fullimage/Categorycard_fullimage.jsx +239 -0
- package/src1-10/TabexComponents/Cards/Categorycard_slidebgscaled/Categorycard_slidebgscaled.jsx +198 -0
- package/src1-10/TabexComponents/Cards/Categorycard_with_trianglebg/Categorycard_with_trianglebg.jsx +169 -0
- package/src1-10/TabexComponents/Cards/Categorycard_with_twolinestransition/Categorycard_with_twolinestransition.jsx +180 -0
- package/src1-10/TabexComponents/Cards/Categorycard_withshapes/Categorycard_withshapes.jsx +162 -0
- package/src1-10/TabexComponents/Cards/Categorycard_withtext/Categorycard_withtext.jsx +184 -0
- package/src1-10/TabexComponents/Cards/Classiccategorycard/Classiccategorycard.jsx +149 -0
- package/src1-10/TabexComponents/Cards/Horizontalcard/Horizontalcard.jsx +271 -0
- package/src1-10/TabexComponents/Cards/MenuCard/MenuCard.jsx +546 -0
- package/src1-10/TabexComponents/Cards/ModernProductCard/ModernProductCard.jsx +474 -0
- package/src1-10/TabexComponents/Cards/Productcard6/Productcard6.jsx +290 -0
- package/src1-10/TabexComponents/Cards/Productcard7/Productcard7.jsx +278 -0
- package/src1-10/TabexComponents/Cards/Productcard_animatedbuttons/Productcard_animatedbuttons.jsx +293 -0
- package/src1-10/TabexComponents/Cards/Productcard_with_circularbg/Productcard_with_circularbg.jsx +278 -0
- package/src1-10/TabexComponents/Cards/Productcard_with_circularhover/Productcard_with_circularhover.jsx +312 -0
- package/src1-10/TabexComponents/Cards/Productcard_with_slideanimation/Productcard_with_slideanimation.jsx +279 -0
- package/src1-10/TabexComponents/Cards/Productcard_with_variants/Productcard_with_variants.jsx +293 -0
- package/src1-10/TabexComponents/Cards/Productcard_with_zoominonhover/Productcard_with_zoominonhover.jsx +456 -0
- package/src1-10/TabexComponents/Cards/Productcarddefault/Productcarddefault.jsx +272 -0
- package/src1-10/TabexComponents/Cards/Productccard_with_imageontopleft/Productccard_with_imageontopleft.jsx +286 -0
- package/src1-10/TabexComponents/Cards/Prouductcard_with_zoomhover/Prouductcard_with_zoomhover.jsx +127 -0
- package/src1-10/TabexComponents/Cards/Simplecategorycardwithtextbelow/Simplecategorycardwithtextbelow.jsx +126 -0
- package/src1-10/TabexComponents/Cards/Simpleproductcard/Simpleproductcard.jsx +292 -0
- package/src1-10/TabexComponents/Cards/StylishProductCard/StylishProductCard.jsx +281 -0
- package/src1-10/TabexComponents/Footer/Footer1/Footer1.jsx +418 -0
- package/src1-10/TabexComponents/Footer/Footer2/Footer2.jsx +381 -0
- package/src1-10/TabexComponents/Footer/Footer3/Footer3.jsx +316 -0
- package/src1-10/TabexComponents/Footer/Footer4/Footer4.jsx +437 -0
- package/src1-10/TabexComponents/Footer/Footer5/Footer5.jsx +488 -0
- package/src1-10/TabexComponents/Footer/Footer6/Footer6.jsx +286 -0
- package/src1-10/TabexComponents/Footer/Footer7/Footer7.jsx +370 -0
- package/src1-10/TabexComponents/Footer/Simplefooter/Simplefooter.jsx +231 -0
- package/src1-10/TabexComponents/Generalfiles/images/egyptflag.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/noimage.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/payment/cod.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/payment/fawry.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/payment/payment.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/payment/paymob.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/payment/paypal.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/payment/visa.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/shoppingcart.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/tabexlogo.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/unknownmaleuser.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/usflag.png +0 -0
- package/src1-10/TabexComponents/Generalfiles/images/whatsapp.png +0 -0
- package/src1-10/TabexComponents/Headers/AllinoneHeader/AllinoneHeader.jsx +722 -0
- package/src1-10/TabexComponents/Headers/ClassicHeader/ClassicHeader.jsx +681 -0
- package/src1-10/TabexComponents/Headers/Header4/Header4.jsx +614 -0
- package/src1-10/TabexComponents/Headers/Header6/Header6.jsx +666 -0
- package/src1-10/TabexComponents/Headers/Header8/Header8.jsx +888 -0
- package/src1-10/TabexComponents/Headers/HeaderRestaurant/HeaderRestaurant.jsx +710 -0
- package/src1-10/TabexComponents/Headers/Header_threesectionslogocentered/Header_threesectionslogocentered.jsx +769 -0
- package/src1-10/TabexComponents/Headers/Headerresponsive/Headerresponsive.jsx +666 -0
- package/src1-10/TabexComponents/Headers/HeaderwithContactinfo/HeaderwithContactinfo.jsx +940 -0
- package/src1-10/TabexComponents/Headers/Modernheader/Modernheader.jsx +714 -0
- package/src1-10/TabexComponents/Headers/StylishHeader/StylishHeader.jsx +833 -0
- package/src1-10/TabexComponents/Headers/Subheader/Subheader.jsx +239 -0
- package/src1-10/TabexComponents/Sections/BackgroundImages/Backgroundimage1/Backgroundimage1.jsx +312 -0
- package/src1-10/TabexComponents/Sections/BackgroundImages/Backgroundimage_with_toppill/Backgroundimage_with_toppill.jsx +278 -0
- package/src1-10/TabexComponents/Sections/BackgroundImages/BackgroundimageandTextsection/BackgroundimageandTextsection.jsx +129 -0
- package/src1-10/TabexComponents/Sections/BackgroundImages/Section_with_rightbgcont/Section_with_rightbgcont.jsx +153 -0
- package/src1-10/TabexComponents/Sections/BackgroundImages/Threebgimages/Threebgimages.jsx +295 -0
- package/src1-10/TabexComponents/Sections/BackgroundImages/Twobgimages/Twobgimages.jsx +409 -0
- package/src1-10/TabexComponents/Sections/Cards/CardsSection/CardsSection.jsx +793 -0
- package/src1-10/TabexComponents/Sections/Cards/CardsSection2/CardsSection2.jsx +486 -0
- package/src1-10/TabexComponents/Sections/Cards/CardsSection7/CardsSection7.js +888 -0
- package/src1-10/TabexComponents/Sections/Cards/CardsSection8/CardsSection8.js +419 -0
- package/src1-10/TabexComponents/Sections/Cards/Sixverticalcardssection/Sixverticalcardssection.jsx +512 -0
- package/src1-10/TabexComponents/Sections/Slideshow/AboutSection/AboutSection.jsx +281 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Backgroundimage_with_topcircle/Backgroundimage_with_topcircle.jsx +166 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Freetextsection/Freetextsection.jsx +152 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Image_with_leftwords/Image_with_leftwords.jsx +139 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Image_with_rightwords/Image_with_rightwords.jsx +146 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Servicesection/Servicesection.jsx +209 -0
- package/src1-10/TabexComponents/Sections/Slideshow/ServicesectionCenteredcards/ServicesectionCenteredcards.jsx +145 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshow_with_rotatedsquare/Slideshow_with_rotatedsquare.jsx +252 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshow_with_squarebg/Slideshow_with_squarebg.jsx +175 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshowdifferentanimations/Slideshowdifferentanimations.jsx +154 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshowfade/Slideshowfade.jsx +193 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshowslide/Slideshowslide.jsx +197 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshowzoom/Arrow.js +91 -0
- package/src1-10/TabexComponents/Sections/Slideshow/Slideshowzoom/Slideshowzoom.jsx +309 -0
- package/src1-10/TabexComponents/StaticPages/AccountInformation/AccountInformation.jsx +260 -0
- package/src1-10/TabexComponents/StaticPages/CartSlider/CartSlider.jsx +459 -0
- package/src1-10/TabexComponents/StaticPages/Categoriesdropdown/Categoriesdropdown.jsx +216 -0
- package/src1-10/TabexComponents/StaticPages/Checkout/Checkout.jsx +1220 -0
- package/src1-10/TabexComponents/StaticPages/Filter/Filter.jsx +542 -0
- package/src1-10/TabexComponents/StaticPages/Login/FacebookLoginButton.jsx +51 -0
- package/src1-10/TabexComponents/StaticPages/Login/GoogleLoginButton.jsx +35 -0
- package/src1-10/TabexComponents/StaticPages/Login/Login.jsx +299 -0
- package/src1-10/TabexComponents/StaticPages/OrderSuccess/OrderSuccess.js +192 -0
- package/src1-10/TabexComponents/StaticPages/Ordershistory/Ordershistory.jsx +1271 -0
- package/src1-10/TabexComponents/StaticPages/Policies/Policies.jsx +353 -0
- package/src1-10/TabexComponents/StaticPages/Productinfo/Productinfo.jsx +1456 -0
- package/src1-10/TabexComponents/StaticPages/Searchlist/Searchlist.jsx +209 -0
- package/src1-10/TabexComponents/StaticPages/Signup/CustomerInformationForm.jsx +776 -0
- package/src1-10/TabexComponents/StaticPages/Signup/Signup.jsx +157 -0
- package/src1-10/TabexComponents/StaticPages/Staticpagesrouter/Staticpagesrouter.jsx +285 -0
- package/src1-10/TabexComponents/StaticPages/Viewcart/Viewcart.js +1090 -0
- package/src1-10/TabexComponents/StaticPages/Wishlist/Wishlist.jsx +606 -0
- package/src1-10/assets/images/cod.png +0 -0
- package/src1-10/assets/images/egyptflag.png +0 -0
- package/src1-10/assets/images/fawry.png +0 -0
- package/src1-10/assets/images/payment.png +0 -0
- package/src1-10/assets/images/paymob.png +0 -0
- package/src1-10/assets/images/paypal.png +0 -0
- package/src1-10/assets/images/shoppingcart.png +0 -0
- package/src1-10/assets/images/usflag.png +0 -0
- package/src1-10/assets/images/visa.png +0 -0
- package/src1-10/assets/images/whatsapp.png +0 -0
- package/src1-10/button.jsx +40 -0
- package/src1-10/index.jsx +179 -0
- package/src1-10/styles/Home.module.css +129 -0
- package/src1-10/styles/cards/Categorcycard_fullimage.module.css +10 -0
- package/src1-10/styles/cards/Categorycard_slidebgscaled.module.css +73 -0
- package/src1-10/styles/cards/Categorycard_withshapes.module.css +189 -0
- package/src1-10/styles/cards/Productcard6.module.css +9 -0
- package/src1-10/styles/cards/Productcard_with_circularbg.module.css +137 -0
- package/src1-10/styles/cards/Productccard_with_zoominonhover.module.css +51 -0
- package/src1-10/styles/cards/Prouductcard_with_zoomhover.module.css +61 -0
- package/src1-10/styles/cards/categorycard.module.css +102 -0
- package/src1-10/styles/cards/categorycard3.module.css +51 -0
- package/src1-10/styles/cards/categorycardwithtext.module.css +40 -0
- package/src1-10/styles/cards/productcard_animatedbuttons.module.css +104 -0
- package/src1-10/styles/cards/productcard_with_textonhover.module.css +12 -0
- package/src1-10/styles/cards/productccard_with_imageontopleft.module.css +85 -0
- package/src1-10/styles/general/bootstrap.css +4415 -0
- package/src1-10/styles/general/dropdown.css +199 -0
- package/src1-10/styles/general/editorbardropdown.module.css +94 -0
- package/src1-10/styles/general/filter.module.css +108 -0
- package/src1-10/styles/general/form.module.css +273 -0
- package/src1-10/styles/general/general.module.css +861 -0
- package/src1-10/styles/general/image-gallery.css +481 -0
- package/src1-10/styles/general/react-accessible-accordion.module.css +52 -0
- package/src1-10/styles/general/react-phone-input-2.module.css +927 -0
- package/src1-10/styles/general/scrollbtn.module.css +22 -0
- package/src1-10/styles/general/slick.module.css +166 -0
- package/src1-10/styles/general/tabs.module.css +110 -0
- package/src1-10/styles/general/workplaceeditor.module.css +328 -0
- package/src1-10/styles/globals.css +26 -0
- package/src1-10/styles/headers/Allinoneheader.module.css +91 -0
- package/src1-10/styles/headers/Header7.module.css +50 -0
- package/src1-10/styles/headers/Header_threesectionslogocentered.module.css +97 -0
- package/src1-10/styles/headers/Sideheader.module.css +108 -0
- package/src1-10/styles/headers/classicheaderstyles.module.css +16 -0
- package/src1-10/styles/headers/dropdown.css +0 -0
- package/src1-10/styles/headers/header4.module.css +175 -0
- package/src1-10/styles/headers/header5.module.css +30 -0
- package/src1-10/styles/headers/header6.module.css +117 -0
- package/src1-10/styles/headers/header_contactinfo.module.css +78 -0
- package/src1-10/styles/headers/headerresturant.module.css +89 -0
- package/src1-10/styles/headers/headerstyles.module.css +24 -0
- package/src1-10/styles/headers/modernheader.module.css +78 -0
- package/src1-10/styles/headers/subheader.module.css +114 -0
- package/src1-10/styles/sections/Backgroundimage1.module.css +17 -0
- package/src1-10/styles/sections/Backgroundimage_with_topcircle.module.css +28 -0
- package/src1-10/styles/sections/Section_with_rightbgcont.module.css +49 -0
- package/src1-10/styles/sections/Slideshow_with_rotatedsquare.module.css +35 -0
- package/src1-10/styles/sections/Slideshow_with_squarebg.module.css +39 -0
- package/src1-10/styles/staticpages/accordion.module.css +9 -0
- package/src1-10/styles/staticpages/cart.module.css +108 -0
- package/src1-10/styles/staticpages/dropdown.css +196 -0
- package/src1-10/styles/staticpages/filter.module.css +139 -0
- package/src1-10/styles/staticpages/login.module.css +146 -0
- package/src1-10/styles/staticpages/productinfo.module.css +54 -0
- package/src1-10/styles/staticpages/shop.module.css +191 -0
- package/src1-10/styles/staticpages/signup.module.css +206 -0
- package/src1-10/styles/staticpages/staticroutersidenav.module.css +129 -0
- package/src1-10/styles/staticpages/viewcart.module.css +129 -0
- package/src1-10/styles/staticpages/wishlist.module.css +29 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
// All take sectionidprops & sectionindexprops
|
|
2
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
3
|
+
import generalstyles from '../../../../styles/general/general.module.css';
|
|
4
|
+
import { css } from 'glamor';
|
|
5
|
+
import Filter from '../../../StaticPages/Filter/Filter.jsx';
|
|
6
|
+
import { useInView } from 'react-intersection-observer';
|
|
7
|
+
import { MdOutlineLayersClear } from 'react-icons/md';
|
|
8
|
+
import { BsFillArrowRightCircleFill, BsFillArrowLeftCircleFill } from 'react-icons/bs';
|
|
9
|
+
import { FiFilter } from 'react-icons/fi';
|
|
10
|
+
import { CircularProgress } from 'react-cssfx-loading';
|
|
11
|
+
import { ScrollMenu, VisibilityContext } from 'react-horizontal-scrolling-menu';
|
|
12
|
+
const CardsSection = (props) => {
|
|
13
|
+
const { ref, inView } = useInView();
|
|
14
|
+
const StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
|
|
15
|
+
const lang = props.actions.lang;
|
|
16
|
+
const langdetect = props.actions.langdetect;
|
|
17
|
+
const setlang = props.actions.setlang;
|
|
18
|
+
const templatepropcontext = props.actions.templatepropcontext;
|
|
19
|
+
const fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
|
|
20
|
+
const favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
|
|
21
|
+
const routingcountext = props.actions.routingcountext;
|
|
22
|
+
const StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
|
|
23
|
+
const ProductFilterObjContext = props.actions.ProductFilterObjContext;
|
|
24
|
+
const setProductFilterObjContext = props.actions.setProductFilterObjContext;
|
|
25
|
+
const TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
|
|
26
|
+
const FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
|
|
27
|
+
const setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
|
|
28
|
+
const SearchHeaderMutationContext = props.actions.SearchHeaderMutationContext;
|
|
29
|
+
const serverbaselink = props.actions.serverbaselink;
|
|
30
|
+
const instapikey = props.actions.instapikey;
|
|
31
|
+
const fetchcollections_API = props.actions.fetchcollections_API;
|
|
32
|
+
const fetchProductsQuery = props.actions.fetchProductsQuery;
|
|
33
|
+
const fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
|
|
34
|
+
const setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
|
|
35
|
+
const ParentCollectionsForCollectionQueryArr = props.actions.ParentCollectionsForCollectionQueryArr;
|
|
36
|
+
const setfetchingtype = props.actions.setfetchingtype;
|
|
37
|
+
const fetchingtype = props.actions.fetchingtype;
|
|
38
|
+
const AddtoCartMutationContext = props.actions.AddtoCartMutationContext;
|
|
39
|
+
const setShowProductInfoModalContext = props.actions.setShowProductInfoModalContext;
|
|
40
|
+
const authdetailsContext = props.actions.authdetailsContext;
|
|
41
|
+
const productfiltercontext = props.actions.productfiltercontext;
|
|
42
|
+
const setproductfiltercontext = props.actions.setproductfiltercontext;
|
|
43
|
+
const actions = props.actions;
|
|
44
|
+
const [sectionproperties, setsectionproperties] = useState('');
|
|
45
|
+
const [imagesarray, setimagesarray] = useState([]);
|
|
46
|
+
const [cardsarray, setcardsarray] = useState([]);
|
|
47
|
+
|
|
48
|
+
const [searchinput, setsearchinput] = useState('');
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
if (inView) {
|
|
51
|
+
fetchProductsQuery.fetchNextPage();
|
|
52
|
+
}
|
|
53
|
+
}, [inView]);
|
|
54
|
+
const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '' });
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
|
|
57
|
+
if (sectionitem.sectionid == props.sectionidprops) {
|
|
58
|
+
var secpropobj = {};
|
|
59
|
+
sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
|
|
60
|
+
secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
|
|
61
|
+
});
|
|
62
|
+
setsectionproperties({ ...secpropobj });
|
|
63
|
+
|
|
64
|
+
if (props.srcfromprops == 'GeneralProductsComponent') {
|
|
65
|
+
setfetchingtype('products');
|
|
66
|
+
setProductsFetchingTypeSectionObj({
|
|
67
|
+
productfetchingtype: 'Random',
|
|
68
|
+
collectionid: props.collectionidprops,
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
setfetchingtype(sectionitem.fetchingtype);
|
|
72
|
+
setProductsFetchingTypeSectionObj({
|
|
73
|
+
productfetchingtype: sectionitem.productsfetchingtype,
|
|
74
|
+
collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}, [StatePagePropertiesContext]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
SearchHeaderMutationContext.reset();
|
|
82
|
+
const delayDebounceFn = setTimeout(() => {
|
|
83
|
+
if (searchinput.length != 0) {
|
|
84
|
+
SearchHeaderMutationContext.mutate({
|
|
85
|
+
SearchHeaderValue: searchinput,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}, 1000);
|
|
89
|
+
|
|
90
|
+
return () => clearTimeout(delayDebounceFn);
|
|
91
|
+
}, [searchinput]);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (sectionproperties.length != 0) {
|
|
94
|
+
if (cardsarray.length == 0) {
|
|
95
|
+
if (fetchingtype == 'collections') {
|
|
96
|
+
if (fetchcollectionsQueryContext.isSuccess) {
|
|
97
|
+
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
98
|
+
}
|
|
99
|
+
} else if (fetchingtype == 'products') {
|
|
100
|
+
if (fetchProductsQuery.isSuccess) {
|
|
101
|
+
var allpagesarr = [];
|
|
102
|
+
fetchProductsQuery.data.pages.forEach((page) => {
|
|
103
|
+
page.data.products.forEach((productobj) => {
|
|
104
|
+
allpagesarr.push(productobj);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
cardobjassigner(allpagesarr);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}, [sectionproperties]);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (fetchingtype.length != 0) {
|
|
115
|
+
var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
|
|
116
|
+
|
|
117
|
+
if (fetchingtype == 'collections') {
|
|
118
|
+
// tempFetchQueriesEngineContext.collections = true;
|
|
119
|
+
|
|
120
|
+
if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
|
|
121
|
+
setParentCollectionsForCollectionQueryArr('all');
|
|
122
|
+
} else {
|
|
123
|
+
setParentCollectionsForCollectionQueryArr([ProductsFetchingTypeSectionObj.collectionid]);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (fetchingtype == 'products') {
|
|
127
|
+
var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
|
|
128
|
+
tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
|
|
129
|
+
tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
|
|
130
|
+
|
|
131
|
+
setProductFilterObjContext({ ...tempfetchproductsfilerobjcontext });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
setFetchQueriesEngineContext({ ...tempFetchQueriesEngineContext });
|
|
135
|
+
}
|
|
136
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
if (fetchingtype == 'products') {
|
|
139
|
+
if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.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
|
+
}, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (fetchingtype == 'collections') {
|
|
152
|
+
if (fetchcollectionsQueryContext.isSuccess) {
|
|
153
|
+
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, [fetchcollectionsQueryContext.isSuccess]);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
favassigner();
|
|
159
|
+
}, [favoriteprojectscountContext]);
|
|
160
|
+
const favassigner = () => {
|
|
161
|
+
if (fetchingtype == 'products') {
|
|
162
|
+
if (cardsarray.length != 0) {
|
|
163
|
+
if (favoriteprojectscountContext != undefined && Array.isArray(favoriteprojectscountContext)) {
|
|
164
|
+
var tempcardsarray = [...cardsarray];
|
|
165
|
+
tempcardsarray.forEach(function (arrayItem, arrayindex) {
|
|
166
|
+
arrayItem.IsFavExists = false;
|
|
167
|
+
});
|
|
168
|
+
tempcardsarray.forEach(function (arrayItem, arrayindex) {
|
|
169
|
+
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
170
|
+
if (arrayItem.productid == favitem) {
|
|
171
|
+
arrayItem.IsFavExists = true;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
setcardsarray([...tempcardsarray]);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const cardobjassigner = (fetchedarray) => {
|
|
181
|
+
var temparray = [];
|
|
182
|
+
fetchedarray.forEach(function (arrayItem, arrayindex) {
|
|
183
|
+
var cardobj = {
|
|
184
|
+
name: '',
|
|
185
|
+
image: '',
|
|
186
|
+
};
|
|
187
|
+
if (fetchingtype == 'products') {
|
|
188
|
+
var itemquantity = 0;
|
|
189
|
+
if (langdetect == 'en') {
|
|
190
|
+
cardobj.name = arrayItem.productinfo.name_en;
|
|
191
|
+
} else {
|
|
192
|
+
cardobj.name = arrayItem.productinfo.name_ar;
|
|
193
|
+
}
|
|
194
|
+
if (langdetect == 'en') {
|
|
195
|
+
cardobj.description = arrayItem.productinfo.description_en;
|
|
196
|
+
} else {
|
|
197
|
+
cardobj.description = arrayItem.productinfo.description_ar;
|
|
198
|
+
}
|
|
199
|
+
if (arrayItem.productinfo.hasvariants == 0) {
|
|
200
|
+
fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
|
|
201
|
+
if (cartitem.productid == arrayItem.productinfo.productid) {
|
|
202
|
+
itemquantity = cartitem.quantity;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
cardobj.image = arrayItem.productinfo.productmainimage;
|
|
207
|
+
cardobj.hassale = arrayItem.productinfo.hassale;
|
|
208
|
+
cardobj.productid = arrayItem.productinfo.productid;
|
|
209
|
+
cardobj.hasvariants = arrayItem.productinfo.hasvariants;
|
|
210
|
+
cardobj.description_en = arrayItem.productinfo.description_en;
|
|
211
|
+
cardobj.description_ar = arrayItem.productinfo.description_ar;
|
|
212
|
+
cardobj.defaultprice = arrayItem.productinfo.defaultprice;
|
|
213
|
+
cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
|
|
214
|
+
cardobj.productimages = arrayItem.productinfo.productimages;
|
|
215
|
+
cardobj.quantity = itemquantity;
|
|
216
|
+
cardobj.timestamp = arrayItem.productinfo.timestamp;
|
|
217
|
+
|
|
218
|
+
if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
|
|
219
|
+
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
220
|
+
if (arrayItem.productinfo.productid == favitem) {
|
|
221
|
+
cardobj.IsFavExists = true;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
} else if (fetchingtype == 'collections') {
|
|
226
|
+
cardobj.collectionid = arrayItem.collectionid;
|
|
227
|
+
if (langdetect == 'en') {
|
|
228
|
+
cardobj.name = arrayItem.title_en;
|
|
229
|
+
cardobj.description = arrayItem.description_en;
|
|
230
|
+
} else if (langdetect == 'ar') {
|
|
231
|
+
cardobj.name = arrayItem.title_ar;
|
|
232
|
+
cardobj.description = arrayItem.description_ar;
|
|
233
|
+
}
|
|
234
|
+
cardobj.image = arrayItem.collectionlogo;
|
|
235
|
+
} else if (fetchingtype == 'custom') {
|
|
236
|
+
}
|
|
237
|
+
temparray.push(cardobj);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
setcardsarray([...temparray]);
|
|
241
|
+
};
|
|
242
|
+
const section_cssstyles = {
|
|
243
|
+
sectiontitlespan: css({
|
|
244
|
+
':after': {
|
|
245
|
+
height: '5px',
|
|
246
|
+
width: sectionproperties.sectitle_lineafterwidth + '%',
|
|
247
|
+
backgroundColor: sectionproperties.linebgcolor,
|
|
248
|
+
},
|
|
249
|
+
}),
|
|
250
|
+
line_left: css({
|
|
251
|
+
height: '1px',
|
|
252
|
+
position: 'relative',
|
|
253
|
+
flex: '1 1 auto',
|
|
254
|
+
minWidth: '10%',
|
|
255
|
+
background: sectionproperties.linebgcolor,
|
|
256
|
+
}),
|
|
257
|
+
line_right: css({
|
|
258
|
+
height: '1px',
|
|
259
|
+
position: 'relative',
|
|
260
|
+
flex: '1 1 auto',
|
|
261
|
+
minWidth: '10%',
|
|
262
|
+
background: sectionproperties.linebgcolor,
|
|
263
|
+
}),
|
|
264
|
+
cards_sections: css({
|
|
265
|
+
marginTop: sectionproperties.marginTop + 'px',
|
|
266
|
+
marginBottom: sectionproperties.marginBottom + 'px',
|
|
267
|
+
paddingLeft: langdetect == 'en' ? sectionproperties.paddingLeft + 'px' : sectionproperties.paddingRight + 'px',
|
|
268
|
+
paddingRight: langdetect == 'en' ? sectionproperties.paddingRight + 'px' : sectionproperties.paddingLeft + 'px',
|
|
269
|
+
paddingTop: sectionproperties.paddingTop + 'px',
|
|
270
|
+
paddingBottom: sectionproperties.paddingBottom + 'px',
|
|
271
|
+
|
|
272
|
+
borderBottomLeftRadius: sectionproperties.borderBottomLeftRadius + 'px',
|
|
273
|
+
borderBottomRightRadius: sectionproperties.borderBottomRightRadius + 'px',
|
|
274
|
+
borderTopLeftRadius: sectionproperties.borderTopLeftRadius + 'px',
|
|
275
|
+
borderTopRightRadius: sectionproperties.borderTopRightRadius + 'px',
|
|
276
|
+
boxShadow: sectionproperties.sectioncardshadow == 'Show' ? '0 0 10px ' + sectionproperties.sectioncardshadowcolor : 'none',
|
|
277
|
+
borderColor: sectionproperties.sectioncardbordercolor,
|
|
278
|
+
border: sectionproperties.sectioncardborderwidth + 'px solid',
|
|
279
|
+
}),
|
|
280
|
+
filterbtn: css({
|
|
281
|
+
width: sectionproperties.filterbtn_Width + 'px',
|
|
282
|
+
height: sectionproperties.filterbtn_Height + 'px',
|
|
283
|
+
background: sectionproperties.filterbtn_bgtransparent == 'Transparent' ? 'transparent' : sectionproperties.filterbtn_bgColor,
|
|
284
|
+
borderBottomLeftRadius: sectionproperties.filterbtn_borderBottomLeftRadius + 'px',
|
|
285
|
+
borderBottomRightRadius: sectionproperties.filterbtn_borderBottomRightRadius + 'px',
|
|
286
|
+
borderTopLeftRadius: sectionproperties.filterbtn_borderTopLeftRadius + 'px',
|
|
287
|
+
borderTopRightRadius: sectionproperties.filterbtn_borderTopRightRadius + 'px',
|
|
288
|
+
color: sectionproperties.filterbtn_Textcolor,
|
|
289
|
+
boxShadow: sectionproperties.filterbtn_showshadow == 'Show' ? '0 0 10px ' + sectionproperties.filterbtn_shadowcolor : '',
|
|
290
|
+
marginTop: sectionproperties.filterbtn_marginTop + 'px',
|
|
291
|
+
marginBottom: sectionproperties.filterbtn_marginBottom + 'px',
|
|
292
|
+
marginLeft: sectionproperties.filterbtn_marginLeft + 'px',
|
|
293
|
+
marginRight: sectionproperties.filterbtn_marginRight + 'px',
|
|
294
|
+
transition: '.3s',
|
|
295
|
+
':hover': {
|
|
296
|
+
background: sectionproperties.filterbtn_transparentbgcoloronhover == 'Transparent' ? 'transparent' : sectionproperties.filterbtn_bgColoronhover,
|
|
297
|
+
color: sectionproperties.filterbtn_Textcoloronhover,
|
|
298
|
+
},
|
|
299
|
+
}),
|
|
300
|
+
viewmorebtn: css({
|
|
301
|
+
width: sectionproperties.viewmorebtn_Width + 'px',
|
|
302
|
+
height: sectionproperties.viewmorebtn_Height + 'px',
|
|
303
|
+
background: sectionproperties.viewmorebtn_bgtransparent == 'Transparent' ? 'transparent' : sectionproperties.viewmorebtn_bgColor,
|
|
304
|
+
borderRadius: sectionproperties.viewmorebtn_borderBottomLeftRadius + 'px',
|
|
305
|
+
color: sectionproperties.viewmorebtn_Textcolor,
|
|
306
|
+
fontSize: sectionproperties.viewmorebtn_fontSize + 'px',
|
|
307
|
+
fontWeight: sectionproperties.viewmorebtn_fontWeight,
|
|
308
|
+
textDecoration: sectionproperties.viewmorebtn_bgtransparent == 'Transparent' ? 'underline' : 'none',
|
|
309
|
+
transition: '.3s',
|
|
310
|
+
':hover': {
|
|
311
|
+
background: sectionproperties.viewmorebtn_transparentbgcoloronhover == 'Transparent' ? 'transparent' : sectionproperties.viewmorebtn_bgColoronhover,
|
|
312
|
+
color: sectionproperties.viewmorebtn_Textcoloronhover,
|
|
313
|
+
},
|
|
314
|
+
}),
|
|
315
|
+
loadbtn: css({
|
|
316
|
+
fontSize: sectionproperties.generaltext_fontSize + 'px',
|
|
317
|
+
color: sectionproperties.generaltext_fontColor,
|
|
318
|
+
fontWeight: sectionproperties.generaltext_fontWeight,
|
|
319
|
+
textDecoration: 'underline',
|
|
320
|
+
transition: '.3s',
|
|
321
|
+
':hover': {
|
|
322
|
+
color: sectionproperties.text_secondarycolor,
|
|
323
|
+
},
|
|
324
|
+
}),
|
|
325
|
+
};
|
|
326
|
+
const cardsrender = () => {
|
|
327
|
+
return (
|
|
328
|
+
<div
|
|
329
|
+
style={{ background: sectionproperties.backgroundColor }}
|
|
330
|
+
className={sectionproperties.showFilter == 'show' && sectionproperties.filterdirection == 'Vertical' ? 'col-lg-9 p-sm-0' : 'row m-0 w-100'}
|
|
331
|
+
>
|
|
332
|
+
{!fetchProductsQuery.isFetching && cardsarray.length == 0 && (
|
|
333
|
+
<div className="row m-0 w-100 d-flex align-items-center" style={{ height: '50vh' }}>
|
|
334
|
+
<div className="col-lg-12 text-light d-flex align-items-center justify-content-center flex-column">
|
|
335
|
+
<MdOutlineLayersClear
|
|
336
|
+
style={{
|
|
337
|
+
fontSize: sectionproperties.noprod_iconfontSize + 'px',
|
|
338
|
+
color: sectionproperties.noprod_iconcolor,
|
|
339
|
+
}}
|
|
340
|
+
/>
|
|
341
|
+
<p
|
|
342
|
+
style={{
|
|
343
|
+
fontSize: sectionproperties.noprod_fontSize + 'px',
|
|
344
|
+
fontWeight: sectionproperties.noprod_fontWeight,
|
|
345
|
+
textTransform: sectionproperties.noprod_textTransform,
|
|
346
|
+
color: sectionproperties.noprod_color,
|
|
347
|
+
}}
|
|
348
|
+
>
|
|
349
|
+
{langdetect == 'en' ? 'No Products Found' : 'لا توجد منتجات'}
|
|
350
|
+
</p>
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
)}
|
|
354
|
+
{cardsarray.length != 0 && sectionproperties.length != 0 && (
|
|
355
|
+
<div className="row m-0 w-100 d-flex align-items-center p-sm-0">
|
|
356
|
+
<div
|
|
357
|
+
className="row ml-0 mr-0 w-100 pl-md-2 pr-md-2 pl-sm-2 pr-sm-2"
|
|
358
|
+
style={{
|
|
359
|
+
marginTop: sectionproperties.sectionTitleMarginTop + 'px',
|
|
360
|
+
marginBottom: sectionproperties.sectionTitleMarginBottom + 'px',
|
|
361
|
+
paddingLeft: sectionproperties.sectionTitleMarginLeft + 'px',
|
|
362
|
+
paddingRight: sectionproperties.sectionTitleMarginRight + 'px',
|
|
363
|
+
}}
|
|
364
|
+
>
|
|
365
|
+
{sectionproperties.sectiontitleshow == 'Show' && (
|
|
366
|
+
<div
|
|
367
|
+
className={
|
|
368
|
+
sectionproperties.viewmorebtnshow == 'Show'
|
|
369
|
+
? sectionproperties.sectiontitleposition == 'Centered'
|
|
370
|
+
? ' col-lg-12 col-md-12 col-sm-12 d-flex align-items-center p-0 '
|
|
371
|
+
: ' col-lg-7 col-md-7 col-sm-7 d-flex align-items-center p-0 '
|
|
372
|
+
: sectionproperties.showFilter == 'show'
|
|
373
|
+
? ' col-lg-12 col-md-7 col-sm-7 d-flex align-items-center p-0 '
|
|
374
|
+
: ' col-lg-12 col-md-12 col-sm-12 d-flex align-items-center p-0 '
|
|
375
|
+
}
|
|
376
|
+
>
|
|
377
|
+
<div
|
|
378
|
+
// mb-auto
|
|
379
|
+
className={`${generalstyles.sectiontitlecont}` + ' col-lg-12 p-0 d-flex align-items-center '}
|
|
380
|
+
style={{
|
|
381
|
+
justifyContent: sectionproperties.sectiontitleposition == 'Centered' ? 'center' : 'start',
|
|
382
|
+
}}
|
|
383
|
+
>
|
|
384
|
+
<div
|
|
385
|
+
className="d-flex align-items-center flex-row"
|
|
386
|
+
style={{
|
|
387
|
+
position: 'relative',
|
|
388
|
+
justifyContent: sectionproperties.sectiontitleposition == 'Centered' ? 'center' : '',
|
|
389
|
+
width: sectionproperties.sectiontitlestyle == 'Line Before Text' ? '100%' : '',
|
|
390
|
+
}}
|
|
391
|
+
>
|
|
392
|
+
{sectionproperties.sectiontitlestyle == 'Line Before Text' && <span className={section_cssstyles.line_left}></span>}
|
|
393
|
+
<p
|
|
394
|
+
className={
|
|
395
|
+
sectionproperties.sectiontitlefontfamily == 'Pacifico'
|
|
396
|
+
? `${section_cssstyles.sectiontitlespan}` +
|
|
397
|
+
' PacificoFont mb-auto mb-0 pb-0 font-sm-18 font-md-20 wordbreak d-flex align-items-center justify-content-start '
|
|
398
|
+
: sectionproperties.sectiontitlefontfamily == 'Playfair'
|
|
399
|
+
? `${section_cssstyles.sectiontitlespan}` +
|
|
400
|
+
' PlayfairFont mb-auto mb-0 pb-0 font-sm-18 font-md-20 wordbreak d-flex align-items-center justify-content-start '
|
|
401
|
+
: sectionproperties.sectiontitlefontfamily == 'Great Vibes'
|
|
402
|
+
? `${section_cssstyles.sectiontitlespan}` +
|
|
403
|
+
' GreatvibesFont mb-auto mb-0 pb-0 font-sm-18 font-md-20 wordbreak d-flex align-items-center justify-content-start '
|
|
404
|
+
: `${section_cssstyles.sectiontitlespan}` +
|
|
405
|
+
' mb-auto mb-0 pb-0 font-sm-18 font-md-20 wordbreak d-flex align-items-center justify-content-start '
|
|
406
|
+
}
|
|
407
|
+
style={{
|
|
408
|
+
fontSize: sectionproperties.sectionTitleFontSize + 'px',
|
|
409
|
+
color: sectionproperties.sectionTitleColor,
|
|
410
|
+
fontWeight: sectionproperties.sectionTitleFontWeight,
|
|
411
|
+
paddingLeft: sectionproperties.sectiontitlestyle == 'Line Before Text' ? '12px' : 0,
|
|
412
|
+
paddingRight: sectionproperties.sectiontitlestyle == 'Line Before Text' ? '12px' : 0,
|
|
413
|
+
textAlign: sectionproperties.sectiontitleposition == 'Centered' ? 'center' : '',
|
|
414
|
+
}}
|
|
415
|
+
>
|
|
416
|
+
{langdetect == 'en' ? sectionproperties.sectionTitleContent : sectionproperties.sectionTitleContent_ar}
|
|
417
|
+
</p>
|
|
418
|
+
{sectionproperties.sectiontitlestyle == 'Line Before Text' && <span className={section_cssstyles.line_right}></span>}
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
)}
|
|
423
|
+
{sectionproperties.prodCatShow == 'Show' && (
|
|
424
|
+
<div
|
|
425
|
+
className={' col-lg-12 d-flex align-items-center '}
|
|
426
|
+
style={{
|
|
427
|
+
justifyContent: sectionproperties.descriptionCentered == 'Centered' ? 'center' : 'start',
|
|
428
|
+
marginBottom: sectionproperties.descriptionMarginBottom + 'px',
|
|
429
|
+
paddingLeft: langdetect == 'en' ? sectionproperties.description_marginLeft + 'px' : sectionproperties.description_marginRight + 'px',
|
|
430
|
+
paddingRight: langdetect == 'en' ? sectionproperties.description_marginRight + 'px' : sectionproperties.description_marginLeft + 'px',
|
|
431
|
+
}}
|
|
432
|
+
>
|
|
433
|
+
<p
|
|
434
|
+
className="m-0 p-0 wordbreak "
|
|
435
|
+
style={{
|
|
436
|
+
fontSize: sectionproperties.prodCatFontSize + 'px',
|
|
437
|
+
color: sectionproperties.prodCatColor,
|
|
438
|
+
fontWeight: sectionproperties.prodCatFontWeight,
|
|
439
|
+
textAlign: sectionproperties.descriptionCentered == 'Centered' ? 'center' : langdetect == 'en' ? 'left' : 'right',
|
|
440
|
+
}}
|
|
441
|
+
>
|
|
442
|
+
{langdetect == 'en' ? sectionproperties.descriptionContentEn : sectionproperties.descriptionContentAr}
|
|
443
|
+
</p>
|
|
444
|
+
</div>
|
|
445
|
+
)}
|
|
446
|
+
<div
|
|
447
|
+
className={
|
|
448
|
+
sectionproperties.sectiontitleposition == 'Centered'
|
|
449
|
+
? 'col-lg-12 col-md-12 col-sm-12 d-flex align-item-center justify-content-center p-0'
|
|
450
|
+
: 'col-lg-5 col-md-5 col-sm-5 d-flex align-item-center justify-content-end justify-content-sm-center p-0'
|
|
451
|
+
}
|
|
452
|
+
style={{
|
|
453
|
+
marginTop: sectionproperties.sectiontitleposition == 'Centered' ? '10px' : 0,
|
|
454
|
+
}}
|
|
455
|
+
>
|
|
456
|
+
<div
|
|
457
|
+
className={
|
|
458
|
+
sectionproperties.sectiontitleposition == 'Centered'
|
|
459
|
+
? ' row m-0 w-100 d-flex align-item-center justify-content-center '
|
|
460
|
+
: ' row m-0 w-100 d-flex align-item-center justify-content-end '
|
|
461
|
+
}
|
|
462
|
+
>
|
|
463
|
+
{/* sectionproperties.view_as_slider_vertical == 'Slider (Horizontal)' && */}
|
|
464
|
+
{sectionproperties.viewmorebtnshow == 'Show' && (
|
|
465
|
+
<button
|
|
466
|
+
className={
|
|
467
|
+
sectionproperties.sectiontitleposition == 'Centered'
|
|
468
|
+
? `${section_cssstyles.viewmorebtn}` + ' m-sm-0 allcentered mt-auto mb-auto '
|
|
469
|
+
: `${section_cssstyles.viewmorebtn}` + ' w-sm-auto btn-circle-resp m-sm-0 mt-auto mb-auto '
|
|
470
|
+
}
|
|
471
|
+
onClick={() => {
|
|
472
|
+
if (fetchingtype == 'products') {
|
|
473
|
+
if (ProductsFetchingTypeSectionObj.productfetchingtype == 'Collection') {
|
|
474
|
+
routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, ProductsFetchingTypeSectionObj.collectionid);
|
|
475
|
+
} else {
|
|
476
|
+
routingcountext(StaticPagesLinksContext.GeneralProductsComponent, false);
|
|
477
|
+
}
|
|
478
|
+
} else {
|
|
479
|
+
routingcountext(StaticPagesLinksContext.GeneralProductsComponent, false);
|
|
480
|
+
}
|
|
481
|
+
}}
|
|
482
|
+
>
|
|
483
|
+
<span
|
|
484
|
+
className={
|
|
485
|
+
sectionproperties.sectiontitleposition == 'Centered'
|
|
486
|
+
? 'd-flex justify-content-center align-items-center'
|
|
487
|
+
: 'd-flex justify-content-center align-items-center d-md-none'
|
|
488
|
+
}
|
|
489
|
+
>
|
|
490
|
+
{langdetect == 'en' ? sectionproperties.viewmorebtn_text : sectionproperties.viewmorebtn_text_ar}
|
|
491
|
+
</span>
|
|
492
|
+
<span
|
|
493
|
+
className={
|
|
494
|
+
sectionproperties.sectiontitleposition == 'Centered'
|
|
495
|
+
? 'd-none align-items-center justify-content-center'
|
|
496
|
+
: 'd-none d-md-flex align-items-center justify-content-center'
|
|
497
|
+
}
|
|
498
|
+
>
|
|
499
|
+
<i className="h-100 d-flex align-items-center justify-content-center">
|
|
500
|
+
{langdetect == 'en' ? <BsFillArrowRightCircleFill /> : <BsFillArrowLeftCircleFill />}
|
|
501
|
+
</i>
|
|
502
|
+
</span>
|
|
503
|
+
</button>
|
|
504
|
+
)}
|
|
505
|
+
{sectionproperties.showFilter == 'show' && (
|
|
506
|
+
<button
|
|
507
|
+
className={
|
|
508
|
+
sectionproperties.searchbar_show == 'Show'
|
|
509
|
+
? ' col-lg-3 col-md-3 pl-0 pr-0 d-none d-md-flex justify-content-end ml-1 '
|
|
510
|
+
: ' col-lg-12 col-sm-12 pl-0 pr-0 d-none d-md-flex justify-content-end ml-1 '
|
|
511
|
+
}
|
|
512
|
+
onClick={() => {
|
|
513
|
+
var element = document.getElementById('filterslider');
|
|
514
|
+
element.classList.add(filterstyles.filterslider_container_opened);
|
|
515
|
+
}}
|
|
516
|
+
>
|
|
517
|
+
<div className={`${section_cssstyles.filterbtn}` + ' btn-circle-resp '}>
|
|
518
|
+
<i className="h-100 d-flex align-items-center justify-content-center">
|
|
519
|
+
<FiFilter />
|
|
520
|
+
</i>
|
|
521
|
+
</div>
|
|
522
|
+
</button>
|
|
523
|
+
)}
|
|
524
|
+
</div>
|
|
525
|
+
</div>
|
|
526
|
+
{sectionproperties.showseparator == 'Show' && (
|
|
527
|
+
<div className="col-lg-12 p-0">
|
|
528
|
+
<hr className="mt-3 mb-2" style={{ borderColor: sectionproperties.upperseparatorbgcolor }} />
|
|
529
|
+
</div>
|
|
530
|
+
)}
|
|
531
|
+
</div>
|
|
532
|
+
{StatePagePropertiesContext.pageobj.sections[props.sectionindexprops].childsections.map((item, index) => {
|
|
533
|
+
if (item.tabexsectioninfo != null) {
|
|
534
|
+
if (item.sectionstructype == 'child' && TabexSectionsComponentsContext[item.tabexsectioninfo.sectioncompname] != undefined) {
|
|
535
|
+
var Sectioncomp = TabexSectionsComponentsContext[item.tabexsectioninfo.sectioncompname];
|
|
536
|
+
return (
|
|
537
|
+
<div
|
|
538
|
+
className={
|
|
539
|
+
sectionproperties.paddingLeft != 0 && sectionproperties.paddingRight != 0
|
|
540
|
+
? section_cssstyles.cards_sections + ' row ml-0 mr-0 w-100 pl-md-2 pr-md-2 '
|
|
541
|
+
: sectionproperties.paddingRight != 0
|
|
542
|
+
? section_cssstyles.cards_sections + ' row ml-0 mr-0 w-100 pr-md-2 '
|
|
543
|
+
: sectionproperties.paddingLeft != 0
|
|
544
|
+
? section_cssstyles.cards_sections + ' row ml-0 mr-0 w-100 pl-md-2 '
|
|
545
|
+
: section_cssstyles.cards_sections + ' row ml-0 mr-0 w-100 '
|
|
546
|
+
}
|
|
547
|
+
>
|
|
548
|
+
{sectionproperties.view_as_slider_vertical == 'Slider (Horizontal)' && (
|
|
549
|
+
<div className={langdetect == 'en' ? 'col-lg-12 p-0 pl-sm-2' : 'col-lg-12 p-0 pr-sm-2'}>
|
|
550
|
+
<ScrollMenu
|
|
551
|
+
transitionBehavior={'auto'}
|
|
552
|
+
wrapperClassName={''}
|
|
553
|
+
itemClassName={
|
|
554
|
+
item.tabexsectioninfo.sectioncompname == 'Productcard6'
|
|
555
|
+
? 'scrollmenuclassnameitemProductcard6'
|
|
556
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
557
|
+
? 'scrollmenuclassnameitemProductcard_with_circularhover'
|
|
558
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularbg'
|
|
559
|
+
? 'scrollmenuclassnameitemProductcard_with_circularbg'
|
|
560
|
+
: item.tabexsectioninfo.sectioncompname == 'Categorycard_with_twolinestransition'
|
|
561
|
+
? 'scrollmenuclassnameitemCategorycard_with_twolinestransition'
|
|
562
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_with_slideanimation'
|
|
563
|
+
? 'scrollmenuclassnameitemProductcard_with_slideanimation'
|
|
564
|
+
: item.tabexsectioninfo.sectioncompname == 'Categorycard_withtext'
|
|
565
|
+
? 'scrollmenuclassnameitemCategorycard_withtext'
|
|
566
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_animatedbuttons'
|
|
567
|
+
? 'scrollmenuclassnameitemProductcard_animatedbuttons'
|
|
568
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_with_variants'
|
|
569
|
+
? 'scrollmenuclassnameitemProductcard_with_variants'
|
|
570
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcarddefault'
|
|
571
|
+
? 'scrollmenuclassnameitemProductcarddefault'
|
|
572
|
+
: item.tabexsectioninfo.sectioncompname == 'Simpleproductcard'
|
|
573
|
+
? 'scrollmenuclassnameitemSimpleproductcard'
|
|
574
|
+
: item.tabexsectioninfo.sectioncompname == 'Categorycard_with_trianglebg'
|
|
575
|
+
? 'scrollmenuclassnameitemCategorycard_with_trianglebg'
|
|
576
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_with_textonhover'
|
|
577
|
+
? 'scrollmenuclassnameitemProductcard_with_textonhover'
|
|
578
|
+
: item.tabexsectioninfo.sectioncompname == 'Categorycard_slidebgscaled'
|
|
579
|
+
? 'scrollmenuclassnameitemCategorycard_slidebgscaled'
|
|
580
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft'
|
|
581
|
+
? 'scrollmenuclassnameitemProductccard_with_imageontopleft'
|
|
582
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard_with_zoominonhover'
|
|
583
|
+
? 'scrollmenuclassnameitemProductcard_with_zoominonhover'
|
|
584
|
+
: item.tabexsectioninfo.sectioncompname == 'Horizontalcard'
|
|
585
|
+
? 'scrollmenuclassnameitemProductcard_Horizontalcard'
|
|
586
|
+
: item.tabexsectioninfo.sectioncompname == 'Categorycard_fullimage'
|
|
587
|
+
? 'scrollmenuclassnameitemCategorycard_fullimage'
|
|
588
|
+
: item.tabexsectioninfo.sectioncompname == 'Classiccategorycard'
|
|
589
|
+
? 'scrollmenuclassnameitemClassiccategorycard'
|
|
590
|
+
: item.tabexsectioninfo.sectioncompname == 'ModernProductCard'
|
|
591
|
+
? 'scrollmenuclassnameitemModernProductCard'
|
|
592
|
+
: item.tabexsectioninfo.sectioncompname == 'Simplecategorycardwithtextbelow'
|
|
593
|
+
? 'scrollmenuclassnameitemSimplecategorycardwithtextbelow'
|
|
594
|
+
: item.tabexsectioninfo.sectioncompname == 'Productcard7'
|
|
595
|
+
? 'scrollmenuclassnameitemProductcard7'
|
|
596
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
597
|
+
? 'scrollmenuclassnameitemMenuCard'
|
|
598
|
+
: 'scrollmenuclassnameitem'
|
|
599
|
+
}
|
|
600
|
+
scrollContainerClassName={'scrollmenuclasssubscrollbar'}
|
|
601
|
+
>
|
|
602
|
+
{cardsarray.map((cardinfoitem, cardinfoindex) => {
|
|
603
|
+
return (
|
|
604
|
+
<div
|
|
605
|
+
className={' col-xl-12 p-0 col-lg-12 col-md-12 col-sm-12 w-100'}
|
|
606
|
+
// style={{
|
|
607
|
+
// minWidth:
|
|
608
|
+
// item.tabexsectioninfo.sectioncompname == 'Productcard_animatedbuttons' ||
|
|
609
|
+
// item.tabexsectioninfo.sectioncompname == 'Horizontalcard'
|
|
610
|
+
// ? sectionproperties.width + 'px'
|
|
611
|
+
// : '',
|
|
612
|
+
// maxWidth:
|
|
613
|
+
// item.tabexsectioninfo.sectioncompname == 'Productcard_animatedbuttons' ||
|
|
614
|
+
// item.tabexsectioninfo.sectioncompname == 'Horizontalcard'
|
|
615
|
+
// ? sectionproperties.width + 'px'
|
|
616
|
+
// : '',
|
|
617
|
+
// }}
|
|
618
|
+
>
|
|
619
|
+
{/* {React.createElement(sectioncomp, {
|
|
620
|
+
sectionidprops: item.sectionid,
|
|
621
|
+
sectionindexprops: index,
|
|
622
|
+
cardinfoitemprops: cardinfoitem,
|
|
623
|
+
cardinfoindexprops: cardinfoindex,
|
|
624
|
+
fetchingtypeprops: fetchingtype,
|
|
625
|
+
sectiontypeprops: 'horizontal',
|
|
626
|
+
})} */}
|
|
627
|
+
<Sectioncomp
|
|
628
|
+
sectiontypeprops={'horizontal'}
|
|
629
|
+
fetchingtypeprops={fetchingtype}
|
|
630
|
+
cardinfoindexprops={cardinfoindex}
|
|
631
|
+
cardinfoitemprops={cardinfoitem}
|
|
632
|
+
sectionindexprops={index}
|
|
633
|
+
sectionidprops={item.sectionid}
|
|
634
|
+
// {...props}
|
|
635
|
+
// StatePagePropertiesContext={StatePagePropertiesContext}
|
|
636
|
+
actions={actions}
|
|
637
|
+
/>
|
|
638
|
+
</div>
|
|
639
|
+
);
|
|
640
|
+
})}
|
|
641
|
+
{fetchingtype == 'products' && fetchProductsQuery.isFetchingNextPage && (
|
|
642
|
+
<button
|
|
643
|
+
className={section_cssstyles.loadbtn + ' d-flex justify-content-end align-items-center '}
|
|
644
|
+
ref={ref}
|
|
645
|
+
onClick={() => fetchProductsQuery.fetchNextPage()}
|
|
646
|
+
disabled={!fetchProductsQuery.hasNextPage || fetchProductsQuery.isFetchingNextPage}
|
|
647
|
+
>
|
|
648
|
+
<CircularProgress color="#000" width="20px" height="20px" duration="1s" />
|
|
649
|
+
</button>
|
|
650
|
+
)}
|
|
651
|
+
</ScrollMenu>
|
|
652
|
+
</div>
|
|
653
|
+
)}
|
|
654
|
+
{sectionproperties.view_as_slider_vertical != 'Slider (Horizontal)' && (
|
|
655
|
+
<div className="row m-0 w-100">
|
|
656
|
+
{cardsarray.map((cardinfoitem, cardinfoindex) => {
|
|
657
|
+
return (
|
|
658
|
+
<div
|
|
659
|
+
className={
|
|
660
|
+
sectionproperties.numberOfColsvertical == '1'
|
|
661
|
+
? item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
662
|
+
? ' col-xl-12 p-0 col-lg-12 col-md-4 p-0 d-flex justify-content-center col-sm-6 '
|
|
663
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft'
|
|
664
|
+
? ' col-xl-12 p-0 col-lg-12 col-md-12 col-sm-6 d-flex justify-content-center p-0 '
|
|
665
|
+
: item.tabexsectioninfo.sectioncompname == 'ModernProductCard'
|
|
666
|
+
? ' col-xl-12 p-0 col-lg-12 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
667
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
668
|
+
? ' col-xl-12 p-0 col-lg-12 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
669
|
+
: ' col-xl-12 p-0 col-lg-12 col-md-6 col-sm-12 d-flex justify-content-center p-0 '
|
|
670
|
+
: sectionproperties.numberOfColsvertical == '2'
|
|
671
|
+
? item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
672
|
+
? ' col-xl-6 p-0 col-lg-6 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
673
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft '
|
|
674
|
+
? ' col-xl-6 p-0 col-lg-6 col-md-6 col-sm-6 d-flex justify-content-center p-0 '
|
|
675
|
+
: item.tabexsectioninfo.sectioncompname == 'ModernProductCard'
|
|
676
|
+
? ' col-xl-6 p-0 col-lg-6 col-md-6 col-sm-12 d-flex justify-content-center p-0 '
|
|
677
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
678
|
+
? ' col-xl-6 p-0 col-lg-6 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
679
|
+
: ' col-xl-6 p-0 col-lg-6 col-md-6 col-sm-12 d-flex justify-content-center p-0'
|
|
680
|
+
: sectionproperties.numberOfColsvertical == '3'
|
|
681
|
+
? item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
682
|
+
? ' col-xl-4 col-lg-4 col-md-4 col-sm-6 p-0 d-flex justify-content-center '
|
|
683
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft'
|
|
684
|
+
? ' col-xl-4 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
685
|
+
: item.tabexsectioninfo.sectioncompname == 'ModernProductCard'
|
|
686
|
+
? ' col-xl-4 p-0 col-lg-4 col-md-4 col-sm-12 d-flex justify-content-center p-0 '
|
|
687
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
688
|
+
? ' col-xl-4 p-0 col-lg-4 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
689
|
+
: ' col-xl-4 col-lg-4 col-md-6 col-sm-12 d-flex justify-content-center p-0 '
|
|
690
|
+
: sectionproperties.numberOfColsvertical == '4'
|
|
691
|
+
? item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
692
|
+
? ' col-xl-3 p-0 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
693
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft'
|
|
694
|
+
? ' col-xl-3 p-0 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
695
|
+
: item.tabexsectioninfo.sectioncompname == 'ModernProductCard'
|
|
696
|
+
? ' col-xl-3 p-0 col-lg-4 col-md-6 col-sm-12 d-flex justify-content-center p-0 '
|
|
697
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
698
|
+
? ' col-xl-3 p-0 col-lg-3 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
699
|
+
: ' col-xl-3 col-lg-4 col-md-4 col-sm-6 p-0 d-flex justify-content-center p-0 '
|
|
700
|
+
: sectionproperties.numberOfColsvertical == '12'
|
|
701
|
+
? item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
702
|
+
? ' col-xl-3 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
703
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft'
|
|
704
|
+
? ' col-xl-3 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
705
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
706
|
+
? ' col-xl-3 p-0 col-lg-4 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
707
|
+
: ''
|
|
708
|
+
: sectionproperties.numberOfColsvertical == '6'
|
|
709
|
+
? item.tabexsectioninfo.sectioncompname == 'Productcard_with_circularhover'
|
|
710
|
+
? ' col-xl-2 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
711
|
+
: item.tabexsectioninfo.sectioncompname == 'Productccard_with_imageontopleft'
|
|
712
|
+
? ' col-xl-2 col-lg-4 col-md-4 col-sm-6 d-flex justify-content-center p-0 '
|
|
713
|
+
: item.tabexsectioninfo.sectioncompname == 'MenuCard'
|
|
714
|
+
? ' col-xl-2 p-0 col-lg-2 col-md-12 col-sm-12 d-flex justify-content-center p-0 '
|
|
715
|
+
: ' col-xl-2 col-lg-4 col-md-6 col-sm-12 d-flex justify-content-center p-0 '
|
|
716
|
+
: ''
|
|
717
|
+
}
|
|
718
|
+
>
|
|
719
|
+
<Sectioncomp
|
|
720
|
+
sectiontypeprops={'horizontal'}
|
|
721
|
+
fetchingtypeprops={fetchingtype}
|
|
722
|
+
cardinfoindexprops={cardinfoindex}
|
|
723
|
+
cardinfoitemprops={cardinfoitem}
|
|
724
|
+
sectionindexprops={index}
|
|
725
|
+
sectionidprops={item.sectionid}
|
|
726
|
+
actions={actions}
|
|
727
|
+
/>
|
|
728
|
+
</div>
|
|
729
|
+
);
|
|
730
|
+
})}
|
|
731
|
+
{fetchingtype == 'products' && (
|
|
732
|
+
<div className="w-100 col-lg-12 allcentered">
|
|
733
|
+
<button
|
|
734
|
+
className={section_cssstyles.loadbtn + ' d-flex justify-content-end align-items-center '}
|
|
735
|
+
// ref={ref}
|
|
736
|
+
onClick={() => fetchProductsQuery.fetchNextPage()}
|
|
737
|
+
disabled={!fetchProductsQuery.hasNextPage || fetchProductsQuery.isFetchingNextPage}
|
|
738
|
+
>
|
|
739
|
+
{fetchProductsQuery.isFetchingNextPage ? (
|
|
740
|
+
<CircularProgress color="#000" width="20px" height="20px" duration="1s" />
|
|
741
|
+
) : fetchProductsQuery.hasNextPage ? (
|
|
742
|
+
'Load more'
|
|
743
|
+
) : (
|
|
744
|
+
<CircularProgress color="#000" width="20px" height="20px" duration="1s" />
|
|
745
|
+
)}
|
|
746
|
+
</button>
|
|
747
|
+
</div>
|
|
748
|
+
)}
|
|
749
|
+
</div>
|
|
750
|
+
)}
|
|
751
|
+
</div>
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
})}
|
|
756
|
+
</div>
|
|
757
|
+
)}
|
|
758
|
+
</div>
|
|
759
|
+
);
|
|
760
|
+
};
|
|
761
|
+
return (
|
|
762
|
+
<div
|
|
763
|
+
class={
|
|
764
|
+
sectionproperties.card_marginLeft != 0 && sectionproperties.card_marginRight != 0
|
|
765
|
+
? // mb-md-4
|
|
766
|
+
' row m-0 d-flex w-100 justify-content-center pl-md-2 pr-md-2 '
|
|
767
|
+
: sectionproperties.card_marginRight != 0
|
|
768
|
+
? ' row m-0 d-flex w-100 justify-content-center pr-md-2 '
|
|
769
|
+
: sectionproperties.card_marginLeft != 0
|
|
770
|
+
? ' row m-0 d-flex w-100 justify-content-center pl-md-2 '
|
|
771
|
+
: ' row m-0 d-flex w-100 justify-content-center '
|
|
772
|
+
}
|
|
773
|
+
style={{
|
|
774
|
+
zIndex: 2,
|
|
775
|
+
paddingLeft: langdetect == 'en' ? sectionproperties.card_marginLeft + 'px' : sectionproperties.card_marginRight + 'px',
|
|
776
|
+
paddingRight: langdetect == 'en' ? sectionproperties.card_marginRight + 'px' : sectionproperties.card_marginLeft + 'px',
|
|
777
|
+
}}
|
|
778
|
+
>
|
|
779
|
+
{sectionproperties.length != 0 && (
|
|
780
|
+
<div className={' row ml-0 mr-0 d-flex justify-content-center w-md-100 h-md-100 w-100 '}>
|
|
781
|
+
{sectionproperties.showFilter == 'show' && (
|
|
782
|
+
<div className={sectionproperties.filterdirection == 'Horizontal' ? ' col-lg-12 ' : 'col-lg-3'}>
|
|
783
|
+
<Filter sectionpropertiesprops={sectionproperties} actions={actions} />
|
|
784
|
+
</div>
|
|
785
|
+
)}
|
|
786
|
+
{fetchingtype == 'custom' && <>{cardsrender()}</>}
|
|
787
|
+
{fetchingtype != 'custom' && cardsrender()}
|
|
788
|
+
</div>
|
|
789
|
+
)}
|
|
790
|
+
</div>
|
|
791
|
+
);
|
|
792
|
+
};
|
|
793
|
+
export default CardsSection;
|