tabexseriescomponents 0.0.80 → 0.0.82
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 +41 -13
- package/dist/index.esm.js +41 -13
- package/dist/index.umd.js +41 -13
- package/package.json +1 -1
- package/componentssrc.rar +0 -0
- package/srcOLD/Contexts/LanguageContext.jsx +0 -347
- package/srcOLD/Contexts/ProductsCardsSectionContext.jsx +0 -28
- package/srcOLD/StylesJS/Customstyles.js +0 -235
- package/srcOLD/TabexComponents/Cards/CategoryCardwithhoveraction/CategoryCardwithhoveraction.jsx +0 -214
- package/srcOLD/TabexComponents/Cards/Categorycard_fullimage/Categorycard_fullimage.jsx +0 -258
- package/srcOLD/TabexComponents/Cards/Categorycard_slidebgscaled/Categorycard_slidebgscaled.jsx +0 -206
- package/srcOLD/TabexComponents/Cards/Categorycard_with_trianglebg/Categorycard_with_trianglebg.jsx +0 -176
- package/srcOLD/TabexComponents/Cards/Categorycard_with_twolinestransition/Categorycard_with_twolinestransition.jsx +0 -207
- package/srcOLD/TabexComponents/Cards/Categorycard_withshapes/Categorycard_withshapes.jsx +0 -162
- package/srcOLD/TabexComponents/Cards/Categorycard_withtext/Categorycard_withtext.jsx +0 -193
- package/srcOLD/TabexComponents/Cards/Classiccategorycard/Classiccategorycard.jsx +0 -158
- package/srcOLD/TabexComponents/Cards/Horizontalcard/Horizontalcard.jsx +0 -286
- package/srcOLD/TabexComponents/Cards/MenuCard/MenuCard.jsx +0 -558
- package/srcOLD/TabexComponents/Cards/ModernProductCard/ModernProductCard.jsx +0 -486
- package/srcOLD/TabexComponents/Cards/Productcard6/Productcard6.jsx +0 -300
- package/srcOLD/TabexComponents/Cards/Productcard7/Productcard7.jsx +0 -288
- package/srcOLD/TabexComponents/Cards/Productcard_animatedbuttons/Productcard_animatedbuttons.jsx +0 -307
- package/srcOLD/TabexComponents/Cards/Productcard_with_circularbg/Productcard_with_circularbg.jsx +0 -295
- package/srcOLD/TabexComponents/Cards/Productcard_with_circularhover/Productcard_with_circularhover.jsx +0 -325
- package/srcOLD/TabexComponents/Cards/Productcard_with_slideanimation/Productcard_with_slideanimation.jsx +0 -290
- package/srcOLD/TabexComponents/Cards/Productcard_with_variants/Productcard_with_variants.jsx +0 -303
- package/srcOLD/TabexComponents/Cards/Productcard_with_zoominonhover/Productcard_with_zoominonhover.jsx +0 -466
- package/srcOLD/TabexComponents/Cards/Productcarddefault/Productcarddefault.jsx +0 -282
- package/srcOLD/TabexComponents/Cards/Productccard_with_imageontopleft/Productccard_with_imageontopleft.jsx +0 -298
- package/srcOLD/TabexComponents/Cards/Prouductcard_with_zoomhover/Prouductcard_with_zoomhover.jsx +0 -139
- package/srcOLD/TabexComponents/Cards/Simplecategorycardwithtextbelow/Simplecategorycardwithtextbelow.jsx +0 -135
- package/srcOLD/TabexComponents/Cards/Simpleproductcard/Simpleproductcard.jsx +0 -304
- package/srcOLD/TabexComponents/Cards/StylishProductCard/StylishProductCard.jsx +0 -291
- package/srcOLD/TabexComponents/Footer/Footer1/Footer1.jsx +0 -418
- package/srcOLD/TabexComponents/Footer/Footer2/Footer2.jsx +0 -382
- package/srcOLD/TabexComponents/Footer/Footer3/Footer3.jsx +0 -308
- package/srcOLD/TabexComponents/Footer/Footer4/Footer4.jsx +0 -438
- package/srcOLD/TabexComponents/Footer/Footer5/Footer5.jsx +0 -495
- package/srcOLD/TabexComponents/Footer/Footer6/Footer6.jsx +0 -295
- package/srcOLD/TabexComponents/Footer/Footer7/Footer7.jsx +0 -373
- package/srcOLD/TabexComponents/Footer/Simplefooter/Simplefooter.jsx +0 -238
- package/srcOLD/TabexComponents/Generalfiles/images/egyptflag.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/noimage.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/payment/cod.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/payment/fawry.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/payment/payment.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/payment/paymob.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/payment/paypal.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/payment/visa.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/shoppingcart.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/tabexlogo.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/unknownmaleuser.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/usflag.png +0 -0
- package/srcOLD/TabexComponents/Generalfiles/images/whatsapp.png +0 -0
- package/srcOLD/TabexComponents/Headers/AllinoneHeader/AllinoneHeader.jsx +0 -724
- package/srcOLD/TabexComponents/Headers/ClassicHeader/ClassicHeader.jsx +0 -687
- package/srcOLD/TabexComponents/Headers/Header4/Header4.jsx +0 -632
- package/srcOLD/TabexComponents/Headers/Header6/Header6.jsx +0 -669
- package/srcOLD/TabexComponents/Headers/Header8/Header8.jsx +0 -882
- package/srcOLD/TabexComponents/Headers/HeaderRestaurant/HeaderRestaurant.jsx +0 -754
- package/srcOLD/TabexComponents/Headers/Header_threesectionslogocentered/Header_threesectionslogocentered.jsx +0 -798
- package/srcOLD/TabexComponents/Headers/Headerresponsive/Headerresponsive.jsx +0 -686
- package/srcOLD/TabexComponents/Headers/HeaderwithContactinfo/HeaderwithContactinfo.jsx +0 -938
- package/srcOLD/TabexComponents/Headers/Modernheader/Modernheader.jsx +0 -706
- package/srcOLD/TabexComponents/Headers/StylishHeader/StylishHeader.jsx +0 -821
- package/srcOLD/TabexComponents/Headers/Subheader/Subheader copy.jsx +0 -228
- package/srcOLD/TabexComponents/Headers/Subheader/Subheader.jsx +0 -251
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Backgroundimage1/Backgroundimage1.jsx +0 -312
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Backgroundimage_with_toppill/Backgroundimage_with_toppill.jsx +0 -278
- package/srcOLD/TabexComponents/Sections/BackgroundImages/BackgroundimageandTextsection/BackgroundimageandTextsection.jsx +0 -138
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Section_with_rightbgcont/Section_with_rightbgcont.jsx +0 -160
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Threebgimages/Threebgimages.jsx +0 -295
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Twobgimages/Twobgimages.jsx +0 -784
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection/CardsSection.jsx +0 -861
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection2/CardsSection2.js +0 -496
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection7/CardsSection7.js +0 -888
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection8/CardsSection8.js +0 -419
- package/srcOLD/TabexComponents/Sections/Cards/Sixverticalcardssection/Sixverticalcardssection.js +0 -552
- package/srcOLD/TabexComponents/Sections/Slideshow/AboutSection/AboutSection.jsx +0 -281
- package/srcOLD/TabexComponents/Sections/Slideshow/Backgroundimage_with_topcircle/Backgroundimage_with_topcircle.jsx +0 -166
- package/srcOLD/TabexComponents/Sections/Slideshow/Freetextsection/Freetextsection.jsx +0 -152
- package/srcOLD/TabexComponents/Sections/Slideshow/Image_with_leftwords/Image_with_leftwords.jsx +0 -284
- package/srcOLD/TabexComponents/Sections/Slideshow/Image_with_rightwords/Image_with_rightwords.jsx +0 -146
- package/srcOLD/TabexComponents/Sections/Slideshow/Servicesection/Servicesection.jsx +0 -209
- package/srcOLD/TabexComponents/Sections/Slideshow/ServicesectionCenteredcards/ServicesectionCenteredcards.jsx +0 -145
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshow_with_rotatedsquare/Slideshow_with_rotatedsquare.jsx +0 -252
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshow_with_squarebg/Slideshow_with_squarebg.jsx +0 -175
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowdifferentanimations/Slideshowdifferentanimations.jsx +0 -154
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowfade/Slideshowfade.jsx +0 -201
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowslide/Slideshowslide.jsx +0 -414
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowzoom/Slideshowzoom.jsx +0 -270
- package/srcOLD/TabexComponents/StaticPages/Aboutus/Aboutus.js +0 -175
- package/srcOLD/TabexComponents/StaticPages/AccountInformation/AccountInformation.jsx +0 -275
- package/srcOLD/TabexComponents/StaticPages/CartSlider/CartSlider.jsx +0 -459
- package/srcOLD/TabexComponents/StaticPages/Categoriesdropdown/Categoriesdropdown.js +0 -146
- package/srcOLD/TabexComponents/StaticPages/Checkout/Checkout.jsx +0 -1220
- package/srcOLD/TabexComponents/StaticPages/Filter/Filter.jsx +0 -542
- package/srcOLD/TabexComponents/StaticPages/Login/FacebookLoginButton.jsx +0 -51
- package/srcOLD/TabexComponents/StaticPages/Login/GoogleLoginButton.jsx +0 -35
- package/srcOLD/TabexComponents/StaticPages/Login/Login.jsx +0 -299
- package/srcOLD/TabexComponents/StaticPages/OrderSuccess/OrderSuccess.js +0 -192
- package/srcOLD/TabexComponents/StaticPages/Ordershistory/Ordershistory.jsx +0 -1285
- package/srcOLD/TabexComponents/StaticPages/Policies/Policies.jsx +0 -358
- package/srcOLD/TabexComponents/StaticPages/Productinfo/Productinfo.jsx +0 -1506
- package/srcOLD/TabexComponents/StaticPages/Searchlist/Searchlist.jsx +0 -225
- package/srcOLD/TabexComponents/StaticPages/Signup/CustomerInformationForm.jsx +0 -788
- package/srcOLD/TabexComponents/StaticPages/Signup/Signup.jsx +0 -157
- package/srcOLD/TabexComponents/StaticPages/Staticpagesrouter/Staticpagesrouter.jsx +0 -295
- package/srcOLD/TabexComponents/StaticPages/Viewcart/Viewcart.js +0 -1090
- package/srcOLD/TabexComponents/StaticPages/Wishlist/Wishlist.jsx +0 -629
- package/srcOLD/assets/images/cod.png +0 -0
- package/srcOLD/assets/images/egyptflag.png +0 -0
- package/srcOLD/assets/images/fawry.png +0 -0
- package/srcOLD/assets/images/payment.png +0 -0
- package/srcOLD/assets/images/paymob.png +0 -0
- package/srcOLD/assets/images/paypal.png +0 -0
- package/srcOLD/assets/images/shoppingcart.png +0 -0
- package/srcOLD/assets/images/usflag.png +0 -0
- package/srcOLD/assets/images/visa.png +0 -0
- package/srcOLD/assets/images/whatsapp.png +0 -0
- package/srcOLD/button.jsx +0 -40
- package/srcOLD/index.jsx +0 -175
- package/srcOLD/styles/Home.module.css +0 -129
- package/srcOLD/styles/cards/Categorcycard_fullimage.module.css +0 -10
- package/srcOLD/styles/cards/Categorycard_slidebgscaled.module.css +0 -73
- package/srcOLD/styles/cards/Categorycard_withshapes.module.css +0 -189
- package/srcOLD/styles/cards/Productcard6.module.css +0 -9
- package/srcOLD/styles/cards/Productcard_with_circularbg.module.css +0 -137
- package/srcOLD/styles/cards/Productccard_with_zoominonhover.module.css +0 -51
- package/srcOLD/styles/cards/Prouductcard_with_zoomhover.module.css +0 -61
- package/srcOLD/styles/cards/categorycard.module.css +0 -102
- package/srcOLD/styles/cards/categorycard3.module.css +0 -51
- package/srcOLD/styles/cards/categorycardwithtext.module.css +0 -40
- package/srcOLD/styles/cards/productcard_animatedbuttons.module.css +0 -104
- package/srcOLD/styles/cards/productcard_with_textonhover.module.css +0 -12
- package/srcOLD/styles/cards/productccard_with_imageontopleft.module.css +0 -85
- package/srcOLD/styles/general/bootstrap.css +0 -4420
- package/srcOLD/styles/general/dropdown.css +0 -199
- package/srcOLD/styles/general/editorbardropdown.module.css +0 -94
- package/srcOLD/styles/general/filter.module.css +0 -108
- package/srcOLD/styles/general/form.module.css +0 -273
- package/srcOLD/styles/general/general.module.css +0 -709
- package/srcOLD/styles/general/image-gallery.css +0 -481
- package/srcOLD/styles/general/react-accessible-accordion.module.css +0 -52
- package/srcOLD/styles/general/react-phone-input-2.module.css +0 -927
- package/srcOLD/styles/general/scrollbtn.module.css +0 -22
- package/srcOLD/styles/general/slick.module.css +0 -166
- package/srcOLD/styles/general/tabs.module.css +0 -110
- package/srcOLD/styles/general/workplaceeditor.module.css +0 -328
- package/srcOLD/styles/globals.css +0 -26
- package/srcOLD/styles/headers/Allinoneheader.module.css +0 -91
- package/srcOLD/styles/headers/Header7.module.css +0 -50
- package/srcOLD/styles/headers/Header_threesectionslogocentered.module.css +0 -97
- package/srcOLD/styles/headers/Sideheader.module.css +0 -108
- package/srcOLD/styles/headers/classicheaderstyles.module.css +0 -16
- package/srcOLD/styles/headers/dropdown.css +0 -0
- package/srcOLD/styles/headers/header4.module.css +0 -175
- package/srcOLD/styles/headers/header5.module.css +0 -30
- package/srcOLD/styles/headers/header6.module.css +0 -117
- package/srcOLD/styles/headers/header_contactinfo.module.css +0 -78
- package/srcOLD/styles/headers/headerresturant.module.css +0 -89
- package/srcOLD/styles/headers/headerstyles.module.css +0 -24
- package/srcOLD/styles/headers/modernheader.module.css +0 -78
- package/srcOLD/styles/headers/subheader.module.css +0 -114
- package/srcOLD/styles/sections/Backgroundimage1.module.css +0 -17
- package/srcOLD/styles/sections/Backgroundimage_with_topcircle.module.css +0 -28
- package/srcOLD/styles/sections/Section_with_rightbgcont.module.css +0 -49
- package/srcOLD/styles/sections/Slideshow_with_rotatedsquare.module.css +0 -35
- package/srcOLD/styles/sections/Slideshow_with_squarebg.module.css +0 -39
- package/srcOLD/styles/staticpages/accordion.module.css +0 -9
- package/srcOLD/styles/staticpages/cart.module.css +0 -108
- package/srcOLD/styles/staticpages/dropdown.css +0 -196
- package/srcOLD/styles/staticpages/filter.module.css +0 -139
- package/srcOLD/styles/staticpages/login.module.css +0 -146
- package/srcOLD/styles/staticpages/productinfo.module.css +0 -54
- package/srcOLD/styles/staticpages/shop.module.css +0 -191
- package/srcOLD/styles/staticpages/signup.module.css +0 -206
- package/srcOLD/styles/staticpages/staticroutersidenav.module.css +0 -129
- package/srcOLD/styles/staticpages/viewcart.module.css +0 -129
- package/srcOLD/styles/staticpages/wishlist.module.css +0 -29
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
// All take sectionidprops & sectionindexprops
|
|
2
|
-
import React, { useEffect, useState, useContext } from 'react';
|
|
3
|
-
import { serverbaselink, instapikey } from '../../../../../../../../Env_Variables_Server';
|
|
4
|
-
|
|
5
|
-
import { WebsiteDesignWorkPlaceContext } from '../../../../../../../../Contexts/WebsiteDesignWorkPlaceContext';
|
|
6
|
-
import { TemplateRoutingContext } from '../../../../../../../../Contexts/TemplateRoutingContext';
|
|
7
|
-
import { LanguageContext } from '../../../../../../../../Contexts/LanguageContext';
|
|
8
|
-
import { FetchingContext } from '../../../../../../../../Contexts/FetchingContext';
|
|
9
|
-
import { css } from 'glamor';
|
|
10
|
-
import { ProductsCardsSectionContext } from '../../../../../../../../Contexts/ProductsCardsSectionContext';
|
|
11
|
-
import { useQueryClient, useMutation, useInfiniteQuery } from 'react-query';
|
|
12
|
-
import { useInView } from 'react-intersection-observer';
|
|
13
|
-
import { BsArrowRightShort } from 'react-icons/bs';
|
|
14
|
-
import axios from 'axios';
|
|
15
|
-
|
|
16
|
-
const CardsSection8 = (props) => {
|
|
17
|
-
const { ref, inView } = useInView();
|
|
18
|
-
const { lang, langdetect } = useContext(LanguageContext);
|
|
19
|
-
const queryClient = useQueryClient();
|
|
20
|
-
const { fetch_inst_tabex_websitetemplatesQueryContext, sectionindexcontext, pageindexcontext, TabexSectionsComponentsContext, StatePagePropertiesContext } =
|
|
21
|
-
useContext(WebsiteDesignWorkPlaceContext);
|
|
22
|
-
const { fetchcollectionsQueryContext, FetchQueriesEngineContext, setFetchQueriesEngineContext, SearchHeaderMutationContext, favoriteprojectscountContext } = useContext(FetchingContext);
|
|
23
|
-
const { ProductFilterObjContext, setProductFilterObjContext } = useContext(ProductsCardsSectionContext);
|
|
24
|
-
const { routingcountext, StaticPagesLinksContext } = useContext(TemplateRoutingContext);
|
|
25
|
-
const [sectionproperties, setsectionproperties] = useState('');
|
|
26
|
-
const [imagesarray, setimagesarray] = useState([]);
|
|
27
|
-
const [cardsarray, setcardsarray] = useState([]);
|
|
28
|
-
const [fetchingtype, setfetchingtype] = useState('');
|
|
29
|
-
const [searchinput, setsearchinput] = useState('');
|
|
30
|
-
const [cards, setscards] = useState([{}, {}, {}]);
|
|
31
|
-
|
|
32
|
-
const FetchProductsAxios = (axiosdatatemp) => {
|
|
33
|
-
var tempProductFilterObjContext = { ...ProductFilterObjContext };
|
|
34
|
-
tempProductFilterObjContext.page = axiosdatatemp;
|
|
35
|
-
// setProductFilterObjContext({ ...tempProductFilterObjContext });
|
|
36
|
-
if (fetch_inst_tabex_websitetemplatesQueryContext.data.data.template.instid == 'tabex') {
|
|
37
|
-
tempProductFilterObjContext.instapikey = 'tabex';
|
|
38
|
-
} else {
|
|
39
|
-
tempProductFilterObjContext.instapikey = instapikey();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var serverbaselinktemp = window.location.hostname;
|
|
43
|
-
if (serverbaselinktemp == 'localhost') {
|
|
44
|
-
serverbaselinktemp = 'https://tabex-co.com';
|
|
45
|
-
} else {
|
|
46
|
-
serverbaselinktemp = 'https://' + serverbaselinktemp;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const axiosfetch = axios({
|
|
50
|
-
method: 'post',
|
|
51
|
-
url: serverbaselinktemp + '/customer/webapp/fetchproducts',
|
|
52
|
-
headers: {
|
|
53
|
-
Accept: 'application/json',
|
|
54
|
-
'Content-Type': 'application/json',
|
|
55
|
-
},
|
|
56
|
-
data: tempProductFilterObjContext,
|
|
57
|
-
});
|
|
58
|
-
return axiosfetch;
|
|
59
|
-
};
|
|
60
|
-
const fetchProductsQuery = useInfiniteQuery(['fetchproducts_API' + JSON.stringify(ProductFilterObjContext)], ({ pageParam = 0 }) => FetchProductsAxios(pageParam), {
|
|
61
|
-
keepPreviousData: true,
|
|
62
|
-
staleTime: Infinity,
|
|
63
|
-
enabled:
|
|
64
|
-
instapikey().length != 0 && fetchingtype == 'products' && ProductFilterObjContext.ProductFetchingType != undefined && ProductFilterObjContext.ProductFetchingType.length != 0
|
|
65
|
-
? true
|
|
66
|
-
: false,
|
|
67
|
-
initialPageParam: 0,
|
|
68
|
-
getNextPageParam: (lastPage, allPages) => {
|
|
69
|
-
var currentpagefrombackend = lastPage.data.page;
|
|
70
|
-
|
|
71
|
-
if (currentpagefrombackend == 'full') {
|
|
72
|
-
return undefined;
|
|
73
|
-
} else {
|
|
74
|
-
var nextpage = parseInt(currentpagefrombackend) + 1;
|
|
75
|
-
return nextpage;
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
getPreviousPageParam: (firstPage, allPages) => firstPage.data.page - 1,
|
|
80
|
-
});
|
|
81
|
-
React.useEffect(() => {
|
|
82
|
-
if (inView) {
|
|
83
|
-
fetchProductsQuery.fetchNextPage();
|
|
84
|
-
}
|
|
85
|
-
}, [inView]);
|
|
86
|
-
const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '' });
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
|
|
89
|
-
if (sectionitem.sectionid == props.sectionidprops) {
|
|
90
|
-
var secpropobj = {};
|
|
91
|
-
sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
|
|
92
|
-
secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
|
|
93
|
-
});
|
|
94
|
-
setsectionproperties({ ...secpropobj });
|
|
95
|
-
|
|
96
|
-
if (props.srcfromprops == 'GeneralProductsComponent') {
|
|
97
|
-
setfetchingtype('products');
|
|
98
|
-
setProductsFetchingTypeSectionObj({
|
|
99
|
-
productfetchingtype: 'Random',
|
|
100
|
-
collectionid: props.collectionidprops,
|
|
101
|
-
});
|
|
102
|
-
} else {
|
|
103
|
-
setfetchingtype(sectionitem.fetchingtype);
|
|
104
|
-
setProductsFetchingTypeSectionObj({
|
|
105
|
-
productfetchingtype: sectionitem.productsfetchingtype,
|
|
106
|
-
collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}, [StatePagePropertiesContext]);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
SearchHeaderMutationContext.reset();
|
|
114
|
-
const delayDebounceFn = setTimeout(() => {
|
|
115
|
-
if (searchinput.length != 0) {
|
|
116
|
-
SearchHeaderMutationContext.mutate({
|
|
117
|
-
SearchHeaderValue: searchinput,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}, 1000);
|
|
121
|
-
|
|
122
|
-
return () => clearTimeout(delayDebounceFn);
|
|
123
|
-
}, [searchinput]);
|
|
124
|
-
useEffect(() => {
|
|
125
|
-
if (sectionproperties.length != 0) {
|
|
126
|
-
if (cardsarray.length == 0) {
|
|
127
|
-
if (fetchingtype == 'collections') {
|
|
128
|
-
if (fetchcollectionsQueryContext.isSuccess) {
|
|
129
|
-
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
130
|
-
}
|
|
131
|
-
} else if (fetchingtype == 'products') {
|
|
132
|
-
if (fetchProductsQuery.isSuccess) {
|
|
133
|
-
var allpagesarr = [];
|
|
134
|
-
fetchProductsQuery.data.pages.forEach((page) => {
|
|
135
|
-
page.data.products.forEach((productobj) => {
|
|
136
|
-
allpagesarr.push(productobj);
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
cardobjassigner(allpagesarr);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}, [sectionproperties]);
|
|
145
|
-
useEffect(() => {
|
|
146
|
-
if (fetchingtype.length != 0) {
|
|
147
|
-
var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
|
|
148
|
-
|
|
149
|
-
if (fetchingtype == 'collections') {
|
|
150
|
-
tempFetchQueriesEngineContext.collections = true;
|
|
151
|
-
}
|
|
152
|
-
if (fetchingtype == 'products') {
|
|
153
|
-
var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
|
|
154
|
-
tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
|
|
155
|
-
tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
|
|
156
|
-
|
|
157
|
-
setProductFilterObjContext({ ...tempfetchproductsfilerobjcontext });
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
setFetchQueriesEngineContext({ ...tempFetchQueriesEngineContext });
|
|
161
|
-
}
|
|
162
|
-
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
163
|
-
useEffect(() => {
|
|
164
|
-
if (fetchingtype == 'products') {
|
|
165
|
-
if (fetchProductsQuery.isSuccess) {
|
|
166
|
-
var allpagesarr = [];
|
|
167
|
-
fetchProductsQuery.data.pages.forEach((page) => {
|
|
168
|
-
page.data.products.forEach((productobj) => {
|
|
169
|
-
allpagesarr.push(productobj);
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
cardobjassigner(allpagesarr);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data]);
|
|
176
|
-
useEffect(() => {
|
|
177
|
-
if (fetchingtype == 'collections') {
|
|
178
|
-
if (fetchcollectionsQueryContext.isSuccess) {
|
|
179
|
-
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}, [fetchcollectionsQueryContext.isSuccess]);
|
|
183
|
-
useEffect(() => {
|
|
184
|
-
favassigner();
|
|
185
|
-
}, [favoriteprojectscountContext]);
|
|
186
|
-
const favassigner = () => {
|
|
187
|
-
if (fetchingtype == 'products') {
|
|
188
|
-
if (cardsarray.length != 0) {
|
|
189
|
-
if (favoriteprojectscountContext != undefined && Array.isArray(favoriteprojectscountContext)) {
|
|
190
|
-
var tempcardsarray = [...cardsarray];
|
|
191
|
-
tempcardsarray.forEach(function (arrayItem, arrayindex) {
|
|
192
|
-
arrayItem.IsFavExists = false;
|
|
193
|
-
});
|
|
194
|
-
tempcardsarray.forEach(function (arrayItem, arrayindex) {
|
|
195
|
-
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
196
|
-
if (arrayItem.productid == favitem) {
|
|
197
|
-
arrayItem.IsFavExists = true;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
setcardsarray([...tempcardsarray]);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
const cardobjassigner = (fetchedarray) => {
|
|
207
|
-
var temparray = [];
|
|
208
|
-
fetchedarray.forEach(function (arrayItem, arrayindex) {
|
|
209
|
-
var cardobj = {
|
|
210
|
-
name: '',
|
|
211
|
-
image: '',
|
|
212
|
-
};
|
|
213
|
-
if (fetchingtype == 'products') {
|
|
214
|
-
if (langdetect == 'en') {
|
|
215
|
-
cardobj.name = arrayItem.productinfo.name_en;
|
|
216
|
-
} else {
|
|
217
|
-
cardobj.name = arrayItem.productinfo.name_ar;
|
|
218
|
-
}
|
|
219
|
-
cardobj.image = arrayItem.productinfo.productmainimage;
|
|
220
|
-
cardobj.productid = arrayItem.productinfo.productid;
|
|
221
|
-
cardobj.description_en = arrayItem.productinfo.description_en;
|
|
222
|
-
cardobj.description_ar = arrayItem.productinfo.description_ar;
|
|
223
|
-
cardobj.defaultprice = arrayItem.productinfo.defaultprice;
|
|
224
|
-
cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
|
|
225
|
-
cardobj.productimages = arrayItem.productinfo.productimages;
|
|
226
|
-
cardobj.timestamp = arrayItem.productinfo.timestamp;
|
|
227
|
-
|
|
228
|
-
if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
|
|
229
|
-
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
230
|
-
if (arrayItem.productinfo.productid == favitem) {
|
|
231
|
-
cardobj.IsFavExists = true;
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
} else if (fetchingtype == 'collections') {
|
|
236
|
-
cardobj.collectionid = arrayItem.collectionid;
|
|
237
|
-
if (langdetect == 'en') {
|
|
238
|
-
cardobj.name = arrayItem.title_en;
|
|
239
|
-
} else if (langdetect == 'ar') {
|
|
240
|
-
cardobj.name = arrayItem.title_ar;
|
|
241
|
-
}
|
|
242
|
-
cardobj.image = arrayItem.collectionlogo;
|
|
243
|
-
} else if (fetchingtype == 'custom') {
|
|
244
|
-
}
|
|
245
|
-
temparray.push(cardobj);
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
setcardsarray([...temparray]);
|
|
249
|
-
};
|
|
250
|
-
const section_cssstyles = {
|
|
251
|
-
sectiontitlespan: css({
|
|
252
|
-
':after': {
|
|
253
|
-
width: sectionproperties.sectitle_lineafterwidth + '%',
|
|
254
|
-
backgroundColor: sectionproperties.linebgcolor,
|
|
255
|
-
},
|
|
256
|
-
}),
|
|
257
|
-
productcard: css({
|
|
258
|
-
background: sectionproperties.backgroundColortransparent == 'Transparent' ? 'transparent' : sectionproperties.backgroundColor,
|
|
259
|
-
opacity: sectionproperties.cardbg_opacity,
|
|
260
|
-
borderBottomLeftRadius: sectionproperties.borderBottomLeftRadius + 'px',
|
|
261
|
-
borderBottomRightRadius: sectionproperties.borderBottomRightRadius + 'px',
|
|
262
|
-
borderTopLeftRadius: sectionproperties.borderTopLeftRadius + 'px',
|
|
263
|
-
borderTopRightRadius: sectionproperties.borderTopRightRadius + 'px',
|
|
264
|
-
marginTop: sectionproperties.marginTop + 'px',
|
|
265
|
-
marginBottom: sectionproperties.marginBottom + 'px',
|
|
266
|
-
paddingLeft: sectionproperties.paddingLeft + 'px',
|
|
267
|
-
paddingRight: sectionproperties.paddingRight + 'px',
|
|
268
|
-
paddingTop: sectionproperties.paddingTop + 'px',
|
|
269
|
-
paddingBottom: sectionproperties.paddingBottom + 'px',
|
|
270
|
-
boxShadow: sectionproperties.sectioncardshadow == 'Show' ? '0 0 10px ' + sectionproperties.sectioncardshadowcolor : 'none',
|
|
271
|
-
border: sectionproperties.sectioncardborderwidth + 'px solid ' + sectionproperties.sectioncardbordercolor,
|
|
272
|
-
transition: '.3s',
|
|
273
|
-
color: sectionproperties.prodNameColor,
|
|
274
|
-
':hover': {
|
|
275
|
-
opacity: sectionproperties.bgopacityonhover,
|
|
276
|
-
color: sectionproperties.prodNameColorOnHover,
|
|
277
|
-
},
|
|
278
|
-
}),
|
|
279
|
-
maintitle: css({
|
|
280
|
-
position: 'relative',
|
|
281
|
-
fontSize: sectionproperties.generaltext_fontSize + 'px',
|
|
282
|
-
color: sectionproperties.generaltext_fontColor,
|
|
283
|
-
textTransform: sectionproperties.generaltext_textTransform,
|
|
284
|
-
fontWeight: sectionproperties.generaltext_fontWeight,
|
|
285
|
-
top: sectionproperties.generaltext_topposition + 'px',
|
|
286
|
-
left: sectionproperties.generaltext_position == 'Centered' ? 0 : langdetect == 'en' ? sectionproperties.generaltext_leftposition + 'px' : '',
|
|
287
|
-
right: sectionproperties.generaltext_position == 'Centered' ? 0 : langdetect == 'en' ? '' : sectionproperties.generaltext_leftposition + 'px',
|
|
288
|
-
':after': {
|
|
289
|
-
display: 'block',
|
|
290
|
-
content: 's',
|
|
291
|
-
fontSize: '0',
|
|
292
|
-
width: sectionproperties.generaltext_lineaftertextwidth + 'px',
|
|
293
|
-
height: '7px',
|
|
294
|
-
background: sectionproperties.general_showlineafter == 'Show' ? sectionproperties.generaltext_fontColor : 'transparent',
|
|
295
|
-
position: 'absolute',
|
|
296
|
-
bottom: 0,
|
|
297
|
-
margin: 'auto',
|
|
298
|
-
borderRadius: '10px',
|
|
299
|
-
},
|
|
300
|
-
}),
|
|
301
|
-
maintitle2: css({
|
|
302
|
-
position: 'relative',
|
|
303
|
-
fontSize: sectionproperties.slideshowText2ContentFontSize + 'px',
|
|
304
|
-
color: sectionproperties.slideshowText2ContentColor,
|
|
305
|
-
textTransform: sectionproperties.slideshowText2ContentTextTransform,
|
|
306
|
-
fontWeight: sectionproperties.slideshowText2ContentFontWeight,
|
|
307
|
-
|
|
308
|
-
':after': {
|
|
309
|
-
display: 'block',
|
|
310
|
-
content: 's',
|
|
311
|
-
fontSize: '0',
|
|
312
|
-
width: '100%',
|
|
313
|
-
height: '7px',
|
|
314
|
-
// background: sectionproperties.general_showlineafter == 'Show' ? sectionproperties.generaltext_fontColor : 'transparent',
|
|
315
|
-
position: 'absolute',
|
|
316
|
-
bottom: 0,
|
|
317
|
-
left: 0,
|
|
318
|
-
right: 0,
|
|
319
|
-
margin: 'auto',
|
|
320
|
-
borderRadius: '10px',
|
|
321
|
-
},
|
|
322
|
-
}),
|
|
323
|
-
scrollmenuclassnameitemSimpleproductcard: css({
|
|
324
|
-
minWidth: sectionproperties.card_widthhorizontal + 'px',
|
|
325
|
-
maxWidth: sectionproperties.card_widthhorizontal + 'px',
|
|
326
|
-
}),
|
|
327
|
-
cardbtn: css({
|
|
328
|
-
fontWeight: sectionproperties.generalbtn_fontweight,
|
|
329
|
-
backgroundColor: sectionproperties.generalbtn_bgColortransparent == 'Transparent' ? 'transparent' : sectionproperties.generalbtn_bgColor,
|
|
330
|
-
borderTopLeftRadius: sectionproperties.generalbtn_bordertopleftradius + 'px',
|
|
331
|
-
borderTopRightRadius: sectionproperties.generalbtn_bordertoprightradius + 'px',
|
|
332
|
-
borderBottomLeftRadius: sectionproperties.generalbtn_borderbottomleftradius + 'px',
|
|
333
|
-
borderBottomRightRadius: sectionproperties.generalbtn_borderbottomrightradius + 'px',
|
|
334
|
-
height: '15px',
|
|
335
|
-
width: sectionproperties.generalbtn_width + 'px',
|
|
336
|
-
fontSize: sectionproperties.generalbtn_fontsize + 'px',
|
|
337
|
-
color: sectionproperties.generalbtn_textColor,
|
|
338
|
-
textTransform: sectionproperties.generalbtn_texttransform,
|
|
339
|
-
opacity: sectionproperties.generalbtn_showonhover == 'Show On Hover' ? 0 : 1,
|
|
340
|
-
top: sectionproperties.generalbtn_showonhover == 'Show On Hover' ? '100px' : 0,
|
|
341
|
-
cursor: 'pointer',
|
|
342
|
-
transition: '0.3s',
|
|
343
|
-
zIndex: 1000,
|
|
344
|
-
':hover': {
|
|
345
|
-
backgroundColor: sectionproperties.generalbtn_bgColoronhover,
|
|
346
|
-
color: sectionproperties.generalbtn_textColoronhover,
|
|
347
|
-
top: sectionproperties.generalbtn_showonhover == 'Show On Hover' ? 0 : '100px',
|
|
348
|
-
},
|
|
349
|
-
}),
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
const cardsrender = () => {
|
|
353
|
-
return (
|
|
354
|
-
<div
|
|
355
|
-
className="row m-0 w-100 align-items-center"
|
|
356
|
-
style={{
|
|
357
|
-
height: '100%',
|
|
358
|
-
|
|
359
|
-
paddingTop: '20px',
|
|
360
|
-
}}
|
|
361
|
-
>
|
|
362
|
-
{cards.map((cardinfoitem, index) => {
|
|
363
|
-
return (
|
|
364
|
-
<div className="col-lg-4 mb-sm-3 mb-md-2">
|
|
365
|
-
<div
|
|
366
|
-
className={`${section_cssstyles.productcard}`}
|
|
367
|
-
style={{
|
|
368
|
-
width: '100%',
|
|
369
|
-
height: '250px',
|
|
370
|
-
backgroundImage:
|
|
371
|
-
'url(' +
|
|
372
|
-
'https://images.unsplash.com/photo-1523275335684-37898b6baf30?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8cHJvZHVjdHxlbnwwfHwwfHw%3D&w=1000&q=80' +
|
|
373
|
-
')',
|
|
374
|
-
backgroundPosition: 'center',
|
|
375
|
-
backgroundSize: 'cover',
|
|
376
|
-
backgroundRepeat: 'no-repeat',
|
|
377
|
-
position: 'relative',
|
|
378
|
-
}}
|
|
379
|
-
>
|
|
380
|
-
<div
|
|
381
|
-
style={{
|
|
382
|
-
position: 'absolute',
|
|
383
|
-
top: index == 0 ? '20px' : index == 1 ? '200px' : '20px',
|
|
384
|
-
left: index == 0 ? '20px' : index == 1 ? '55%' : '55%',
|
|
385
|
-
}}
|
|
386
|
-
>
|
|
387
|
-
<p className={`${section_cssstyles.maintitle}` + ' m-0 '}>Lighting collections</p>
|
|
388
|
-
<button className={`${section_cssstyles.cardbtn}` + ' d-flex flex-row align-items-center '}>
|
|
389
|
-
<p className="m-0">{sectionproperties.generalbtn_content}</p>
|
|
390
|
-
<BsArrowRightShort size={15} />
|
|
391
|
-
</button>
|
|
392
|
-
</div>
|
|
393
|
-
</div>
|
|
394
|
-
</div>
|
|
395
|
-
);
|
|
396
|
-
})}
|
|
397
|
-
</div>
|
|
398
|
-
);
|
|
399
|
-
};
|
|
400
|
-
return (
|
|
401
|
-
<div className="row m-0 d-flex w-100 justify-content-center mb-md-4 " style={{ zIndex: 2 }}>
|
|
402
|
-
<div className="col-lg-12 p-0 ">
|
|
403
|
-
{sectionproperties.length != 0 && (
|
|
404
|
-
<div
|
|
405
|
-
className={
|
|
406
|
-
langdetect == 'en'
|
|
407
|
-
? section_cssstyles.cards_sections + ' row ml-0 mr-0 d-flex justify-content-center w-md-100 h-md-100 pr-md-0 '
|
|
408
|
-
: section_cssstyles.cards_sections + ' row ml-0 mr-0 d-flex justify-content-center w-md-100 h-md-100 pl-md-0 '
|
|
409
|
-
}
|
|
410
|
-
>
|
|
411
|
-
{fetchingtype == 'custom' && <>{cardsrender()}</>}
|
|
412
|
-
{fetchingtype != 'custom' && cardsrender()}
|
|
413
|
-
</div>
|
|
414
|
-
)}
|
|
415
|
-
</div>
|
|
416
|
-
</div>
|
|
417
|
-
);
|
|
418
|
-
};
|
|
419
|
-
export default CardsSection8;
|