tabexseriescomponents 0.0.63 → 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.
- package/dist/index.cjs.js +6859 -6478
- package/dist/index.esm.js +6862 -6481
- package/dist/index.umd.js +6862 -6482
- package/package.json +1 -1
- package/srcOLD/Contexts/LanguageContext.jsx +347 -0
- package/srcOLD/Contexts/ProductsCardsSectionContext.jsx +28 -0
- package/srcOLD/StylesJS/Customstyles.js +235 -0
- package/srcOLD/TabexComponents/Cards/CategoryCardwithhoveraction/CategoryCardwithhoveraction.jsx +214 -0
- package/srcOLD/TabexComponents/Cards/Categorycard_fullimage/Categorycard_fullimage.jsx +258 -0
- package/srcOLD/TabexComponents/Cards/Categorycard_slidebgscaled/Categorycard_slidebgscaled.jsx +206 -0
- package/srcOLD/TabexComponents/Cards/Categorycard_with_trianglebg/Categorycard_with_trianglebg.jsx +176 -0
- package/srcOLD/TabexComponents/Cards/Categorycard_with_twolinestransition/Categorycard_with_twolinestransition.jsx +207 -0
- package/srcOLD/TabexComponents/Cards/Categorycard_withshapes/Categorycard_withshapes.jsx +162 -0
- package/srcOLD/TabexComponents/Cards/Categorycard_withtext/Categorycard_withtext.jsx +193 -0
- package/srcOLD/TabexComponents/Cards/Classiccategorycard/Classiccategorycard.jsx +158 -0
- package/srcOLD/TabexComponents/Cards/Horizontalcard/Horizontalcard.jsx +286 -0
- package/srcOLD/TabexComponents/Cards/MenuCard/MenuCard.jsx +558 -0
- package/srcOLD/TabexComponents/Cards/ModernProductCard/ModernProductCard.jsx +486 -0
- package/srcOLD/TabexComponents/Cards/Productcard6/Productcard6.jsx +300 -0
- package/srcOLD/TabexComponents/Cards/Productcard7/Productcard7.jsx +288 -0
- package/srcOLD/TabexComponents/Cards/Productcard_animatedbuttons/Productcard_animatedbuttons.jsx +307 -0
- package/srcOLD/TabexComponents/Cards/Productcard_with_circularbg/Productcard_with_circularbg.jsx +295 -0
- package/srcOLD/TabexComponents/Cards/Productcard_with_circularhover/Productcard_with_circularhover.jsx +325 -0
- package/srcOLD/TabexComponents/Cards/Productcard_with_slideanimation/Productcard_with_slideanimation.jsx +290 -0
- package/srcOLD/TabexComponents/Cards/Productcard_with_variants/Productcard_with_variants.jsx +303 -0
- package/srcOLD/TabexComponents/Cards/Productcard_with_zoominonhover/Productcard_with_zoominonhover.jsx +466 -0
- package/srcOLD/TabexComponents/Cards/Productcarddefault/Productcarddefault.jsx +282 -0
- package/srcOLD/TabexComponents/Cards/Productccard_with_imageontopleft/Productccard_with_imageontopleft.jsx +298 -0
- package/srcOLD/TabexComponents/Cards/Prouductcard_with_zoomhover/Prouductcard_with_zoomhover.jsx +139 -0
- package/srcOLD/TabexComponents/Cards/Simplecategorycardwithtextbelow/Simplecategorycardwithtextbelow.jsx +135 -0
- package/srcOLD/TabexComponents/Cards/Simpleproductcard/Simpleproductcard.jsx +304 -0
- package/srcOLD/TabexComponents/Cards/StylishProductCard/StylishProductCard.jsx +291 -0
- package/srcOLD/TabexComponents/Footer/Footer1/Footer1.jsx +418 -0
- package/srcOLD/TabexComponents/Footer/Footer2/Footer2.jsx +382 -0
- package/srcOLD/TabexComponents/Footer/Footer3/Footer3.jsx +308 -0
- package/srcOLD/TabexComponents/Footer/Footer4/Footer4.jsx +438 -0
- package/srcOLD/TabexComponents/Footer/Footer5/Footer5.jsx +495 -0
- package/srcOLD/TabexComponents/Footer/Footer6/Footer6.jsx +295 -0
- package/srcOLD/TabexComponents/Footer/Footer7/Footer7.jsx +373 -0
- package/srcOLD/TabexComponents/Footer/Simplefooter/Simplefooter.jsx +238 -0
- 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 +724 -0
- package/srcOLD/TabexComponents/Headers/ClassicHeader/ClassicHeader.jsx +687 -0
- package/srcOLD/TabexComponents/Headers/Header4/Header4.jsx +632 -0
- package/srcOLD/TabexComponents/Headers/Header6/Header6.jsx +669 -0
- package/srcOLD/TabexComponents/Headers/Header8/Header8.jsx +882 -0
- package/srcOLD/TabexComponents/Headers/HeaderRestaurant/HeaderRestaurant.jsx +754 -0
- package/srcOLD/TabexComponents/Headers/Header_threesectionslogocentered/Header_threesectionslogocentered.jsx +798 -0
- package/srcOLD/TabexComponents/Headers/Headerresponsive/Headerresponsive.jsx +686 -0
- package/srcOLD/TabexComponents/Headers/HeaderwithContactinfo/HeaderwithContactinfo.jsx +938 -0
- package/srcOLD/TabexComponents/Headers/Modernheader/Modernheader.jsx +706 -0
- package/srcOLD/TabexComponents/Headers/StylishHeader/StylishHeader.jsx +821 -0
- package/srcOLD/TabexComponents/Headers/Subheader/Subheader copy.jsx +228 -0
- package/srcOLD/TabexComponents/Headers/Subheader/Subheader.jsx +251 -0
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Backgroundimage1/Backgroundimage1.jsx +312 -0
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Backgroundimage_with_toppill/Backgroundimage_with_toppill.jsx +278 -0
- package/srcOLD/TabexComponents/Sections/BackgroundImages/BackgroundimageandTextsection/BackgroundimageandTextsection.jsx +138 -0
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Section_with_rightbgcont/Section_with_rightbgcont.jsx +160 -0
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Threebgimages/Threebgimages.jsx +295 -0
- package/srcOLD/TabexComponents/Sections/BackgroundImages/Twobgimages/Twobgimages.jsx +784 -0
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection/CardsSection.jsx +861 -0
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection2/CardsSection2.js +496 -0
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection7/CardsSection7.js +888 -0
- package/srcOLD/TabexComponents/Sections/Cards/CardsSection8/CardsSection8.js +419 -0
- package/srcOLD/TabexComponents/Sections/Cards/Sixverticalcardssection/Sixverticalcardssection.js +552 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/AboutSection/AboutSection.jsx +281 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Backgroundimage_with_topcircle/Backgroundimage_with_topcircle.jsx +166 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Freetextsection/Freetextsection.jsx +152 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Image_with_leftwords/Image_with_leftwords.jsx +284 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Image_with_rightwords/Image_with_rightwords.jsx +146 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Servicesection/Servicesection.jsx +209 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/ServicesectionCenteredcards/ServicesectionCenteredcards.jsx +145 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshow_with_rotatedsquare/Slideshow_with_rotatedsquare.jsx +252 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshow_with_squarebg/Slideshow_with_squarebg.jsx +175 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowdifferentanimations/Slideshowdifferentanimations.jsx +154 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowfade/Slideshowfade.jsx +201 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowslide/Slideshowslide.jsx +414 -0
- package/srcOLD/TabexComponents/Sections/Slideshow/Slideshowzoom/Slideshowzoom.jsx +270 -0
- package/srcOLD/TabexComponents/StaticPages/Aboutus/Aboutus.js +175 -0
- package/srcOLD/TabexComponents/StaticPages/AccountInformation/AccountInformation.jsx +275 -0
- package/srcOLD/TabexComponents/StaticPages/CartSlider/CartSlider.jsx +459 -0
- package/srcOLD/TabexComponents/StaticPages/Categoriesdropdown/Categoriesdropdown.js +146 -0
- package/srcOLD/TabexComponents/StaticPages/Checkout/Checkout.jsx +1220 -0
- package/srcOLD/TabexComponents/StaticPages/Filter/Filter.jsx +542 -0
- package/srcOLD/TabexComponents/StaticPages/Login/FacebookLoginButton.jsx +51 -0
- package/srcOLD/TabexComponents/StaticPages/Login/GoogleLoginButton.jsx +35 -0
- package/srcOLD/TabexComponents/StaticPages/Login/Login.jsx +299 -0
- package/srcOLD/TabexComponents/StaticPages/OrderSuccess/OrderSuccess.js +192 -0
- package/srcOLD/TabexComponents/StaticPages/Ordershistory/Ordershistory.jsx +1285 -0
- package/srcOLD/TabexComponents/StaticPages/Policies/Policies.jsx +358 -0
- package/srcOLD/TabexComponents/StaticPages/Productinfo/Productinfo.jsx +1506 -0
- package/srcOLD/TabexComponents/StaticPages/Searchlist/Searchlist.jsx +225 -0
- package/srcOLD/TabexComponents/StaticPages/Signup/CustomerInformationForm.jsx +788 -0
- package/srcOLD/TabexComponents/StaticPages/Signup/Signup.jsx +157 -0
- package/srcOLD/TabexComponents/StaticPages/Staticpagesrouter/Staticpagesrouter.jsx +295 -0
- package/srcOLD/TabexComponents/StaticPages/Viewcart/Viewcart.js +1090 -0
- package/srcOLD/TabexComponents/StaticPages/Wishlist/Wishlist.jsx +629 -0
- 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 +40 -0
- package/srcOLD/index.jsx +175 -0
- package/srcOLD/styles/Home.module.css +129 -0
- package/srcOLD/styles/cards/Categorcycard_fullimage.module.css +10 -0
- package/srcOLD/styles/cards/Categorycard_slidebgscaled.module.css +73 -0
- package/srcOLD/styles/cards/Categorycard_withshapes.module.css +189 -0
- package/srcOLD/styles/cards/Productcard6.module.css +9 -0
- package/srcOLD/styles/cards/Productcard_with_circularbg.module.css +137 -0
- package/srcOLD/styles/cards/Productccard_with_zoominonhover.module.css +51 -0
- package/srcOLD/styles/cards/Prouductcard_with_zoomhover.module.css +61 -0
- package/srcOLD/styles/cards/categorycard.module.css +102 -0
- package/srcOLD/styles/cards/categorycard3.module.css +51 -0
- package/srcOLD/styles/cards/categorycardwithtext.module.css +40 -0
- package/srcOLD/styles/cards/productcard_animatedbuttons.module.css +104 -0
- package/srcOLD/styles/cards/productcard_with_textonhover.module.css +12 -0
- package/srcOLD/styles/cards/productccard_with_imageontopleft.module.css +85 -0
- package/srcOLD/styles/general/bootstrap.css +4420 -0
- package/srcOLD/styles/general/dropdown.css +199 -0
- package/srcOLD/styles/general/editorbardropdown.module.css +94 -0
- package/srcOLD/styles/general/filter.module.css +108 -0
- package/srcOLD/styles/general/form.module.css +273 -0
- package/srcOLD/styles/general/general.module.css +709 -0
- package/srcOLD/styles/general/image-gallery.css +481 -0
- package/srcOLD/styles/general/react-accessible-accordion.module.css +52 -0
- package/srcOLD/styles/general/react-phone-input-2.module.css +927 -0
- package/srcOLD/styles/general/scrollbtn.module.css +22 -0
- package/srcOLD/styles/general/slick.module.css +166 -0
- package/srcOLD/styles/general/tabs.module.css +110 -0
- package/srcOLD/styles/general/workplaceeditor.module.css +328 -0
- package/srcOLD/styles/globals.css +26 -0
- package/srcOLD/styles/headers/Allinoneheader.module.css +91 -0
- package/srcOLD/styles/headers/Header7.module.css +50 -0
- package/srcOLD/styles/headers/Header_threesectionslogocentered.module.css +97 -0
- package/srcOLD/styles/headers/Sideheader.module.css +108 -0
- package/srcOLD/styles/headers/classicheaderstyles.module.css +16 -0
- package/srcOLD/styles/headers/dropdown.css +0 -0
- package/srcOLD/styles/headers/header4.module.css +175 -0
- package/srcOLD/styles/headers/header5.module.css +30 -0
- package/srcOLD/styles/headers/header6.module.css +117 -0
- package/srcOLD/styles/headers/header_contactinfo.module.css +78 -0
- package/srcOLD/styles/headers/headerresturant.module.css +89 -0
- package/srcOLD/styles/headers/headerstyles.module.css +24 -0
- package/srcOLD/styles/headers/modernheader.module.css +78 -0
- package/srcOLD/styles/headers/subheader.module.css +114 -0
- package/srcOLD/styles/sections/Backgroundimage1.module.css +17 -0
- package/srcOLD/styles/sections/Backgroundimage_with_topcircle.module.css +28 -0
- package/srcOLD/styles/sections/Section_with_rightbgcont.module.css +49 -0
- package/srcOLD/styles/sections/Slideshow_with_rotatedsquare.module.css +35 -0
- package/srcOLD/styles/sections/Slideshow_with_squarebg.module.css +39 -0
- package/srcOLD/styles/staticpages/accordion.module.css +9 -0
- package/srcOLD/styles/staticpages/cart.module.css +108 -0
- package/srcOLD/styles/staticpages/dropdown.css +196 -0
- package/srcOLD/styles/staticpages/filter.module.css +139 -0
- package/srcOLD/styles/staticpages/login.module.css +146 -0
- package/srcOLD/styles/staticpages/productinfo.module.css +54 -0
- package/srcOLD/styles/staticpages/shop.module.css +191 -0
- package/srcOLD/styles/staticpages/signup.module.css +206 -0
- package/srcOLD/styles/staticpages/staticroutersidenav.module.css +129 -0
- package/srcOLD/styles/staticpages/viewcart.module.css +129 -0
- package/srcOLD/styles/staticpages/wishlist.module.css +29 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
2
|
+
import cartstyles from '../../../styles/staticpages/cart.module.css';
|
|
3
|
+
import { IoMdClose } from 'react-icons/io';
|
|
4
|
+
import { HiOutlineTrash } from 'react-icons/hi';
|
|
5
|
+
import { CircularProgress } from 'react-cssfx-loading';
|
|
6
|
+
import { Offcanvas } from 'react-bootstrap';
|
|
7
|
+
|
|
8
|
+
import { css } from 'glamor';
|
|
9
|
+
import { IKImage } from 'imagekitio-react';
|
|
10
|
+
import shoppingcart from '../../../assets/images/shoppingcart.png';
|
|
11
|
+
import { FiShoppingCart } from 'react-icons/fi';
|
|
12
|
+
import { MdOutlineShoppingCart } from 'react-icons/md';
|
|
13
|
+
import { FiShoppingBag } from 'react-icons/fi';
|
|
14
|
+
import { CgShoppingBag } from 'react-icons/cg';
|
|
15
|
+
import { BsBag } from 'react-icons/bs';
|
|
16
|
+
import { IoBagHandleOutline } from 'react-icons/io5';
|
|
17
|
+
import { IKpublicKey, IKurlEndpoint } from '../../../../Env';
|
|
18
|
+
const CartSlider = (props) => {
|
|
19
|
+
const lang = props.actions.lang;
|
|
20
|
+
const langdetect = props.actions.langdetect;
|
|
21
|
+
const templatepropcontext = props.actions.templatepropcontext;
|
|
22
|
+
const routingcountext = props.actions.routingcountext;
|
|
23
|
+
const StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
|
|
24
|
+
const fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
|
|
25
|
+
const AddtoCartMutationContext = props.actions.AddtoCartMutationContext;
|
|
26
|
+
const deletecartitemContext = props.actions.deletecartitemContext;
|
|
27
|
+
const sidecartnavshowcontext = props.actions.sidecartnavshowcontext;
|
|
28
|
+
const setsidecartnavshowcontext = props.actions.setsidecartnavshowcontext;
|
|
29
|
+
const StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
|
|
30
|
+
const CurrentSrcTypeContext = props.actions.CurrentSrcTypeContext;
|
|
31
|
+
const setsidecartnavshowWorkplaceDesigncontext = props.actions.setsidecartnavshowWorkplaceDesigncontext;
|
|
32
|
+
const sidecartnavshowWorkplaceDesigncontext = props.actions.sidecartnavshowWorkplaceDesigncontext;
|
|
33
|
+
const [OpenCloseCartSlider, setOpenCloseCartSlider] = useState(false);
|
|
34
|
+
const [sectionproperties, setsectionproperties] = useState('');
|
|
35
|
+
const [CurrentPageId, setCurrentPageId] = useState('');
|
|
36
|
+
const [fetchingtype, setfetchingtype] = useState('');
|
|
37
|
+
const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '' });
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (CurrentSrcTypeContext == 'workplace') {
|
|
41
|
+
setOpenCloseCartSlider(sidecartnavshowWorkplaceDesigncontext);
|
|
42
|
+
setOpenCloseCartSlider(sidecartnavshowcontext);
|
|
43
|
+
} else {
|
|
44
|
+
setOpenCloseCartSlider(sidecartnavshowcontext);
|
|
45
|
+
}
|
|
46
|
+
// alert(CurrentSrcTypeContext);
|
|
47
|
+
}, [sidecartnavshowcontext, sidecartnavshowWorkplaceDesigncontext]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
var cartindex = templatepropcontext.pagesnprop.findIndex((x) => x.staticpageid == '6218bccb801d0');
|
|
50
|
+
if (cartindex >= 0) {
|
|
51
|
+
setCurrentPageId(cartindex);
|
|
52
|
+
}
|
|
53
|
+
}, [templatepropcontext]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
var secpropobj = {};
|
|
56
|
+
|
|
57
|
+
templatepropcontext?.pagesnprop[CurrentPageId]?.pageproperties?.forEach(function (arrayItem, arrayindex) {
|
|
58
|
+
secpropobj[arrayItem.property_css_name] = arrayItem.property_value;
|
|
59
|
+
});
|
|
60
|
+
setsectionproperties({ ...secpropobj });
|
|
61
|
+
}, [CurrentPageId]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (CurrentSrcTypeContext == 'workplace') {
|
|
64
|
+
if (StatePagePropertiesContext != null && StatePagePropertiesContext != undefined && StatePagePropertiesContext.length != 0) {
|
|
65
|
+
var secpropobj = {};
|
|
66
|
+
StatePagePropertiesContext?.pageobj?.pageproperties?.forEach(function (arrayItem, arrayindex) {
|
|
67
|
+
secpropobj[arrayItem.property_css_name] = arrayItem.property_value;
|
|
68
|
+
});
|
|
69
|
+
setsectionproperties({ ...secpropobj });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, [StatePagePropertiesContext]);
|
|
73
|
+
const cart_cssstyles = {
|
|
74
|
+
productNameStyles: css({
|
|
75
|
+
color: sectionproperties.prodNameColor,
|
|
76
|
+
fontSize: sectionproperties.prodNameFontSize + 'px',
|
|
77
|
+
fontWeight: sectionproperties.texthover_productcard_fontWeight,
|
|
78
|
+
textTransform: sectionproperties.prodNameTextTranform,
|
|
79
|
+
fontWeight: sectionproperties.prodNameFontWeight,
|
|
80
|
+
}),
|
|
81
|
+
productPricestyles: css({
|
|
82
|
+
fontSize: sectionproperties.prodpriceFontSize + 'px',
|
|
83
|
+
fontWeight: sectionproperties.prodPriceFontWeight,
|
|
84
|
+
color: sectionproperties.prodPriceColor,
|
|
85
|
+
}),
|
|
86
|
+
close_menu_icon_cont: css({
|
|
87
|
+
background: sectionproperties.closeSliderBgColor,
|
|
88
|
+
width: sectionproperties.closeSliderWidth + 'px',
|
|
89
|
+
height: sectionproperties.closeSliderHeight + 'px',
|
|
90
|
+
borderRadius: sectionproperties.closeSlider_borderBottomLeftRadius + 'px',
|
|
91
|
+
left: sectionproperties.closeSliderLeft + '%',
|
|
92
|
+
color: sectionproperties.closeSlider_color,
|
|
93
|
+
fontSize: sectionproperties.closeSlider_fontSize + 'px',
|
|
94
|
+
':hover': {
|
|
95
|
+
background: sectionproperties.closeSliderBgColorHover,
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
cart_btn: css({
|
|
99
|
+
width: sectionproperties.cartBtnWidth + 'px',
|
|
100
|
+
height: sectionproperties.cartBtnHeight + 'px',
|
|
101
|
+
background: sectionproperties.cartbtn_bgtransparent == 'Transparent' ? 'transparent' : sectionproperties.cartBtnbgColor,
|
|
102
|
+
borderRadius: sectionproperties.cart_btn_borderBottomLeftRadius + 'px',
|
|
103
|
+
color: sectionproperties.cartBtnTextcolor,
|
|
104
|
+
fontSize: sectionproperties.cartBtnTextfontsize + 'px',
|
|
105
|
+
// fontSize: sectionproperties.cartBtn_iconFontSize + 'px',
|
|
106
|
+
textTransform: sectionproperties.cartBtnTexttransform,
|
|
107
|
+
fontWeight: sectionproperties.cartBtnTextfontweight,
|
|
108
|
+
border: sectionproperties.cartbtnborderwidth + 'px solid ' + sectionproperties.cartbtnbordercolor,
|
|
109
|
+
transition: '.3s',
|
|
110
|
+
':hover': {
|
|
111
|
+
background: sectionproperties.cartbtn_transparentbgcoloronhover == 'Transparent' ? 'transparent' : sectionproperties.cartBtnbgColoronhover,
|
|
112
|
+
color: sectionproperties.cartBtnTextcoloronhover,
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
checkoutbtn: css({
|
|
116
|
+
background: sectionproperties.checkoutBtnbgColortranparent == 'Transparent' ? 'transparent' : sectionproperties.checkoutBtnbgColor,
|
|
117
|
+
width: sectionproperties.checkoutBtnWidth,
|
|
118
|
+
height: sectionproperties.checkoutBtnHeight,
|
|
119
|
+
borderRadius: sectionproperties.checkout_borderBottomLeftRadius + 'px',
|
|
120
|
+
color: sectionproperties.checkoutBtnTextcolor,
|
|
121
|
+
textTransform: sectionproperties.checkoutBtnTexttransform,
|
|
122
|
+
fontWeight: sectionproperties.checkoutBtnTextfontweight,
|
|
123
|
+
fontSize: sectionproperties.checkoutBtnTextfontsize + 'px',
|
|
124
|
+
boxShadow: sectionproperties.checkoutBtn_showshadow == 'Show' ? '0 0 10px ' + sectionproperties.checkoutBtn_shadowcolor : '',
|
|
125
|
+
border: sectionproperties.checkoutBtn_borderwidth + 'px solid ' + sectionproperties.checkoutBtn_bordercolor,
|
|
126
|
+
opacity: sectionproperties.checkoutBtn_opacity,
|
|
127
|
+
transition: '.3s',
|
|
128
|
+
':hover': {
|
|
129
|
+
background: sectionproperties.checkoutBtnbgColoronhover_tranparent == 'Transparent' ? 'transparent' : sectionproperties.checkoutBtnbgColoronhover,
|
|
130
|
+
color: sectionproperties.checkoutBtnTextcoloronhover,
|
|
131
|
+
opacity: sectionproperties.checkoutbtn_opacityonhover,
|
|
132
|
+
},
|
|
133
|
+
}),
|
|
134
|
+
trash_btn: css({
|
|
135
|
+
width: sectionproperties.trashbtn_Width + 'px',
|
|
136
|
+
height: sectionproperties.trashbtn_Height + 'px',
|
|
137
|
+
background: sectionproperties.trashbtn_bgColortransparent == 'Transparent' ? 'transparent' : sectionproperties.trashbtn_bgColor,
|
|
138
|
+
color: sectionproperties.trashbtn_Textcolor,
|
|
139
|
+
borderRadius: sectionproperties.trashbtn_borderBottomLeftRadius + 'px',
|
|
140
|
+
transition: '.3s',
|
|
141
|
+
border: sectionproperties.trashbtn_borderwidth + 'px solid ' + sectionproperties.trashbtn_bordercolor,
|
|
142
|
+
// trashbtn_fontSize
|
|
143
|
+
':hover': {
|
|
144
|
+
background: sectionproperties.trashbtn_bgColoronhover,
|
|
145
|
+
color: sectionproperties.trashbtn_Textcoloronhover,
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
imagecont: css({
|
|
149
|
+
// width: '7vh',
|
|
150
|
+
// height: '7vh',
|
|
151
|
+
// border: '2px solid #e6e6e6',
|
|
152
|
+
width: sectionproperties.prodimage_width + 'px',
|
|
153
|
+
height: sectionproperties.prodimage_height + 'px',
|
|
154
|
+
border: sectionproperties.prodimage_borderwidth + 'px solid ' + sectionproperties.prodimage_color,
|
|
155
|
+
backgroundColor: sectionproperties.prodimage_bgcolor,
|
|
156
|
+
borderBottomLeftRadius: sectionproperties.prodimage__borderBottomLeftRadius + 'px',
|
|
157
|
+
borderBottomRightRadius: sectionproperties.prodimage__borderBottomRightRadius + 'px',
|
|
158
|
+
borderTopLeftRadius: sectionproperties.prodimage__borderTopLeftRadius + 'px',
|
|
159
|
+
borderTopRightRadius: sectionproperties.prodimage__borderTopRightRadius + 'px',
|
|
160
|
+
display: 'flex',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
justifyContent: 'center',
|
|
163
|
+
backgroundRepeat: 'no-repeat',
|
|
164
|
+
backgroundSize: 'cover',
|
|
165
|
+
backgroundPosition: 'center',
|
|
166
|
+
position: 'relative',
|
|
167
|
+
}),
|
|
168
|
+
};
|
|
169
|
+
return (
|
|
170
|
+
<div className="col-lg-12" style={{ zIndex: 2000 }}>
|
|
171
|
+
{sectionproperties.length != 0 && (
|
|
172
|
+
<Offcanvas
|
|
173
|
+
show={OpenCloseCartSlider}
|
|
174
|
+
onHide={() => {
|
|
175
|
+
setOpenCloseCartSlider(false);
|
|
176
|
+
setsidecartnavshowWorkplaceDesigncontext(false);
|
|
177
|
+
setsidecartnavshowcontext(false);
|
|
178
|
+
}}
|
|
179
|
+
placement="end"
|
|
180
|
+
scroll={true}
|
|
181
|
+
style={{
|
|
182
|
+
minWidth: sectionproperties.width + 'px',
|
|
183
|
+
backgroundColor: sectionproperties.backgroundColor,
|
|
184
|
+
height: sectionproperties.height + 'vh',
|
|
185
|
+
borderBottomLeftRadius: sectionproperties.borderBottomLeftRadius + 'px',
|
|
186
|
+
borderBottomRightRadius: sectionproperties.borderBottomRightRadius + 'px',
|
|
187
|
+
borderTopLeftRadius: sectionproperties.borderTopLeftRadius + 'px',
|
|
188
|
+
borderTopRightRadius: sectionproperties.borderTopRightRadius + 'px',
|
|
189
|
+
}}
|
|
190
|
+
backdrop={CurrentSrcTypeContext == 'workplace' ? false : true}
|
|
191
|
+
>
|
|
192
|
+
<Offcanvas.Header>
|
|
193
|
+
<Offcanvas.Title>
|
|
194
|
+
<div className="row m-0 w-100 mt-2">
|
|
195
|
+
<div
|
|
196
|
+
className={' col-lg-12 d-flex align-items-center justify-content-center '}
|
|
197
|
+
style={{
|
|
198
|
+
fontSize: sectionproperties.sectionTitleFontSize + 'px',
|
|
199
|
+
color: sectionproperties.sectionTitleColor,
|
|
200
|
+
marginTop: sectionproperties.sectionTitleMarginTop + 'px',
|
|
201
|
+
marginBottom: sectionproperties.sectionTitleMarginBottom + 'px',
|
|
202
|
+
marginLeft: sectionproperties.sectionTitleMarginLeft + 'px',
|
|
203
|
+
marginRight: sectionproperties.sectionTitleMarginRight + 'px',
|
|
204
|
+
textTransform: sectionproperties.sectionTitleTextTransform,
|
|
205
|
+
fontWeight: sectionproperties.sectionTitleFontWeight,
|
|
206
|
+
// justifyContent: sectionproperties.sectiontitleposition == 'Centered' ? 'center' : '',
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
{langdetect == 'en' ? 'My Cart' : 'حقيبة التسوق'}
|
|
210
|
+
</div>
|
|
211
|
+
<div className="col-lg-12">
|
|
212
|
+
<hr className="mt-2 mb-2" />
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</Offcanvas.Title>
|
|
216
|
+
</Offcanvas.Header>
|
|
217
|
+
<Offcanvas.Body>
|
|
218
|
+
{fetchcustomercartQueryContext?.data?.data?.status && (
|
|
219
|
+
<div className={`${cartstyles.cartslider_container} `}>
|
|
220
|
+
<div
|
|
221
|
+
className={`${cartstyles.close_menu_icon_cont} ${cart_cssstyles.close_menu_icon_cont}`}
|
|
222
|
+
onClick={() => {
|
|
223
|
+
setOpenCloseCartSlider(false);
|
|
224
|
+
setsidecartnavshowWorkplaceDesigncontext(false);
|
|
225
|
+
setsidecartnavshowcontext(false);
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
<i
|
|
229
|
+
className="h-100 d-flex align-items-center justify-content-center"
|
|
230
|
+
style={{ cursor: 'pointer' }}
|
|
231
|
+
onClick={() => {
|
|
232
|
+
setOpenCloseCartSlider(false);
|
|
233
|
+
setsidecartnavshowWorkplaceDesigncontext(false);
|
|
234
|
+
setsidecartnavshowcontext(false);
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
<IoMdClose />
|
|
238
|
+
</i>
|
|
239
|
+
</div>
|
|
240
|
+
<div className="row m-0 w-100 ">
|
|
241
|
+
{AddtoCartMutationContext.isLoading && (
|
|
242
|
+
<div className="col-lg-12 d-flex justify-content-center ">
|
|
243
|
+
<div style={{ backgroundColor: 'white', height: '100vh', zIndex: 99999, width: '100%', position: 'absolute', right: 0, top: 0, opacity: 0.5 }}>
|
|
244
|
+
<div className="m-auto mx-auto">
|
|
245
|
+
<CircularProgress color="black" width="40px" height="40px" duration="1s" />
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
)}
|
|
250
|
+
<div className="col-lg-12 pt-4">
|
|
251
|
+
{fetchcustomercartQueryContext?.data?.data?.customercart != null && (
|
|
252
|
+
<div className="row m-0 w-100">
|
|
253
|
+
{fetchcustomercartQueryContext?.data?.data?.customercart != null && (
|
|
254
|
+
<div className="row m-0 w-100">
|
|
255
|
+
{fetchcustomercartQueryContext?.data?.data?.customercart?.cartitems == 0 && (
|
|
256
|
+
<div className="row m-0 w-100 d-flex align-items-center justify-content-center" style={{ height: '40vh' }}>
|
|
257
|
+
<div className="col-lg-12 d-flex align-items-center justify-content-center text-light flex-column">
|
|
258
|
+
<img src={shoppingcart} style={{ maxWidth: '200px', maxHeight: '200px' }} />
|
|
259
|
+
<p className="font-weight-500" style={{ fontSize: '15px' }}>
|
|
260
|
+
{lang.emptyshoppingcart}
|
|
261
|
+
</p>
|
|
262
|
+
</div>
|
|
263
|
+
<div className="col-lg-12 d-flex align-items-center justify-content-center text-light flex-column">
|
|
264
|
+
<button
|
|
265
|
+
className={` ${cart_cssstyles.cart_btn}` + ' mr-1 ml-1 d-flex align-items-center justify-content-center '}
|
|
266
|
+
onClick={() => {
|
|
267
|
+
if (fetchingtype == 'products') {
|
|
268
|
+
if (ProductsFetchingTypeSectionObj.productfetchingtype == 'Collection') {
|
|
269
|
+
routingcountext(
|
|
270
|
+
StaticPagesLinksContext.GeneralProductsComponent,
|
|
271
|
+
true,
|
|
272
|
+
ProductsFetchingTypeSectionObj.collectionid,
|
|
273
|
+
);
|
|
274
|
+
} else {
|
|
275
|
+
routingcountext(StaticPagesLinksContext.GeneralProductsComponent, false);
|
|
276
|
+
}
|
|
277
|
+
} else {
|
|
278
|
+
routingcountext(StaticPagesLinksContext.GeneralProductsComponent, false);
|
|
279
|
+
}
|
|
280
|
+
}}
|
|
281
|
+
>
|
|
282
|
+
<i className={langdetect == 'en' ? 'h-100 d-flex align-items-center mr-2' : 'h-100 d-flex align-items-center ml-2'}>
|
|
283
|
+
<FiShoppingCart size={sectionproperties.cartBtn_iconFontSize} />
|
|
284
|
+
</i>
|
|
285
|
+
{lang.shopnow}
|
|
286
|
+
</button>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
)}
|
|
290
|
+
{fetchcustomercartQueryContext?.data?.data?.customercart?.cartitems?.map((item, index) => {
|
|
291
|
+
return (
|
|
292
|
+
<div className="col-lg-12 mb-3 p-0">
|
|
293
|
+
<div className="row w-100 m-0">
|
|
294
|
+
<div className={'col-lg-2 col-md-2 col-sm-2 p-0 '}>
|
|
295
|
+
<div className={cart_cssstyles.imagecont}>
|
|
296
|
+
<IKImage
|
|
297
|
+
urlEndpoint={IKurlEndpoint}
|
|
298
|
+
publicKey={IKpublicKey}
|
|
299
|
+
path={
|
|
300
|
+
item.productinfo.hasvariants == 0
|
|
301
|
+
? item.productinfo.productmainimage
|
|
302
|
+
: item.productinfo.variantinfo.variantimageurl
|
|
303
|
+
}
|
|
304
|
+
loading="lazy"
|
|
305
|
+
style={{
|
|
306
|
+
height: '100%',
|
|
307
|
+
width: '100%',
|
|
308
|
+
objectFit: 'cover',
|
|
309
|
+
}}
|
|
310
|
+
/>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
<div className="col-lg-8 col-md-8 col-sm-8 pl-2 pl-sm-3">
|
|
314
|
+
<div className="row m-0 w-100">
|
|
315
|
+
<div className="col-lg-12 col-md-12 col-sm-12 p-0 d-flex">
|
|
316
|
+
<p className={`${cart_cssstyles.productNameStyles}` + ' m-0 p-0 wordbreak d-flex align-items-start '}>
|
|
317
|
+
{langdetect == 'en' ? item.productinfo.name_en : item.productinfo.name_ar}
|
|
318
|
+
</p>
|
|
319
|
+
</div>
|
|
320
|
+
<div className={`${cart_cssstyles.productPricestyles}` + ' col-lg-12 col-md-12 col-sm-12 p-0 d-flex '}>
|
|
321
|
+
{item.quantity} x
|
|
322
|
+
<span className={'ml-1 mr-1 wordbreak'}>
|
|
323
|
+
{/* {item.productinfo.hasvariants == 1 ? item.productinfo.variantinfo.variantsaleprice : item.productinfo.defaultsaleprice}{' '} */}
|
|
324
|
+
|
|
325
|
+
{item.productinfo.hasvariants == 0 && (
|
|
326
|
+
<>
|
|
327
|
+
{item.productinfo.hassale == 1 && (
|
|
328
|
+
<span className="wordbreak">
|
|
329
|
+
{langdetect == 'en' ? 'EGP' : ''} {item.productinfo.defaultsaleprice}{' '}
|
|
330
|
+
{langdetect == 'en' ? '' : 'ج.م'}
|
|
331
|
+
</span>
|
|
332
|
+
)}
|
|
333
|
+
{item.productinfo.hassale == 0 && (
|
|
334
|
+
<span className="wordbreak">
|
|
335
|
+
{langdetect == 'en' ? 'EGP' : ''} {item.productinfo.defaultprice}{' '}
|
|
336
|
+
{langdetect == 'en' ? '' : 'ج.م'}
|
|
337
|
+
</span>
|
|
338
|
+
)}
|
|
339
|
+
</>
|
|
340
|
+
)}
|
|
341
|
+
{item.productinfo.hasvariants == 1 && (
|
|
342
|
+
<>
|
|
343
|
+
{item.productinfo.variantinfo.hassale == 1 && (
|
|
344
|
+
<span className="wordbreak">
|
|
345
|
+
{langdetect == 'en' ? 'EGP' : ''} {item.productinfo.variantinfo.variantsaleprice}{' '}
|
|
346
|
+
{langdetect == 'en' ? '' : 'ج.م'}
|
|
347
|
+
</span>
|
|
348
|
+
)}
|
|
349
|
+
{item.productinfo.variantinfo.hassale == 0 && (
|
|
350
|
+
<span className="wordbreak">
|
|
351
|
+
{langdetect == 'en' ? 'EGP' : ''} {item.productinfo.variantinfo.variantprice}{' '}
|
|
352
|
+
{langdetect == 'en' ? '' : 'ج.م'}
|
|
353
|
+
</span>
|
|
354
|
+
)}
|
|
355
|
+
</>
|
|
356
|
+
)}
|
|
357
|
+
</span>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
<div className="col-lg-2 col-md-2 col-sm-2 p-0 d-flex justify-content-end">
|
|
362
|
+
<button
|
|
363
|
+
className={`${cart_cssstyles.trash_btn}` + ' d-flex align-items-center justify-content-center '}
|
|
364
|
+
style={{}}
|
|
365
|
+
onClick={() => {
|
|
366
|
+
deletecartitemContext(item);
|
|
367
|
+
}}
|
|
368
|
+
>
|
|
369
|
+
<HiOutlineTrash size={sectionproperties.trashbtn_fontSize} />
|
|
370
|
+
</button>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
<div className="col-lg-12 mt-3 p-0">
|
|
374
|
+
<hr className="m-0" />
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
);
|
|
378
|
+
})}
|
|
379
|
+
{fetchcustomercartQueryContext?.data?.data?.customercart?.cartitems?.length != 0 && (
|
|
380
|
+
<div className="col-lg-12 mb-3 p-0">
|
|
381
|
+
<div className="row m-0 w-100">
|
|
382
|
+
<div className="col-lg-6 col-md-6 col-sm-6 p-0 d-flex justify-content-start">
|
|
383
|
+
<p
|
|
384
|
+
className={'p-0 m-0 '}
|
|
385
|
+
style={{
|
|
386
|
+
fontSize: sectionproperties.total_fontsize + 'px',
|
|
387
|
+
fontWeight: sectionproperties.total_fontweight,
|
|
388
|
+
textTransform: sectionproperties.total_texttransform,
|
|
389
|
+
color: sectionproperties.total_color,
|
|
390
|
+
}}
|
|
391
|
+
>
|
|
392
|
+
{lang.total}
|
|
393
|
+
</p>
|
|
394
|
+
</div>
|
|
395
|
+
<div className="col-lg-6 col-md-6 col-sm-6 d-flex justify-content-end p-0">
|
|
396
|
+
<p
|
|
397
|
+
className={langdetect == 'en' ? ' p-0 m-0 wordbreak text-right ' : ' p-0 m-0 wordbreak text-left'}
|
|
398
|
+
style={{
|
|
399
|
+
fontSize: sectionproperties.total_fontsize + 'px',
|
|
400
|
+
fontWeight: sectionproperties.total_fontweight,
|
|
401
|
+
textTransform: sectionproperties.total_texttransform,
|
|
402
|
+
color: sectionproperties.total_color,
|
|
403
|
+
}}
|
|
404
|
+
>
|
|
405
|
+
{langdetect == 'en' ? 'EGP' : ''} {fetchcustomercartQueryContext?.data?.data?.customercart?.totalprice}{' '}
|
|
406
|
+
{langdetect == 'en' ? '' : 'ج.م'}
|
|
407
|
+
</p>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
)}
|
|
412
|
+
</div>
|
|
413
|
+
)}
|
|
414
|
+
</div>
|
|
415
|
+
)}
|
|
416
|
+
</div>
|
|
417
|
+
{fetchcustomercartQueryContext?.data?.data?.customercart?.cartitems?.length != 0 && (
|
|
418
|
+
<div className="col-lg-12 d-flex align-items-center justify-content-center">
|
|
419
|
+
<button
|
|
420
|
+
className={` ${cart_cssstyles.cart_btn}` + ' mr-1 ml-1 d-flex align-items-center justify-content-center '}
|
|
421
|
+
onClick={() => {
|
|
422
|
+
routingcountext(StaticPagesLinksContext.viewcart);
|
|
423
|
+
}}
|
|
424
|
+
>
|
|
425
|
+
<i className={langdetect == 'en' ? 'h-100 d-flex align-items-center mr-2' : 'h-100 d-flex align-items-center ml-2'}>
|
|
426
|
+
{sectionproperties.carticonstyle == 'Shopping bag 1' && <FiShoppingBag className="" size={sectionproperties.cartBtn_iconFontSize} />}
|
|
427
|
+
{sectionproperties.carticonstyle == 'Shopping bag 2' && <CgShoppingBag className="" size={sectionproperties.cartBtn_iconFontSize} />}
|
|
428
|
+
{sectionproperties.carticonstyle == 'Shopping bag 3' && <BsBag className="" size={sectionproperties.cartBtn_iconFontSize} />}
|
|
429
|
+
{sectionproperties.carticonstyle == 'Shopping bag 4' && <IoBagHandleOutline className="" size={sectionproperties.cartBtn_iconFontSize} />}
|
|
430
|
+
{sectionproperties.carticonstyle == 'Shopping cart 1' && <FiShoppingCart className="" size={sectionproperties.cartBtn_iconFontSize} />}
|
|
431
|
+
{sectionproperties.carticonstyle == 'Shopping cart 2' && <MdOutlineShoppingCart size={sectionproperties.cartBtn_iconFontSize} />}
|
|
432
|
+
</i>
|
|
433
|
+
{lang.viewcart}
|
|
434
|
+
</button>
|
|
435
|
+
<button
|
|
436
|
+
className={` ${cart_cssstyles.checkoutbtn}` + ' ml-1 mr-1 '}
|
|
437
|
+
onClick={() => {
|
|
438
|
+
// if (fetchAuthorizationQueryContext.data.data.loggedin == true) {
|
|
439
|
+
routingcountext(StaticPagesLinksContext.Checkout);
|
|
440
|
+
// } else {
|
|
441
|
+
// NotificationManager.warning('', 'Please Login To Checkout');
|
|
442
|
+
// routingcountext(StaticPagesLinksContext.Login);
|
|
443
|
+
// }
|
|
444
|
+
}}
|
|
445
|
+
>
|
|
446
|
+
{lang.checkout}
|
|
447
|
+
</button>
|
|
448
|
+
</div>
|
|
449
|
+
)}
|
|
450
|
+
</div>
|
|
451
|
+
</div>
|
|
452
|
+
)}
|
|
453
|
+
</Offcanvas.Body>
|
|
454
|
+
</Offcanvas>
|
|
455
|
+
)}
|
|
456
|
+
</div>
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
export default CartSlider;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
2
|
+
import { LanguageContext } from '../../../../../../../Contexts/LanguageContext';
|
|
3
|
+
import { FetchingContext } from '../../../../../../../Contexts/FetchingContext';
|
|
4
|
+
import { WebsiteDesignWorkPlaceContext } from '../../../../../../../Contexts/WebsiteDesignWorkPlaceContext';
|
|
5
|
+
import { TemplateRoutingContext } from '../../../../../../../Contexts/TemplateRoutingContext';
|
|
6
|
+
import { BrowserRouter as Router, useHistory } from 'react-router-dom';
|
|
7
|
+
import generalstyles from '../../../../../../../styles/general/general.module.css';
|
|
8
|
+
import { BsChevronLeft, BsChevronRight } from 'react-icons/bs';
|
|
9
|
+
import { css } from 'glamor';
|
|
10
|
+
import { Accordion, AccordionItem, AccordionItemHeading, AccordionItemButton, AccordionItemPanel, AccordionItemState } from 'react-accessible-accordion';
|
|
11
|
+
import '../../../../../../../styles/staticpages/accordion.module.css';
|
|
12
|
+
import { MdOutlineKeyboardArrowDown, MdOutlineKeyboardArrowUp } from 'react-icons/md';
|
|
13
|
+
const Categoriesdropdown = (props) => {
|
|
14
|
+
let history = useHistory();
|
|
15
|
+
const { routingcountext, StaticPagesLinksContext } = useContext(TemplateRoutingContext);
|
|
16
|
+
const { lang, langdetect } = useContext(LanguageContext);
|
|
17
|
+
const { fetchAuthorizationQueryContext } = useContext(FetchingContext);
|
|
18
|
+
const [sectionproperties, setsectionproperties] = useState('');
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setsectionproperties(props.sectionpropertiesprops);
|
|
21
|
+
}, [props.sectionpropertiesprops]);
|
|
22
|
+
|
|
23
|
+
const sectionstyles = {
|
|
24
|
+
collectionbtn: css({
|
|
25
|
+
color: sectionproperties.collectionsectiontextcolor,
|
|
26
|
+
fontSize: sectionproperties.collectionsectiontextfontsize + 'px',
|
|
27
|
+
fontWeight: sectionproperties.collectionsectiontextfontweight,
|
|
28
|
+
textTransform: sectionproperties.collectionsectiontexttransform,
|
|
29
|
+
transition: '.3s',
|
|
30
|
+
':hover': {
|
|
31
|
+
color: sectionproperties.collectionsectiontextcoloronhover,
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
const Dropdowncontainer = () => {
|
|
36
|
+
return (
|
|
37
|
+
<div className="col-lg-12 p-0">
|
|
38
|
+
<div className={generalstyles.sub_scrollbar + ' row m-0 w-100 '} style={{ height: sectionproperties.image_height - 9 + 'vh', overflowY: 'scroll' }}>
|
|
39
|
+
<div className="col-lg-12 p-0">
|
|
40
|
+
{fetchAuthorizationQueryContext.isSuccess &&
|
|
41
|
+
fetchAuthorizationQueryContext.data.data.instinfo.instcollections.map((item, index) => (
|
|
42
|
+
<div className="row m-0 w-100">
|
|
43
|
+
<div
|
|
44
|
+
className="col-lg-12 cursor-pointer"
|
|
45
|
+
onClick={() => {
|
|
46
|
+
routingcountext(StaticPagesLinksContext.GeneralProductsComponent);
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<div className={sectionstyles.collectionbtn + ' row m-0 w-100 '}>
|
|
50
|
+
<div className={' col-lg-10 col-md-10 col-sm-10 p-0 d-flex justify-content-start align-items-center '}>
|
|
51
|
+
<p className={' dropdownitem text-overflow m-0 p-0 '}>{langdetect == 'en' ? item.title_en : item.title_ar}</p>
|
|
52
|
+
</div>
|
|
53
|
+
<div className={'col-lg-2 col-md-2 col-sm-2 d-flex justify-content-end align-items-center p-0 '}>
|
|
54
|
+
<i className={' p-0 h-100 allcentered '}>
|
|
55
|
+
{langdetect == 'en' ? (
|
|
56
|
+
<BsChevronRight size={sectionproperties.collectionsectioniconfontsize} />
|
|
57
|
+
) : (
|
|
58
|
+
<BsChevronLeft size={sectionproperties.collectionsectioniconfontsize} />
|
|
59
|
+
)}
|
|
60
|
+
</i>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
{index != fetchAuthorizationQueryContext.data.data.instinfo.instcollections.length - 1 && (
|
|
65
|
+
<div className="col-lg-12">
|
|
66
|
+
<hr />
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
))}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
return (
|
|
77
|
+
<div className={' row m-0 w-100 '} style={{ background: sectionproperties.collectionssectionbgcolor, boxShadow: '0 0 10px ' + sectionproperties.collectionssectionshadowcolor }}>
|
|
78
|
+
<div className="col-lg-12 p-3 mb-3 d-flex d-md-none" style={{ backgroundColor: sectionproperties.collectionssectiontitlebgcolor }}>
|
|
79
|
+
<p
|
|
80
|
+
className="m-0 p-0 text-center"
|
|
81
|
+
style={{
|
|
82
|
+
color: sectionproperties.collectionssectiontitlecolor,
|
|
83
|
+
fontSize: sectionproperties.collectionssectiontitlefontsize + 'px',
|
|
84
|
+
fontWeight: sectionproperties.collectionssectiontitlefonteweight,
|
|
85
|
+
textTransform: sectionproperties.collectionssectiontitletexttransfrom,
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{langdetect == 'en' ? sectionproperties.collectionssectiontitleen : sectionproperties.collectionssectiontitlear}
|
|
89
|
+
</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div className="row m-0 w-100 d-flex d-md-none">{Dropdowncontainer()}</div>
|
|
92
|
+
<div className="row m-0 w-100 d-none d-md-flex">
|
|
93
|
+
<Accordion allowMultipleExpanded={true} allowZeroExpanded={true} className="w-100" preExpanded={[1]}>
|
|
94
|
+
<AccordionItem uuid={1}>
|
|
95
|
+
<AccordionItemHeading>
|
|
96
|
+
<AccordionItemButton>
|
|
97
|
+
<div className="col-lg-12 p-3 d-flex allcentered" style={{ backgroundColor: sectionproperties.collectionssectiontitlebgcolor }}>
|
|
98
|
+
<p
|
|
99
|
+
className="m-0 p-0 text-center"
|
|
100
|
+
style={{
|
|
101
|
+
color: sectionproperties.collectionssectiontitlecolor,
|
|
102
|
+
fontSize: sectionproperties.collectionssectiontitlefontsize + 'px',
|
|
103
|
+
fontWeight: sectionproperties.collectionssectiontitlefonteweight,
|
|
104
|
+
textTransform: sectionproperties.collectionssectiontitletexttransfrom,
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{langdetect == 'en' ? sectionproperties.collectionssectiontitleen : sectionproperties.collectionssectiontitlear}
|
|
108
|
+
</p>
|
|
109
|
+
<AccordionItemState>
|
|
110
|
+
{(state) => {
|
|
111
|
+
if (state.expanded) {
|
|
112
|
+
return (
|
|
113
|
+
<MdOutlineKeyboardArrowDown
|
|
114
|
+
style={{
|
|
115
|
+
color: sectionproperties.collectionssectiontitlecolor,
|
|
116
|
+
}}
|
|
117
|
+
size={20}
|
|
118
|
+
className="ml-2 mr-2"
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
} else {
|
|
122
|
+
return (
|
|
123
|
+
<MdOutlineKeyboardArrowUp
|
|
124
|
+
style={{
|
|
125
|
+
color: sectionproperties.collectionssectiontitlecolor,
|
|
126
|
+
}}
|
|
127
|
+
size={20}
|
|
128
|
+
className="ml-2 mr-2"
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}}
|
|
133
|
+
</AccordionItemState>
|
|
134
|
+
</div>
|
|
135
|
+
</AccordionItemButton>
|
|
136
|
+
</AccordionItemHeading>
|
|
137
|
+
<AccordionItemPanel>
|
|
138
|
+
<div className="row m-0 pt-3 w-100 d-none d-md-flex">{Dropdowncontainer()}</div>
|
|
139
|
+
</AccordionItemPanel>
|
|
140
|
+
</AccordionItem>
|
|
141
|
+
</Accordion>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
export default Categoriesdropdown;
|