@weareconceptstudio/account 0.5.4 → 0.5.6
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/components/Loader/index.js +1 -0
- package/dist/components/Pagination/index.js +18 -3
- package/dist/components/TotalCheckout/FreeShippingComp/index.js +16 -3
- package/dist/components/TotalCheckout/FreeShippingComp/style.js +1 -1
- package/dist/components/TotalCheckout/GiftComp/index.js +19 -5
- package/dist/components/TotalCheckout/GiftComp/style.js +1 -1
- package/dist/components/TotalCheckout/index.js +7 -7
- package/dist/components/TotalCheckout/style.js +47 -3
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/index.js +5 -3
- package/dist/modules/cart/CartItems/Item/index.js +18 -7
- package/dist/modules/cart/CartItems/ItemMobile/index.js +14 -6
- package/dist/modules/cart/CartItems/index.js +1 -1
- package/dist/modules/cart/CartItems/style.js +21 -1
- package/dist/modules/cart/CartTemplate/index.d.ts +1 -2
- package/dist/modules/cart/CartTemplate/index.js +17 -7
- package/dist/modules/checkout/CheckoutTemplate/index.js +21 -13
- package/dist/modules/order/OrderDetails/index.js +23 -10
- package/dist/modules/order/OrderDetails/style.js +8 -0
- package/dist/modules/order/OrderedItems/Item/index.js +11 -6
- package/dist/modules/order/OrderedItems/ItemMobile/index.js +15 -7
- package/dist/modules/order/OrderedItems/style.js +18 -1
- package/dist/modules/order/OrdersList/Item/index.js +1 -1
- package/dist/modules/order/OrdersList/ItemMobile/index.js +1 -1
- package/dist/modules/order/OrdersList/index.js +5 -3
- package/dist/modules/order/OrdersList/style.js +2 -2
- package/dist/styles/helperClass.js +32 -0
- package/dist/translations/en.d.ts +1 -0
- package/dist/translations/en.js +2 -1
- package/dist/translations/hy.d.ts +1 -0
- package/dist/translations/hy.js +1 -0
- package/dist/translations/index.d.ts +3 -0
- package/dist/translations/ru.d.ts +1 -0
- package/dist/translations/ru.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo, useMemo } from 'react';
|
|
1
|
+
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
//* Icons
|
|
3
3
|
const left_arrow = (React.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', version: '1.1', viewBox: '0 0 32 32' },
|
|
4
4
|
React.createElement("path", { d: 'M24.015 31.254c0.261 0.001 0.519-0.057 0.756-0.167s0.446-0.272 0.613-0.473c0.15-0.18 0.262-0.387 0.332-0.61s0.094-0.458 0.073-0.691c-0.021-0.233-0.089-0.459-0.198-0.666s-0.258-0.39-0.438-0.539l-14.382-11.876 14.222-12.284c0.185-0.15 0.337-0.336 0.448-0.547s0.179-0.441 0.2-0.678c0.021-0.237-0.007-0.476-0.080-0.703s-0.192-0.436-0.348-0.616c-0.156-0.18-0.346-0.327-0.56-0.431s-0.446-0.166-0.684-0.179-0.476 0.022-0.7 0.102c-0.224 0.081-0.43 0.205-0.605 0.367l-15.84 13.653c-0.197 0.169-0.355 0.379-0.463 0.615s-0.162 0.494-0.159 0.753c0.004 0.26 0.065 0.515 0.179 0.748s0.277 0.439 0.479 0.603l16 13.209c0.32 0.278 0.733 0.424 1.156 0.409z' })));
|
|
@@ -7,10 +7,25 @@ const right_arrow = (React.createElement("svg", { xmlns: 'http://www.w3.org/2000
|
|
|
7
7
|
//* Style
|
|
8
8
|
import PaginationStyle from './style';
|
|
9
9
|
import { getParamsByKey } from '@weareconceptstudio/core';
|
|
10
|
-
const Pagination = memo(({ total, pageSize, onChange, activePageState, left_icon = false, right_icon = false }) => {
|
|
10
|
+
const Pagination = memo(({ total, pageSize, onChange, activePageState, left_icon = false, right_icon = false, parentElement }) => {
|
|
11
|
+
//! Ref
|
|
12
|
+
const paginationRef = useRef();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if ((parentElement || paginationRef.current) && activePageState) {
|
|
15
|
+
const parentElements = parentElement || paginationRef.current.parentElement;
|
|
16
|
+
const getHeader = document.querySelector('header');
|
|
17
|
+
const distance = parentElements.getBoundingClientRect().top;
|
|
18
|
+
const sizeScroll = (Math.floor(Math.abs(distance)) == 0 ? 0 : Math.floor(distance)) + window.scrollY - (getHeader ? getHeader.clientHeight : 0);
|
|
19
|
+
if (sizeScroll) {
|
|
20
|
+
requestAnimationFrame(() => {
|
|
21
|
+
window.scrollTo({ top: sizeScroll, behavior: 'smooth' });
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, [activePageState, parentElement]);
|
|
11
26
|
const maxPage = useMemo(() => Math.ceil(total / pageSize), [total, pageSize]);
|
|
12
27
|
const activePage = useMemo(() => Number(getParamsByKey(new URLSearchParams(window.location.search), 'page')) || activePageState || 1, [window.location.search, activePageState]);
|
|
13
|
-
return (total > pageSize && (React.createElement(PaginationStyle, { className: `pg-container account-primary-color1` },
|
|
28
|
+
return (total > pageSize && (React.createElement(PaginationStyle, { ref: paginationRef, className: `pg-container account-primary-color1` },
|
|
14
29
|
React.createElement("div", { className: `pg-icon ${activePage === 1 ? 'disabled-icon' : ''}`, onClick: () => activePage > 1 && onChange(activePage - 1 >= 1 ? activePage - 1 : activePage) }, left_icon || left_arrow),
|
|
15
30
|
React.createElement("span", { className: `pg-numbers account-p account-p4 account-font-bold` }, `${activePage} / ${maxPage}`),
|
|
16
31
|
React.createElement("div", { onClick: () => activePage < maxPage && onChange(activePage + 1), className: `pg-icon ${activePage === maxPage ? 'disabled-icon' : ''}` }, right_icon || right_arrow))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { handlePriceCheckFunc, useTranslation } from '@weareconceptstudio/core';
|
|
3
3
|
import { useAccountContext } from '../../../AccountProvider';
|
|
4
4
|
import { useCheckoutContext } from '../../../modules';
|
|
@@ -8,11 +8,24 @@ const FreeShippingComp = () => {
|
|
|
8
8
|
const { translate } = useTranslation();
|
|
9
9
|
const { useCart } = useAccountContext();
|
|
10
10
|
const { isCheckoutPage } = useCheckoutContext();
|
|
11
|
-
const { shippingCostValue, freeShippingRange, shippingCost, currency } = useCart();
|
|
11
|
+
const { shippingCostValue, freeShippingRange, shippingCost, items, currency } = useCart();
|
|
12
|
+
const [freeShow, setFreeShow] = useState(items?.length);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
let timeoutID;
|
|
15
|
+
if (typeof shippingCost != 'number' && typeof freeShippingRange != 'number') {
|
|
16
|
+
timeoutID = setTimeout(() => {
|
|
17
|
+
setFreeShow(false);
|
|
18
|
+
}, 3000);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
clearTimeout(timeoutID);
|
|
22
|
+
setFreeShow(true);
|
|
23
|
+
}
|
|
24
|
+
}, [shippingCost, freeShippingRange]);
|
|
12
25
|
return !isCheckoutPage ? (freeShippingRange ? (React.createElement(FreeShippingCompStyle, null,
|
|
13
26
|
React.createElement("svg", { fill: 'none', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg', className: 'free-shipping-comp-icon' },
|
|
14
27
|
React.createElement("path", { d: 'M21.675 14.475V9.9L17.925 6.15H15.375V4.125H2.85C2.325 4.725 2.025 5.025 1.5 5.55V16.65H3.3C3.3 18.375 4.725 19.8 6.45 19.8C8.175 19.8 9.6 18.375 9.6 16.65H13.35C13.35 18.375 14.775 19.8 16.5 19.8C18.225 19.8 19.65 18.375 19.65 16.65H22.35V14.475H21.675ZM6.45 18.6C5.475 18.6 4.65 17.775 4.65 16.8C4.65 15.825 5.475 15 6.45 15C7.425 15 8.25 15.825 8.25 16.8C8.25 17.775 7.5 18.6 6.45 18.6ZM16.575 18.6C15.6 18.6 14.775 17.775 14.775 16.8C14.775 15.825 15.6 15 16.575 15C17.55 15 18.375 15.825 18.375 16.8C18.375 17.775 17.625 18.6 16.575 18.6ZM19.575 11.1H15.375V7.95H17.025L19.575 10.5V11.1Z' })),
|
|
15
|
-
React.createElement("span", { className: 'free-shipping-comp-attr' }, translate('account.notifications_messages.freeShippingNote', { price: React.createElement("span", { className: 'range-value' }, handlePriceCheckFunc(freeShippingRange, currency)) })))) : typeof shippingCost != 'number' ? (React.createElement(FreeShippingCompStyle, null,
|
|
28
|
+
React.createElement("span", { className: 'free-shipping-comp-attr' }, translate('account.notifications_messages.freeShippingNote', { price: React.createElement("span", { className: 'range-value' }, handlePriceCheckFunc(freeShippingRange, currency)) })))) : typeof shippingCost != 'number' && freeShow ? (React.createElement(FreeShippingCompStyle, null,
|
|
16
29
|
React.createElement("svg", { fill: 'none', viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', className: 'free-shipping-comp-icon' },
|
|
17
30
|
React.createElement("path", { d: 'M13.901 5.06321C13.835 5.1324 13.754 5.167 13.658 5.167C13.562 5.167 13.481 5.1324 13.415 5.06321L13.388 5.03491C13.2081 4.84621 12.9981 4.74871 12.7611 4.74242C12.5241 4.73613 12.3111 4.83363 12.1191 5.03491L8.90036 8.40947C8.83437 8.47866 8.75337 8.51326 8.65738 8.51326C8.56139 8.51326 8.48039 8.47866 8.4144 8.40947C8.3484 8.34028 8.3154 8.25537 8.3154 8.15473C8.3154 8.05409 8.3484 7.96917 8.4144 7.89998L11.5912 4.56945C11.8941 4.25181 12.2811 4.08827 12.7461 4.08512C13.2111 4.07883 13.595 4.23608 13.901 4.55687C13.967 4.62606 14 4.71097 14 4.81161C14 4.91225 13.967 4.99717 13.901 5.06636V5.06321ZM6.17655 3.19509C6.24255 3.1259 6.32354 3.09131 6.41954 3.09131C6.51553 3.09131 6.59652 3.1259 6.66252 3.19509L6.79151 3.33033C7.12449 3.67942 7.28648 4.11343 7.28348 4.63864C7.27748 5.16071 7.10949 5.59786 6.77651 5.94695L6.63552 6.09477C6.56953 6.16396 6.48853 6.19855 6.39254 6.19855C6.29655 6.19855 6.21555 6.16396 6.14956 6.09477C6.08356 6.02558 6.05056 5.94066 6.05056 5.84002C6.05056 5.73938 6.08356 5.65447 6.14956 5.58528L6.33554 5.39029C6.55453 5.16071 6.65652 4.89967 6.64152 4.60719C6.62652 4.31471 6.52453 4.06625 6.33554 3.86812L6.17955 3.70458C6.11356 3.63539 6.08056 3.55048 6.08056 3.44984C6.08056 3.3492 6.11356 3.26428 6.17955 3.19509H6.17655ZM8.58538 2.10378C8.65138 2.03459 8.73237 2 8.82837 2C8.92436 2 9.00535 2.03459 9.07135 2.10378L9.7253 2.78939C10.0193 3.10703 10.1723 3.50959 10.1813 3.99077C10.1903 4.4751 10.0433 4.87451 9.7403 5.19216L7.78744 7.23954C7.72145 7.30873 7.64045 7.34332 7.54446 7.34332C7.44846 7.34332 7.36747 7.30873 7.30147 7.23954C7.23548 7.17035 7.20248 7.08543 7.20248 6.9848C7.20248 6.88416 7.23548 6.79924 7.30147 6.73005L9.22434 4.71412C9.40433 4.52542 9.49132 4.28326 9.48832 3.99077C9.48232 3.69829 9.39233 3.45613 9.20934 3.26743L8.58238 2.61013C8.51639 2.54094 8.48339 2.45602 8.48339 2.35538C8.48339 2.25474 8.51639 2.16983 8.58238 2.10064L8.58538 2.10378ZM12.8601 9.64859C12.7941 9.71778 12.7131 9.75238 12.6171 9.75238C12.5211 9.75238 12.4401 9.71778 12.3741 9.64859L11.8761 9.12653C11.6572 8.89694 11.4292 8.78372 11.1922 8.78372C10.9552 8.78372 10.7272 8.89694 10.5082 9.12653L10.0373 9.62029C9.97129 9.68948 9.89029 9.72407 9.7943 9.72407C9.6983 9.72407 9.61731 9.68948 9.55131 9.62029C9.48532 9.5511 9.45232 9.46619 9.45232 9.36555C9.45232 9.26491 9.48532 9.17999 9.55131 9.1108L9.97728 8.66422C10.3103 8.31512 10.7092 8.13586 11.1742 8.12642C11.6392 8.11699 12.0381 8.28682 12.3711 8.63277L12.8541 9.13911C12.9201 9.2083 12.9531 9.29321 12.9531 9.39385C12.9531 9.49449 12.9201 9.5794 12.8541 9.64859H12.8601ZM2.36082 13.9855L9.01435 11.501C9.20034 11.4318 9.25434 11.1802 9.11335 11.0355L4.81765 6.6074C4.67666 6.46273 4.44268 6.51934 4.37668 6.71433L2.01585 13.6239C1.94085 13.8471 2.14484 14.0641 2.35783 13.9824L2.36082 13.9855Z' })),
|
|
18
31
|
React.createElement("span", { className: 'free-shipping-comp-attr' }, translate('account.notifications_messages.freeShippingSuccessText', { price: React.createElement("span", { className: 'range-value' }, handlePriceCheckFunc(shippingCostValue, currency)) })))) : null) : null;
|
|
@@ -9,7 +9,7 @@ const FreeShippingCompStyle = styled.div `
|
|
|
9
9
|
display: flex;
|
|
10
10
|
gap: var(--account_freeShippingAttrGap);
|
|
11
11
|
|
|
12
|
-
margin: var(--
|
|
12
|
+
margin: var(--account_commentMarginTop) 0;
|
|
13
13
|
margin-bottom: 0;
|
|
14
14
|
background-color: var(--account_surfaceColor);
|
|
15
15
|
padding: var(--account_freeShippingBlockPadTB) var(--account_freeShippingBlockPadLR);
|
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useCheckoutContext } from '../../../modules';
|
|
3
3
|
import { useAccountContext } from '../../../AccountProvider';
|
|
4
|
+
import { handlePriceCheckFunc, useTranslation } from '@weareconceptstudio/core';
|
|
4
5
|
//* Style
|
|
5
6
|
import GiftCompStyle from './style';
|
|
6
7
|
const GiftComp = () => {
|
|
7
8
|
const { translate } = useTranslation();
|
|
8
9
|
const { useCart } = useAccountContext();
|
|
9
10
|
const { hasFreeGift, giftThresholdRemaining, currency } = useCart();
|
|
10
|
-
|
|
11
|
+
const { isCheckoutPage } = useCheckoutContext();
|
|
12
|
+
const [show, setShow] = useState(true);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (hasFreeGift) {
|
|
15
|
+
const timer = setTimeout(() => {
|
|
16
|
+
setShow(false);
|
|
17
|
+
}, 5000);
|
|
18
|
+
return () => clearTimeout(timer);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
setShow(true);
|
|
22
|
+
}
|
|
23
|
+
}, [hasFreeGift]);
|
|
24
|
+
return !isCheckoutPage ? (giftThresholdRemaining && !hasFreeGift ? (React.createElement(GiftCompStyle, null,
|
|
11
25
|
React.createElement("svg", { fill: 'none', viewBox: '0 0 24 23', className: 'gift-comp-icon', xmlns: 'http://www.w3.org/2000/svg' },
|
|
12
26
|
React.createElement("path", { d: 'M20.25 5.75003H16.9613C16.9978 5.71909 17.0353 5.68909 17.0709 5.65628C17.3557 5.40332 17.5851 5.09433 17.745 4.74864C17.9049 4.40295 17.9917 4.02799 18 3.64721C18.0123 3.23066 17.9394 2.81598 17.7856 2.42864C17.6319 2.0413 17.4006 1.68947 17.106 1.39474C16.8113 1.10002 16.4596 0.86863 16.0723 0.714771C15.685 0.560913 15.2703 0.487836 14.8538 0.500027C14.4728 0.508232 14.0977 0.594982 13.7518 0.754846C13.406 0.91471 13.0968 1.14425 12.8438 1.42909C12.4936 1.83493 12.2089 2.29294 12 2.78659C11.7911 2.29294 11.5064 1.83493 11.1562 1.42909C10.9032 1.14425 10.594 0.91471 10.2482 0.754846C9.90232 0.594982 9.52718 0.508232 9.14625 0.500027C8.72969 0.487836 8.31503 0.560913 7.92774 0.714771C7.54044 0.86863 7.18868 1.10002 6.89405 1.39474C6.59941 1.68947 6.36812 2.0413 6.21438 2.42864C6.06064 2.81598 5.98768 3.23066 6 3.64721C6.00833 4.02799 6.09514 4.40295 6.255 4.74864C6.41486 5.09433 6.64434 5.40332 6.92906 5.65628C6.96469 5.68721 7.00219 5.71721 7.03875 5.75003H3.75C3.35218 5.75003 2.97064 5.90806 2.68934 6.18937C2.40804 6.47067 2.25 6.8522 2.25 7.25003V10.25C2.25 10.6479 2.40804 11.0294 2.68934 11.3107C2.97064 11.592 3.35218 11.75 3.75 11.75V17.75C3.75 18.1479 3.90804 18.5294 4.18934 18.8107C4.47064 19.092 4.85218 19.25 5.25 19.25H10.875C10.9745 19.25 11.0698 19.2105 11.1402 19.1402C11.2105 19.0699 11.25 18.9745 11.25 18.875V10.25H3.75V7.25003H11.25V10.25H12.75V7.25003H20.25V10.25H12.75V18.875C12.75 18.9745 12.7895 19.0699 12.8598 19.1402C12.9302 19.2105 13.0255 19.25 13.125 19.25H18.75C19.1478 19.25 19.5294 19.092 19.8107 18.8107C20.092 18.5294 20.25 18.1479 20.25 17.75V11.75C20.6478 11.75 21.0294 11.592 21.3107 11.3107C21.592 11.0294 21.75 10.6479 21.75 10.25V7.25003C21.75 6.8522 21.592 6.47067 21.3107 6.18937C21.0294 5.90806 20.6478 5.75003 20.25 5.75003ZM7.92281 4.53128C7.79168 4.41253 7.68651 4.26795 7.61391 4.10661C7.54131 3.94528 7.50285 3.77068 7.50094 3.59378C7.4962 3.3865 7.53287 3.18036 7.60881 2.98743C7.68476 2.79451 7.79844 2.61868 7.9432 2.47025C8.08796 2.32182 8.26089 2.20378 8.45186 2.12304C8.64282 2.04229 8.84798 2.00047 9.05531 2.00003H9.10125C9.27815 2.00194 9.45275 2.0404 9.61409 2.113C9.77542 2.1856 9.92 2.29077 10.0388 2.4219C10.8253 3.31065 11.1028 4.7844 11.2003 5.69565C10.2853 5.59909 8.8125 5.32159 7.92281 4.53128ZM16.0791 4.53128C15.1894 5.31878 13.7128 5.59628 12.7978 5.69378C12.9094 4.70846 13.2188 3.26565 13.9688 2.42284C14.0875 2.2917 14.2321 2.18653 14.3934 2.11393C14.5547 2.04133 14.7293 2.00287 14.9062 2.00096H14.9522C15.1595 2.00226 15.3645 2.04493 15.5552 2.12647C15.7458 2.20801 15.9183 2.32678 16.0624 2.47582C16.2066 2.62487 16.3195 2.80118 16.3947 2.99444C16.4698 3.18769 16.5056 3.394 16.5 3.60128C16.4969 3.77698 16.4578 3.95019 16.3851 4.11016C16.3124 4.27013 16.2076 4.41347 16.0772 4.53128H16.0791Z' })),
|
|
13
|
-
React.createElement("span", { className: 'gift-comp-attr' }, translate('account.notifications_messages.giftNote', { price: React.createElement("span", { className: 'range-value' }, handlePriceCheckFunc(giftThresholdRemaining, currency)) })))) : hasFreeGift ? (React.createElement(GiftCompStyle, null,
|
|
27
|
+
React.createElement("span", { className: 'gift-comp-attr' }, translate('account.notifications_messages.giftNote', { price: React.createElement("span", { className: 'range-value' }, handlePriceCheckFunc(giftThresholdRemaining, currency)) })))) : hasFreeGift && show ? (React.createElement(GiftCompStyle, null,
|
|
14
28
|
React.createElement("svg", { fill: 'none', viewBox: '0 0 16 16', className: 'gift-comp-icon', xmlns: 'http://www.w3.org/2000/svg' },
|
|
15
29
|
React.createElement("path", { d: 'M13.901 5.06321C13.835 5.1324 13.754 5.167 13.658 5.167C13.562 5.167 13.481 5.1324 13.415 5.06321L13.388 5.03491C13.2081 4.84621 12.9981 4.74871 12.7611 4.74242C12.5241 4.73613 12.3111 4.83363 12.1191 5.03491L8.90036 8.40947C8.83437 8.47866 8.75337 8.51326 8.65738 8.51326C8.56139 8.51326 8.48039 8.47866 8.4144 8.40947C8.3484 8.34028 8.3154 8.25537 8.3154 8.15473C8.3154 8.05409 8.3484 7.96917 8.4144 7.89998L11.5912 4.56945C11.8941 4.25181 12.2811 4.08827 12.7461 4.08512C13.2111 4.07883 13.595 4.23608 13.901 4.55687C13.967 4.62606 14 4.71097 14 4.81161C14 4.91225 13.967 4.99717 13.901 5.06636V5.06321ZM6.17655 3.19509C6.24255 3.1259 6.32354 3.09131 6.41954 3.09131C6.51553 3.09131 6.59652 3.1259 6.66252 3.19509L6.79151 3.33033C7.12449 3.67942 7.28648 4.11343 7.28348 4.63864C7.27748 5.16071 7.10949 5.59786 6.77651 5.94695L6.63552 6.09477C6.56953 6.16396 6.48853 6.19855 6.39254 6.19855C6.29655 6.19855 6.21555 6.16396 6.14956 6.09477C6.08356 6.02558 6.05056 5.94066 6.05056 5.84002C6.05056 5.73938 6.08356 5.65447 6.14956 5.58528L6.33554 5.39029C6.55453 5.16071 6.65652 4.89967 6.64152 4.60719C6.62652 4.31471 6.52453 4.06625 6.33554 3.86812L6.17955 3.70458C6.11356 3.63539 6.08056 3.55048 6.08056 3.44984C6.08056 3.3492 6.11356 3.26428 6.17955 3.19509H6.17655ZM8.58538 2.10378C8.65138 2.03459 8.73237 2 8.82837 2C8.92436 2 9.00535 2.03459 9.07135 2.10378L9.7253 2.78939C10.0193 3.10703 10.1723 3.50959 10.1813 3.99077C10.1903 4.4751 10.0433 4.87451 9.7403 5.19216L7.78744 7.23954C7.72145 7.30873 7.64045 7.34332 7.54446 7.34332C7.44846 7.34332 7.36747 7.30873 7.30147 7.23954C7.23548 7.17035 7.20248 7.08543 7.20248 6.9848C7.20248 6.88416 7.23548 6.79924 7.30147 6.73005L9.22434 4.71412C9.40433 4.52542 9.49132 4.28326 9.48832 3.99077C9.48232 3.69829 9.39233 3.45613 9.20934 3.26743L8.58238 2.61013C8.51639 2.54094 8.48339 2.45602 8.48339 2.35538C8.48339 2.25474 8.51639 2.16983 8.58238 2.10064L8.58538 2.10378ZM12.8601 9.64859C12.7941 9.71778 12.7131 9.75238 12.6171 9.75238C12.5211 9.75238 12.4401 9.71778 12.3741 9.64859L11.8761 9.12653C11.6572 8.89694 11.4292 8.78372 11.1922 8.78372C10.9552 8.78372 10.7272 8.89694 10.5082 9.12653L10.0373 9.62029C9.97129 9.68948 9.89029 9.72407 9.7943 9.72407C9.6983 9.72407 9.61731 9.68948 9.55131 9.62029C9.48532 9.5511 9.45232 9.46619 9.45232 9.36555C9.45232 9.26491 9.48532 9.17999 9.55131 9.1108L9.97728 8.66422C10.3103 8.31512 10.7092 8.13586 11.1742 8.12642C11.6392 8.11699 12.0381 8.28682 12.3711 8.63277L12.8541 9.13911C12.9201 9.2083 12.9531 9.29321 12.9531 9.39385C12.9531 9.49449 12.9201 9.5794 12.8541 9.64859H12.8601ZM2.36082 13.9855L9.01435 11.501C9.20034 11.4318 9.25434 11.1802 9.11335 11.0355L4.81765 6.6074C4.67666 6.46273 4.44268 6.51934 4.37668 6.71433L2.01585 13.6239C1.94085 13.8471 2.14484 14.0641 2.35783 13.9824L2.36082 13.9855Z' })),
|
|
16
|
-
React.createElement("span", { className: 'gift-comp-attr' }, translate('account.notifications_messages.giftSuccessText')))) : null;
|
|
30
|
+
React.createElement("span", { className: 'gift-comp-attr' }, translate('account.notifications_messages.giftSuccessText')))) : null) : null;
|
|
17
31
|
};
|
|
18
32
|
export default GiftComp;
|
|
@@ -9,7 +9,7 @@ const GiftCompStyle = styled.div `
|
|
|
9
9
|
display: flex;
|
|
10
10
|
gap: var(--account_giftAttrGap);
|
|
11
11
|
|
|
12
|
-
margin: var(--
|
|
12
|
+
margin: var(--account_commentMarginTop) 0;
|
|
13
13
|
margin-bottom: 0;
|
|
14
14
|
background-color: var(--account_surfaceColor);
|
|
15
15
|
padding: var(--account_giftBlockPadTB) var(--account_giftBlockPadLR);
|
|
@@ -12,12 +12,12 @@ import GiftComp from './GiftComp';
|
|
|
12
12
|
import TotalCheckoutStyle from './style';
|
|
13
13
|
//* Skeleton
|
|
14
14
|
import SkeletonTotalCheckout from './Skeleton';
|
|
15
|
-
const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps }) => {
|
|
15
|
+
const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, loading }) => {
|
|
16
16
|
const { useCart, useUser } = useAccountContext();
|
|
17
17
|
const { checkoutBtnDisabled } = useCheckoutContext();
|
|
18
18
|
const { addressLoading } = useAddressContext();
|
|
19
19
|
const { user } = useUser();
|
|
20
|
-
const { itemsCount, shippingCost, total, subtotal, useBalance,
|
|
20
|
+
const { itemsCount, shippingCost, total, subtotal, useBalance, discount, currency } = useCart();
|
|
21
21
|
return (React.createElement(TotalCheckoutStyle, null,
|
|
22
22
|
React.createElement("div", { className: `cart-main-wrap` },
|
|
23
23
|
React.createElement("div", { className: `left-panel-wrap panel` }, children),
|
|
@@ -39,15 +39,15 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps })
|
|
|
39
39
|
React.createElement("div", { className: `od-item-wrap` },
|
|
40
40
|
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 sticky-wrap-shipping`, text: `account.address_management.shipping` }),
|
|
41
41
|
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 sticky-wrap-shipping-cost`, text: `${String(shippingCost).toLowerCase() === 'free' ? `account.general_actions.${shippingCost}` : shippingCost === '-' ? shippingCost : `${numToLocalString(shippingCost)} ${currency}`}` })),
|
|
42
|
-
React.createElement("div", { className: `od-item-wrap` },
|
|
42
|
+
React.createElement("div", { className: `od-item-wrap total-block` },
|
|
43
43
|
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-total`, text: `account.order_balance.total` }),
|
|
44
44
|
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-currency2`, text: itemsCount ? handlePriceCheckFunc(total, currency) : `0 ${currency}` })),
|
|
45
45
|
React.createElement(GiftComp, null),
|
|
46
46
|
React.createElement(FreeShippingComp, null),
|
|
47
47
|
user ? (React.createElement(CollapseContainer, { className: 'collapse-container-wrapper' },
|
|
48
|
-
React.createElement(
|
|
49
|
-
React.createElement(
|
|
50
|
-
React.createElement(CommentComp, { isShipping: isShipping }),
|
|
51
|
-
|
|
48
|
+
React.createElement(PromoCodeComp, null),
|
|
49
|
+
React.createElement(BalanceComp, null))) : null,
|
|
50
|
+
React.createElement(CommentComp, { isShipping: isShipping }))),
|
|
51
|
+
React.createElement(AccountButton, { url: buttonProps.url, btnType: `full-width`, text: buttonProps.text, type: buttonProps.type, disabled: checkoutBtnDisabled, loading: buttonProps.loadingButton, className: `sticky-wrap-btn text-center`, onClick: () => buttonProps.handleClick && buttonProps.handleClick() })))) : (React.createElement(SkeletonTotalCheckout, null))))));
|
|
52
52
|
});
|
|
53
53
|
export default TotalCheckout;
|
|
@@ -53,6 +53,10 @@ const TotalCheckoutStyle = styled.section `
|
|
|
53
53
|
justify-content: space-between;
|
|
54
54
|
align-items: center;
|
|
55
55
|
|
|
56
|
+
&.total-block {
|
|
57
|
+
margin-bottom: var(--account_collapseLargeDistance);
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
&:not(:first-child) {
|
|
57
61
|
margin-top: var(--account_itemMTop);
|
|
58
62
|
}
|
|
@@ -196,10 +200,12 @@ const TotalCheckoutStyle = styled.section `
|
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
/* //! Scroll logic */
|
|
199
|
-
|
|
203
|
+
--account_rightPanelScrollSize: var(--sp50x);
|
|
204
|
+
|
|
205
|
+
.scroll-block {
|
|
200
206
|
overflow-x: hidden;
|
|
201
207
|
overflow-y: auto;
|
|
202
|
-
max-height: calc(100vh - var(--
|
|
208
|
+
max-height: calc(100vh - var(--account_rightPanelScrollSize));
|
|
203
209
|
|
|
204
210
|
scrollbar-width: none;
|
|
205
211
|
-ms-overflow-style: none;
|
|
@@ -207,7 +213,7 @@ const TotalCheckoutStyle = styled.section `
|
|
|
207
213
|
&::-webkit-scrollbar {
|
|
208
214
|
display: none;
|
|
209
215
|
}
|
|
210
|
-
}
|
|
216
|
+
}
|
|
211
217
|
|
|
212
218
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
213
219
|
--account_distance: var(--sp8x);
|
|
@@ -283,6 +289,9 @@ const TotalCheckoutStyle = styled.section `
|
|
|
283
289
|
/* //! Collapse Sizes */
|
|
284
290
|
--account_collapseLargeDistance: var(--sp4x);
|
|
285
291
|
--account_collapseSmallDistance: var(--sp3x);
|
|
292
|
+
|
|
293
|
+
/* //! Scroll logic */
|
|
294
|
+
--account_rightPanelScrollSize: var(--sp45x);
|
|
286
295
|
}
|
|
287
296
|
|
|
288
297
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
@@ -302,6 +311,9 @@ const TotalCheckoutStyle = styled.section `
|
|
|
302
311
|
/* //! Collapse Sizes */
|
|
303
312
|
--account_collapseLargeDistance: var(--sp3x);
|
|
304
313
|
--account_collapseSmallDistance: var(--sp3x);
|
|
314
|
+
|
|
315
|
+
/* //! Scroll logic */
|
|
316
|
+
--account_rightPanelScrollSize: var(--sp40x);
|
|
305
317
|
}
|
|
306
318
|
|
|
307
319
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
@@ -322,6 +334,22 @@ const TotalCheckoutStyle = styled.section `
|
|
|
322
334
|
--account_collapseLargeDistance: var(--sp3x);
|
|
323
335
|
--account_collapseSmallDistance: var(--sp2-5x);
|
|
324
336
|
|
|
337
|
+
/* //! Scroll logic */
|
|
338
|
+
--account_rightPanelScrollSize: 0;
|
|
339
|
+
|
|
340
|
+
.scroll-block {
|
|
341
|
+
overflow-x: unset;
|
|
342
|
+
overflow-y: unset;
|
|
343
|
+
max-height: unset;
|
|
344
|
+
|
|
345
|
+
scrollbar-width: unset;
|
|
346
|
+
-ms-overflow-style: unset;
|
|
347
|
+
|
|
348
|
+
&::-webkit-scrollbar {
|
|
349
|
+
display: unset;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
325
353
|
.cart-main-wrap {
|
|
326
354
|
.right-panel-wrap {
|
|
327
355
|
margin-top: var(--sp12x);
|
|
@@ -347,6 +375,22 @@ const TotalCheckoutStyle = styled.section `
|
|
|
347
375
|
--account_collapseLargeDistance: var(--sp3x);
|
|
348
376
|
--account_collapseSmallDistance: var(--sp2x);
|
|
349
377
|
|
|
378
|
+
/* //! Scroll logic */
|
|
379
|
+
--account_rightPanelScrollSize: 0;
|
|
380
|
+
|
|
381
|
+
.scroll-block {
|
|
382
|
+
overflow-x: unset;
|
|
383
|
+
overflow-y: unset;
|
|
384
|
+
max-height: unset;
|
|
385
|
+
|
|
386
|
+
scrollbar-width: unset;
|
|
387
|
+
-ms-overflow-style: unset;
|
|
388
|
+
|
|
389
|
+
&::-webkit-scrollbar {
|
|
390
|
+
display: unset;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
350
394
|
.cart-main-wrap {
|
|
351
395
|
.right-panel-wrap {
|
|
352
396
|
margin-top: var(--sp8x);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { api, Link, Text, useTranslation } from '@weareconceptstudio/core';
|
|
3
3
|
//* Styles
|
|
4
4
|
import HistoryBalanceStyle from './style';
|
|
@@ -8,6 +8,8 @@ import { Pagination } from '../../../../components';
|
|
|
8
8
|
const dataCategoryName = ['account.balance_promotions.balanceCategoryDate', 'account.balance_promotions.balanceCategoryActivity', 'account.balance_promotions.balanceCategoryAmount'];
|
|
9
9
|
const HistoryBalance = ({ linkEarnPage }) => {
|
|
10
10
|
const { translate, selectedLang } = useTranslation();
|
|
11
|
+
//! Ref
|
|
12
|
+
const containerRef = useRef();
|
|
11
13
|
const [currentPage, setCurrentPage] = useState(1);
|
|
12
14
|
const [pagination, setPagination] = useState({
|
|
13
15
|
total: 0,
|
|
@@ -25,7 +27,7 @@ const HistoryBalance = ({ linkEarnPage }) => {
|
|
|
25
27
|
useEffect(() => {
|
|
26
28
|
getHistory(currentPage);
|
|
27
29
|
}, [currentPage]);
|
|
28
|
-
return data?.length > 0 ? (React.createElement(HistoryBalanceStyle,
|
|
30
|
+
return data?.length > 0 ? (React.createElement(HistoryBalanceStyle, { ref: containerRef },
|
|
29
31
|
React.createElement("div", { className: 'wrapper-title-section-history' },
|
|
30
32
|
React.createElement("div", { className: 'wrapper-history-link' },
|
|
31
33
|
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 first-letter title-section-history', text: 'account.balance_promotions.balanceRecentActivity' }),
|
|
@@ -40,6 +42,6 @@ const HistoryBalance = ({ linkEarnPage }) => {
|
|
|
40
42
|
React.createElement("div", { className: 'line-info first-line' }),
|
|
41
43
|
data &&
|
|
42
44
|
data.map((item, i) => (React.createElement(ItemHistory, { key: i, ...item }))),
|
|
43
|
-
React.createElement(Pagination, { activePageState: currentPage, ...pagination, onChange: (page) => setCurrentPage(page) }))))) : null;
|
|
45
|
+
React.createElement(Pagination, { parentElement: containerRef.current, activePageState: currentPage, ...pagination, onChange: (page) => setCurrentPage(page) }))))) : null;
|
|
44
46
|
};
|
|
45
47
|
export default HistoryBalance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import { handlePriceCheckFunc, Image, Text } from '@weareconceptstudio/core';
|
|
2
|
+
import { handlePriceCheckFunc, Image, Text, useTranslation } from '@weareconceptstudio/core';
|
|
3
3
|
import { AccountButton, AccountCounter } from '../../../../components';
|
|
4
4
|
import { useAccountContext } from '../../../../AccountProvider';
|
|
5
5
|
import { useCheckoutContext } from '../../../checkout';
|
|
@@ -7,7 +7,8 @@ import { defaultIconGift } from '../util';
|
|
|
7
7
|
const Item = memo(({ data, remove, select, isLast, actions }) => {
|
|
8
8
|
const { checkoutData, setCheckGift } = useCheckoutContext();
|
|
9
9
|
const { currency, handleProductClick } = useAccountContext();
|
|
10
|
-
|
|
10
|
+
const { translate } = useTranslation();
|
|
11
|
+
return (React.createElement("div", { className: `item-wrap user-select-none` },
|
|
11
12
|
React.createElement("div", { className: 'line' }),
|
|
12
13
|
React.createElement("div", { className: `item-inner-wrapper` },
|
|
13
14
|
React.createElement("div", { className: `col-item tl-col-1 col-item-1` },
|
|
@@ -15,22 +16,32 @@ const Item = memo(({ data, remove, select, isLast, actions }) => {
|
|
|
15
16
|
data.is_gift ? React.createElement("div", { className: 'wrapper-gift-icon' }, defaultIconGift) : null,
|
|
16
17
|
React.createElement(Image, { src: data.product.image.src, alt: data.product.image.alt })),
|
|
17
18
|
React.createElement("div", { className: `col-1-right-wrap` },
|
|
18
|
-
React.createElement(AccountButton, { text: data.product
|
|
19
|
-
data.
|
|
19
|
+
React.createElement(AccountButton, { text: data.product.name, btnType: `green-large-text`, className: `capitalize title-btn`, onClick: () => handleProductClick(data.product) }),
|
|
20
|
+
data.color ? (React.createElement("div", { className: `right-first-item-wrap` },
|
|
21
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: `account.general_actions.color` }),
|
|
22
|
+
"\u00A0",
|
|
23
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1 capitalize`, text: data.color }))) : data.product.short_info_1 ? (React.createElement("div", { className: `right-first-item-wrap` },
|
|
20
24
|
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1`, text: data.product.short_info_1 }))) : null,
|
|
21
|
-
data.
|
|
25
|
+
data.size ? (React.createElement("div", { className: `right-second-item-wrap` },
|
|
26
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: `account.general_actions.size` }),
|
|
27
|
+
"\u00A0",
|
|
28
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.size }))) : data.product.short_info_2 ? (React.createElement("div", { className: `right-second-item-wrap` },
|
|
22
29
|
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: data.product.short_info_2 }))) : null)),
|
|
23
30
|
React.createElement("div", { className: `col-item tl-col-2` }, select && !data.is_gift ? (React.createElement("div", { className: `select-and-out-of-stock-wrap` }, !data.product.out_of_stock ? (React.createElement(AccountCounter, { productId: data.product.id })) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: 'account.general_actions.outOfStock' })))) : data.is_gift ? (React.createElement("div", { className: 'wrapper-gift-button' }, checkoutData.checkGift ? (React.createElement(AccountCounter, { maxQty: 1, productId: -1, isGift: data.is_gift })) : (React.createElement(AccountButton, { className: `button-gift`, text: 'account.general_actions.restore', onClick: () => {
|
|
24
31
|
setCheckGift();
|
|
25
32
|
} })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.qty }))),
|
|
26
33
|
React.createElement("div", { className: `col-item tl-col-3 col-item-3 nowrap` }, data.product.sale_price && !data.is_gift ? (React.createElement("div", null,
|
|
27
34
|
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right cart-sale-price`, text: handlePriceCheckFunc(data.product.sale_price, currency) }),
|
|
28
|
-
React.createElement(
|
|
35
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
36
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
37
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right cart-price1`, text: handlePriceCheckFunc(data.product.price, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right cart-price2`, text: handlePriceCheckFunc(data.is_gift ? 0 : data.product.price, currency) }))),
|
|
29
38
|
React.createElement("div", { className: `col-item tl-col-4 col-item-4 nowrap` },
|
|
30
39
|
React.createElement("div", { className: `col-item-inner-wrap` },
|
|
31
40
|
React.createElement("div", { className: `flex-end-wrap` }, data.sale_total && !data.is_gift ? (React.createElement("div", null,
|
|
32
41
|
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right cart-sale-total`, text: handlePriceCheckFunc(data.sale_total, currency) }),
|
|
33
|
-
React.createElement(
|
|
42
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
43
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
44
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right cart-total1`, text: handlePriceCheckFunc(data.total, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right cart-total2`, text: handlePriceCheckFunc(data.is_gift ? 0 : data.total, currency) }))),
|
|
34
45
|
React.createElement("div", { className: `favorite-and-remove-wrap` }, remove && !data.is_gift && (React.createElement("div", { className: `remove-btn-wrap` },
|
|
35
46
|
React.createElement(AccountButton, { btnType: `green-small-text`, className: 'cart-remove-btn', text: 'account.general_actions.remove', onClick: () => actions.delete({ productId: data.product.id }) }))))))),
|
|
36
47
|
isLast ? React.createElement("div", { className: 'line' }) : null));
|
|
@@ -16,14 +16,22 @@ const ItemMobile = memo(({ data, select }) => {
|
|
|
16
16
|
React.createElement(Image, { src: data.product.image.src, alt: data.product.image.alt })),
|
|
17
17
|
React.createElement("div", { className: `mobile-info-wrap` },
|
|
18
18
|
React.createElement(AccountButton, { text: data.product.name, btnType: `green-large-text`, className: `capitalize mobile-info-wrap-title`, onClick: () => handleProductClick(data.product) }),
|
|
19
|
-
data.
|
|
20
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-
|
|
21
|
-
|
|
22
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1
|
|
19
|
+
data.color ? (React.createElement("div", { className: `mobile-info-item` },
|
|
20
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: `account.general_actions.color` }),
|
|
21
|
+
"\u00A0",
|
|
22
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1 capitalize`, text: data.color }))) : data.product.short_info_1 ? (React.createElement("div", { className: 'mobile-info-item' },
|
|
23
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1 mobile-short-info1`, text: data.product.short_info_1 }))) : null,
|
|
24
|
+
data.size ? (React.createElement("div", { className: `mobile-info-item` },
|
|
25
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: `account.general_actions.size` }),
|
|
26
|
+
"\u00A0",
|
|
27
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1`, text: data.size }))) : data.product.short_info_2 ? (React.createElement("div", { className: 'mobile-info-item' },
|
|
28
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1 mobile-short-info2`, text: data.product.short_info_2 }))) : null,
|
|
23
29
|
React.createElement("div", { className: `mobile-total-price-wrap flex-box` },
|
|
24
30
|
data.sale_total && !data.is_gift ? (React.createElement("div", { className: 'mobile-total-price-flex-block' },
|
|
25
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-
|
|
26
|
-
React.createElement(
|
|
31
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-secondary-color2 mobile-total-discounted-price`, text: handlePriceCheckFunc(data.sale_total, currency) }),
|
|
32
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
33
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
34
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through mobile-total-price price-discount`, text: handlePriceCheckFunc(data.total, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1 mobile-total-price2`, text: handlePriceCheckFunc(data.is_gift ? 0 : data.total, currency) })),
|
|
27
35
|
select ? (React.createElement("div", { className: `inner-container` }, !data.product.out_of_stock && !data.is_gift ? (React.createElement(AccountCounter, { productId: data.product.id })) : data.is_gift ? (React.createElement("div", { className: 'wrapper-gift-button' }, checkoutData.checkGift ? (React.createElement(AccountCounter, { maxQty: 1, productId: -1, isGift: data.is_gift })) : (React.createElement(AccountButton, { className: `capitalize button-gift`, text: 'account.general_actions.restore', onClick: () => {
|
|
28
36
|
setCheckGift();
|
|
29
37
|
} })))) : (React.createElement("div", { className: `in-block` },
|
|
@@ -33,7 +33,7 @@ const CartItems = memo(({ data, className, title, smallFontSize, additionalParam
|
|
|
33
33
|
return (React.createElement(CartItemsStyle, { className: className || '' },
|
|
34
34
|
additionalParameters.edit.list ? (React.createElement("div", { className: `title-edit-wrapper` },
|
|
35
35
|
React.createElement(Text, { className: `account-p ${smallFontSize ? 'account-p2' : 'account-p1'} account-font-bold account-primary-color1 cart-items-title2-version`, text: title }),
|
|
36
|
-
React.createElement(AccountButton, { url: '/cart/', btnType: `green-small-text`, className: 'cart-items-edit-btn'
|
|
36
|
+
React.createElement(AccountButton, { url: '/cart/', btnType: `green-small-text`, text: `account.cart_checkout.editCart`, className: 'cart-items-edit-btn align-right' }))) : (React.createElement(Text, { className: `account-p ${smallFontSize ? 'account-p2' : 'account-p1'} account-font-bold account-primary-color1 cart-items-title1-version`, text: title })),
|
|
37
37
|
additionalParameters.horizontalLine ? React.createElement("div", { className: `cart-items-line` }) : null,
|
|
38
38
|
itemsStore));
|
|
39
39
|
});
|
|
@@ -51,6 +51,13 @@ const CartItemsStyle = styled.section `
|
|
|
51
51
|
--account_giftButtonTB: calc(var(--sp2x) - var(--sp0-5x) / 2);
|
|
52
52
|
--account_giftButtonLR: var(--sp2x);
|
|
53
53
|
|
|
54
|
+
.wrapper-discount {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: flex-end;
|
|
58
|
+
column-gap: var(--sp1x);
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
.mobile-info-wrap-title {
|
|
55
62
|
a,
|
|
56
63
|
button {
|
|
@@ -647,6 +654,10 @@ const CartItemsStyle = styled.section `
|
|
|
647
654
|
--account_spaceLineMTop: var(--sp2x);
|
|
648
655
|
--account_spaceLineMBot: var(--sp3x);
|
|
649
656
|
}
|
|
657
|
+
|
|
658
|
+
.wrapper-discount {
|
|
659
|
+
column-gap: var(--sp0-5x);
|
|
660
|
+
}
|
|
650
661
|
}
|
|
651
662
|
|
|
652
663
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
@@ -705,15 +716,24 @@ const CartItemsStyle = styled.section `
|
|
|
705
716
|
.mobile-price-wrap,
|
|
706
717
|
.mobile-total-price-wrap {
|
|
707
718
|
margin-top: var(--sp2x);
|
|
719
|
+
align-items: flex-end;
|
|
708
720
|
}
|
|
709
721
|
|
|
710
722
|
.mobile-price-flex-block,
|
|
711
723
|
.mobile-total-price-flex-block {
|
|
712
724
|
display: flex;
|
|
713
|
-
|
|
725
|
+
flex-direction: column;
|
|
726
|
+
|
|
727
|
+
align-items: flex-start;
|
|
714
728
|
gap: var(--sp0-5x);
|
|
715
729
|
}
|
|
716
730
|
|
|
731
|
+
.wrapper-discount {
|
|
732
|
+
flex-direction: row;
|
|
733
|
+
column-gap: var(--sp0-5x);
|
|
734
|
+
align-items: center;
|
|
735
|
+
}
|
|
736
|
+
|
|
717
737
|
.select-and-out-of-stock-mobile-wrap {
|
|
718
738
|
width: var(--account_cartItemSelectFixedWidth);
|
|
719
739
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export default CartTemplate;
|
|
2
|
-
declare function CartTemplate({ children,
|
|
2
|
+
declare function CartTemplate({ children, checkoutUrl, moreMenu, emptyCartIcon }: {
|
|
3
3
|
children: any;
|
|
4
|
-
actions: any;
|
|
5
4
|
checkoutUrl?: string;
|
|
6
5
|
moreMenu: any;
|
|
7
6
|
emptyCartIcon: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { Page, useTranslation } from '@weareconceptstudio/core';
|
|
3
3
|
import { CartItems, EmptyCart } from '..';
|
|
4
4
|
import { TotalCheckout, AccountButton } from '../../../components';
|
|
@@ -12,21 +12,31 @@ const leftArrow = (React.createElement("svg", { fill: 'none', viewBox: '0 0 16 1
|
|
|
12
12
|
import CartTemplateStyle from './style';
|
|
13
13
|
//* Skeleton
|
|
14
14
|
import SkeletonCartTemplate from './Skeleton';
|
|
15
|
-
const CartTemplate = ({ children,
|
|
16
|
-
const { shopUrl, useCart } = useAccountContext();
|
|
15
|
+
const CartTemplate = ({ children, checkoutUrl = '/checkout/', moreMenu, emptyCartIcon }) => {
|
|
17
16
|
const { translate } = useTranslation();
|
|
18
|
-
const {
|
|
17
|
+
const { shopUrl, useCart } = useAccountContext();
|
|
18
|
+
const { items, itemsCount, loading, toggleCartItem, deleteCartItem } = useCart();
|
|
19
|
+
const isFirstRender = useRef(true);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (isFirstRender.current) {
|
|
22
|
+
isFirstRender.current = false;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}, [loading]);
|
|
19
26
|
return (React.createElement(Page, { className: 'cart use-account' },
|
|
20
27
|
React.createElement(AccountContainer, { className: `second-version` },
|
|
21
28
|
React.createElement(CartTemplateStyle, null,
|
|
22
|
-
React.createElement(TotalCheckout, {
|
|
29
|
+
React.createElement(TotalCheckout, { loading: isFirstRender.current, buttonProps: {
|
|
23
30
|
url: checkoutUrl,
|
|
24
31
|
text: 'account.cart_checkout.proceedToCheckout',
|
|
25
|
-
} }, !
|
|
32
|
+
} }, !isFirstRender.current ? (itemsCount > 0 ? (React.createElement(React.Fragment, null,
|
|
26
33
|
shopUrl ? (React.createElement(AccountButton, { url: shopUrl, btnType: `purple-text`, className: `back-to-shop` },
|
|
27
34
|
leftArrow,
|
|
28
35
|
translate('account.general_actions.backToShop'))) : null,
|
|
29
|
-
React.createElement(CartItems, { data: items, smallFontSize: true,
|
|
36
|
+
React.createElement(CartItems, { data: items, smallFontSize: true, className: `cart-st-wrap`, title: 'account.cart_checkout.myCart', actions: {
|
|
37
|
+
add: toggleCartItem,
|
|
38
|
+
delete: deleteCartItem,
|
|
39
|
+
}, additionalParameters: {
|
|
30
40
|
remove: true,
|
|
31
41
|
select: true,
|
|
32
42
|
horizontalLine: true,
|
|
@@ -20,6 +20,13 @@ const CheckoutTemplate = () => {
|
|
|
20
20
|
const { handleCheckout } = useCheckoutContext();
|
|
21
21
|
const { items, itemsCount, loading } = useCart();
|
|
22
22
|
const { user } = useUser();
|
|
23
|
+
const isFirstRender = useRef(true);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (isFirstRender.current) {
|
|
26
|
+
isFirstRender.current = false;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}, [loading]);
|
|
23
30
|
const checkStep = {
|
|
24
31
|
isShipping: !hasCheckoutAddress,
|
|
25
32
|
isReview: hasCheckoutAddress,
|
|
@@ -47,18 +54,19 @@ const CheckoutTemplate = () => {
|
|
|
47
54
|
}
|
|
48
55
|
}, [itemsCount, loading]);
|
|
49
56
|
return (React.createElement(Page, { className: 'checkout use-account' },
|
|
50
|
-
React.createElement(AccountContainer, { className: `second-version` },
|
|
51
|
-
React.createElement(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
React.createElement(AccountContainer, { className: `second-version` },
|
|
58
|
+
React.createElement(CheckoutTemplateStyle, null,
|
|
59
|
+
React.createElement(TotalCheckout, { loading: isFirstRender.current, isShipping: checkStep.isShipping, buttonProps: {
|
|
60
|
+
url: false,
|
|
61
|
+
handleClick: handleCheckoutBtn,
|
|
62
|
+
type: checkStep.isShipping ? 'submit' : 'button',
|
|
63
|
+
text: checkStep.isShipping ? 'account.cart_checkout.proceedToCheckout' : 'account.cart_checkout.proceedToPayment',
|
|
64
|
+
loadingButton: loadingProcessToPayment,
|
|
65
|
+
} }, !addressLoading && itemsCount && user ? (React.createElement(React.Fragment, null,
|
|
66
|
+
React.createElement(Sequence, { step: checkStep.isShipping ? 'shipping' : 'review' }),
|
|
67
|
+
checkStep.isShipping ? React.createElement(StepShipping, { firstStepFormRef: firstStepFormRef }) : React.createElement(StepReview, { items: items }))) : (React.createElement(React.Fragment, null,
|
|
68
|
+
React.createElement(SequenceSkeleton, { className: 'sequence-checkout-template' }),
|
|
69
|
+
React.createElement(SkeletonAddressSelect, { className: 'address-checkout-template' }),
|
|
70
|
+
React.createElement(SkeletonCartTemplate, null))))))));
|
|
63
71
|
};
|
|
64
72
|
export default CheckoutTemplate;
|
|
@@ -3,7 +3,7 @@ import { handlePriceCheckFunc, Text, useTranslation } from '@weareconceptstudio/
|
|
|
3
3
|
import { useAccountContext } from '../../../AccountProvider';
|
|
4
4
|
import OrderStatus from '../OrderStatus';
|
|
5
5
|
import OrderDetailsStyle from './style';
|
|
6
|
-
const OrderDetails = memo(({ className, status, date, orderNumber, itemsCount, total, shippingCost, usedBalance, discounts = [] }) => {
|
|
6
|
+
const OrderDetails = memo(({ className, status, date, orderNumber, itemsCount, total, subtotal, shippingCost, usedBalance, discounts = [] }) => {
|
|
7
7
|
const { translate } = useTranslation();
|
|
8
8
|
const { currency } = useAccountContext();
|
|
9
9
|
return (React.createElement(OrderDetailsStyle, { className: `${className || ''}` },
|
|
@@ -29,20 +29,33 @@ const OrderDetails = memo(({ className, status, date, orderNumber, itemsCount, t
|
|
|
29
29
|
translate('account.order_management.totalItems'),
|
|
30
30
|
":"),
|
|
31
31
|
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1 value`, text: itemsCount })),
|
|
32
|
+
React.createElement("div", { className: `order-detail-item-wrap` },
|
|
33
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1` },
|
|
34
|
+
translate('account.cart_checkout.subtotal'),
|
|
35
|
+
":"),
|
|
36
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1 value` }, handlePriceCheckFunc(subtotal, currency))),
|
|
32
37
|
discounts?.length > 0
|
|
33
|
-
? discounts.map((item, index) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
? discounts.map((item, index) => {
|
|
39
|
+
if (item.discount != 0) {
|
|
40
|
+
return (React.createElement("div", { key: index, className: `order-detail-item-wrap` },
|
|
41
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold discount-color` },
|
|
42
|
+
translate('account.order_balance.discount'),
|
|
43
|
+
" (",
|
|
44
|
+
item.title,
|
|
45
|
+
"):"),
|
|
46
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular value discount-color` },
|
|
47
|
+
"-",
|
|
48
|
+
handlePriceCheckFunc(item.discount, currency))));
|
|
49
|
+
}
|
|
50
|
+
})
|
|
40
51
|
: null,
|
|
41
52
|
usedBalance ? (React.createElement("div", { className: `order-detail-item-wrap` },
|
|
42
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold
|
|
53
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold balance-color` },
|
|
43
54
|
translate('account.balance_promotions.usedBalance'),
|
|
44
55
|
":"),
|
|
45
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-regular
|
|
56
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular balance-color value` },
|
|
57
|
+
"-",
|
|
58
|
+
handlePriceCheckFunc(usedBalance, currency)))) : null,
|
|
46
59
|
shippingCost ? (React.createElement("div", { className: `order-detail-item-wrap` },
|
|
47
60
|
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1` },
|
|
48
61
|
translate('account.order_balance.shippingCost'),
|
|
@@ -6,6 +6,14 @@ const OrderDetailsStyle = styled.section `
|
|
|
6
6
|
--account_statusItemPadLR: var(--sp2-5x);
|
|
7
7
|
--account_orderDetailItemWrapMTop: var(--sp2x);
|
|
8
8
|
|
|
9
|
+
.discount-color {
|
|
10
|
+
color: var(--account_statusCanceledColor);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.balance-color {
|
|
14
|
+
color: var(--account_statusPaymentFailedColor);
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
.info-space-line {
|
|
10
18
|
width: 100%;
|
|
11
19
|
border-bottom: 2px solid var(--account_primaryColor1);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import { handlePriceCheckFunc, Image, Text } from '@weareconceptstudio/core';
|
|
2
|
+
import { handlePriceCheckFunc, Image, Text, useTranslation } from '@weareconceptstudio/core';
|
|
3
3
|
import { useAccountContext } from '../../../../AccountProvider';
|
|
4
4
|
import { AccountButton } from '../../../../components';
|
|
5
5
|
import { defaultIconGift } from '../util';
|
|
6
6
|
const Item = memo(({ data }) => {
|
|
7
7
|
const { handleProductClick, currency } = useAccountContext();
|
|
8
|
+
const { translate } = useTranslation();
|
|
8
9
|
return (React.createElement("div", { className: `item-wrap` },
|
|
9
10
|
React.createElement("div", { className: `item-inner-wrapper` },
|
|
10
11
|
React.createElement("div", { className: `col-item tl-col-1 col-item-1 first-col` },
|
|
@@ -12,7 +13,7 @@ const Item = memo(({ data }) => {
|
|
|
12
13
|
data.is_gift ? React.createElement("div", { className: 'wrapper-gift-icon' }, defaultIconGift) : null,
|
|
13
14
|
React.createElement(Image, { src: data.product?.image?.src, alt: data.product?.image?.alt })),
|
|
14
15
|
React.createElement("div", { className: `col-1-right-wrap` },
|
|
15
|
-
React.createElement(AccountButton, { disabled: !data.product, btnType: `green-large-text`, className: `ordered-item-title`, text: data.product?.name || data
|
|
16
|
+
React.createElement(AccountButton, { disabled: !data.product, btnType: `green-large-text`, className: `ordered-item-title`, text: data.product?.name || data?.product_name, onClick: () => data.product && handleProductClick(data.product) }),
|
|
16
17
|
data.color ? (React.createElement("div", { className: `right-first-item-wrap` },
|
|
17
18
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: `account.general_actions.color` }),
|
|
18
19
|
"\u00A0",
|
|
@@ -26,12 +27,16 @@ const Item = memo(({ data }) => {
|
|
|
26
27
|
React.createElement("div", { className: `col-item tl-col-2` },
|
|
27
28
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.qty })),
|
|
28
29
|
React.createElement("div", { className: `col-item tl-col-3 col-item-3 nowrap` }, data.sale_price && !data.is_gift ? (React.createElement("div", null,
|
|
29
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right`, text: handlePriceCheckFunc(data.sale_price, currency) }),
|
|
30
|
-
React.createElement(
|
|
30
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right order-sale-price`, text: handlePriceCheckFunc(data.sale_price, currency) }),
|
|
31
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
32
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
33
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right order-price1`, text: handlePriceCheckFunc(data.price, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right order-sale-price`, text: handlePriceCheckFunc(data.is_gift ? 0 : data.price, currency) }))),
|
|
31
34
|
React.createElement("div", { className: `col-item tl-col-4 col-item-4 nowrap price-block` },
|
|
32
35
|
React.createElement("div", { className: `col-item-inner-wrap` },
|
|
33
36
|
React.createElement("div", { className: `flex-end-wrap` }, data.sale_total && !data.is_gift ? (React.createElement("div", null,
|
|
34
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right`, text: handlePriceCheckFunc(data.sale_total, currency) }),
|
|
35
|
-
React.createElement(
|
|
37
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right order-sale-price`, text: handlePriceCheckFunc(data.sale_total, currency) }),
|
|
38
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
39
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
40
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right order-price1`, text: handlePriceCheckFunc(data.total, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right order-sale-price`, text: `${handlePriceCheckFunc(data.is_gift ? 0 : data.total, currency)}` }))))))));
|
|
36
41
|
});
|
|
37
42
|
export default Item;
|
|
@@ -12,16 +12,16 @@ const ItemMobile = memo(({ data }) => {
|
|
|
12
12
|
data.is_gift ? React.createElement("div", { className: 'wrapper-gift-icon' }, defaultIconGift) : null,
|
|
13
13
|
React.createElement(Image, { src: data.product?.image?.src, alt: data.product?.image?.alt })),
|
|
14
14
|
React.createElement("div", { className: `mobile-info-wrap` },
|
|
15
|
-
React.createElement(AccountButton, { disabled: !data.product, btnType: `green-large-text`, className: `ordered-item-mobile-title`, text: data.product?.name || data
|
|
15
|
+
React.createElement(AccountButton, { disabled: !data.product, btnType: `green-large-text`, className: `ordered-item-mobile-title`, text: data.product?.name || data?.product_name, onClick: () => data.product && handleProductClick(data.product) }),
|
|
16
16
|
data.color ? (React.createElement("div", { className: `mobile-info-item` },
|
|
17
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-
|
|
17
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: `account.general_actions.color` }),
|
|
18
18
|
"\u00A0",
|
|
19
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-
|
|
19
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1 capitalize`, text: data.color }))) : data.product?.short_info_1 ? (React.createElement("div", { className: `mobile-info-item` },
|
|
20
20
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.product.short_info_1 }))) : null,
|
|
21
21
|
data.size ? (React.createElement("div", { className: `mobile-info-item` },
|
|
22
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-
|
|
22
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: `account.general_actions.size` }),
|
|
23
23
|
"\u00A0",
|
|
24
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-
|
|
24
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1`, text: data.size }))) : data.product?.short_info_2 ? (React.createElement("div", { className: `mobile-info-item` },
|
|
25
25
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.product.short_info_2 }))) : null,
|
|
26
26
|
React.createElement("div", { className: `mobile-info-item` },
|
|
27
27
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1` },
|
|
@@ -31,9 +31,17 @@ const ItemMobile = memo(({ data }) => {
|
|
|
31
31
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.qty })),
|
|
32
32
|
React.createElement("div", { className: `mobile-price-wrap nowrap` },
|
|
33
33
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: `account.order_balance.price` }),
|
|
34
|
-
|
|
34
|
+
data.sale_price && !data.is_gift ? (React.createElement(React.Fragment, null,
|
|
35
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-secondary-color2 sale-price`, text: handlePriceCheckFunc(data.sale_price, currency) }),
|
|
36
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
37
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text-mobile` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
38
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through price1`, text: handlePriceCheckFunc(data.price, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1 price2`, text: handlePriceCheckFunc(data.is_gift ? 0 : data.price, currency) }))),
|
|
35
39
|
React.createElement("div", { className: `mobile-total-price-wrap nowrap` },
|
|
36
40
|
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: `account.order_balance.total` }),
|
|
37
|
-
|
|
41
|
+
data.sale_total && !data.is_gift ? (React.createElement(React.Fragment, null,
|
|
42
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-medium account-secondary-color2 sale-total`, text: handlePriceCheckFunc(data.sale_total, currency) }),
|
|
43
|
+
React.createElement("div", { className: 'wrapper-discount' },
|
|
44
|
+
data.discount ? React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color2 discount-text-mobile` }, translate('account.order_balance.discountWithSymbol', { discount: data.discount })) : null,
|
|
45
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through total1`, text: handlePriceCheckFunc(data.total, currency) })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1 total2`, text: handlePriceCheckFunc(data.is_gift ? 0 : data.total, currency) })))))));
|
|
38
46
|
});
|
|
39
47
|
export default ItemMobile;
|
|
@@ -366,6 +366,13 @@ const OrderedItemsStyle = styled.div `
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
+
.wrapper-discount {
|
|
370
|
+
display: flex;
|
|
371
|
+
flex-direction: column;
|
|
372
|
+
align-items: flex-end;
|
|
373
|
+
column-gap: var(--sp1x);
|
|
374
|
+
}
|
|
375
|
+
|
|
369
376
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
370
377
|
--account_orderItemsMarginTop: var(--sp11x);
|
|
371
378
|
--account_spaceLineMarginTop: var(--sp2x);
|
|
@@ -605,7 +612,7 @@ const OrderedItemsStyle = styled.div `
|
|
|
605
612
|
|
|
606
613
|
//! Col's width
|
|
607
614
|
--account_col1Width: 44%;
|
|
608
|
-
--account_col2Width:
|
|
615
|
+
--account_col2Width: 13%;
|
|
609
616
|
--account_col3Width: 20%;
|
|
610
617
|
|
|
611
618
|
//! Col's distance
|
|
@@ -637,6 +644,10 @@ const OrderedItemsStyle = styled.div `
|
|
|
637
644
|
--account_giftWrapperBorder: var(--sp0-5x);
|
|
638
645
|
--account_giftButtonTB: var(--sp1x);
|
|
639
646
|
--account_giftButtonLR: var(--sp2x);
|
|
647
|
+
|
|
648
|
+
.wrapper-discount {
|
|
649
|
+
column-gap: var(--sp0-5x);
|
|
650
|
+
}
|
|
640
651
|
}
|
|
641
652
|
|
|
642
653
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
@@ -713,6 +724,12 @@ const OrderedItemsStyle = styled.div `
|
|
|
713
724
|
.mobile-price-wrap,
|
|
714
725
|
.mobile-total-price-wrap {
|
|
715
726
|
margin-top: var(--sp3x);
|
|
727
|
+
|
|
728
|
+
.wrapper-discount {
|
|
729
|
+
flex-direction: row;
|
|
730
|
+
align-items: center;
|
|
731
|
+
gap: var(--sp0-5x);
|
|
732
|
+
}
|
|
716
733
|
}
|
|
717
734
|
}
|
|
718
735
|
}
|
|
@@ -17,6 +17,6 @@ const OrderItem = memo(({ data }) => {
|
|
|
17
17
|
React.createElement("div", { className: `col-item od-col-5 nowrap` },
|
|
18
18
|
React.createElement(Text, { className: `account-p account-p4 account-font-medium account-primary-color1`, text: handlePriceCheckFunc(data.total, currency) })),
|
|
19
19
|
React.createElement("div", { className: `col-item od-col-6 nowrap` },
|
|
20
|
-
React.createElement(AccountButton, {
|
|
20
|
+
React.createElement(AccountButton, { btnType: `green-small-text`, url: `/account/order-history/${data.id}`, text: 'account.order_management.viewOrder' }))));
|
|
21
21
|
});
|
|
22
22
|
export default OrderItem;
|
|
@@ -6,7 +6,7 @@ import OrderStatus from '../../OrderStatus';
|
|
|
6
6
|
const ItemMobile = memo(({ data }) => {
|
|
7
7
|
const { currency } = useAccountContext();
|
|
8
8
|
const { translate } = useTranslation();
|
|
9
|
-
return (React.createElement("div", { className: `mobile-
|
|
9
|
+
return (React.createElement("div", { className: `mobile-orders-list-wrap` },
|
|
10
10
|
React.createElement("div", { className: `first-col-wrap` },
|
|
11
11
|
React.createElement("div", { className: `left-wrap` },
|
|
12
12
|
React.createElement("div", { className: `left-item-wrap` },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useState, useEffect, useCallback } from 'react';
|
|
1
|
+
import React, { useMemo, useState, useEffect, useCallback, useRef } from 'react';
|
|
2
2
|
import { Text, useUi, api } from '@weareconceptstudio/core';
|
|
3
3
|
//* Components
|
|
4
4
|
import Item from './Item';
|
|
@@ -9,6 +9,8 @@ import { Pagination } from '../../../components';
|
|
|
9
9
|
import OrdersListStyle from './style';
|
|
10
10
|
const OrdersList = () => {
|
|
11
11
|
const { winWidth } = useUi();
|
|
12
|
+
//! Ref
|
|
13
|
+
const containerRef = useRef();
|
|
12
14
|
const [loading, setLoading] = useState(true);
|
|
13
15
|
const [data, setData] = useState([]);
|
|
14
16
|
const [currentPage, setCurrentPage] = useState(1);
|
|
@@ -47,11 +49,11 @@ const OrdersList = () => {
|
|
|
47
49
|
return (React.createElement(ItemMobile, { key: index, data: item }));
|
|
48
50
|
}))) : null;
|
|
49
51
|
}, [winWidth, data]);
|
|
50
|
-
return !loading && data?.length > 0 ? (React.createElement(OrdersListStyle,
|
|
52
|
+
return !loading && data?.length > 0 ? (React.createElement(OrdersListStyle, { ref: containerRef },
|
|
51
53
|
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: 'account.account_info.orderHistory' }),
|
|
52
54
|
React.createElement("div", { className: `order-history-line` }),
|
|
53
55
|
listStore,
|
|
54
56
|
React.createElement("div", { className: `pagination-wrap` },
|
|
55
|
-
React.createElement(Pagination, { activePageState: currentPage,
|
|
57
|
+
React.createElement(Pagination, { activePageState: currentPage, parentElement: containerRef.current, onChange: (page) => setCurrentPage(page), ...pagination })))) : !loading ? (React.createElement(EmptyOrders, null)) : null;
|
|
56
58
|
};
|
|
57
59
|
export default OrdersList;
|
|
@@ -138,7 +138,7 @@ const OrdersListStyle = styled.section `
|
|
|
138
138
|
|
|
139
139
|
//! Coll width
|
|
140
140
|
--account_orderDateWidth: 16%;
|
|
141
|
-
--account_totalItemsWidth:
|
|
141
|
+
--account_totalItemsWidth: 11.7%;
|
|
142
142
|
--account_orderNumberWidth: 16%;
|
|
143
143
|
--account_orderStatusWidth: 16.7%;
|
|
144
144
|
--account_totalPriceWidth: 22%;
|
|
@@ -316,7 +316,7 @@ const OrdersListStyle = styled.section `
|
|
|
316
316
|
--account_paginationWrapMTop: var(--sp3x);
|
|
317
317
|
|
|
318
318
|
.mobile-orders-wrap {
|
|
319
|
-
.mobile-
|
|
319
|
+
.mobile-orders-list-wrap {
|
|
320
320
|
padding-bottom: var(--sp3x);
|
|
321
321
|
border-bottom: 2px solid var(--account_primaryColor5);
|
|
322
322
|
|
|
@@ -234,6 +234,38 @@ const AccountHelperClass = createGlobalStyle `${css `
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
.account-secondary-color10 {
|
|
238
|
+
color: var(--account_secondaryColor10);
|
|
239
|
+
|
|
240
|
+
&-bg {
|
|
241
|
+
background-color: var(--account_secondaryColor10);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.account-secondary-color11 {
|
|
246
|
+
color: var(--account_secondaryColor11);
|
|
247
|
+
|
|
248
|
+
&-bg {
|
|
249
|
+
background-color: var(--account_secondaryColor11);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.account-secondary-color12 {
|
|
254
|
+
color: var(--account_secondaryColor12);
|
|
255
|
+
|
|
256
|
+
&-bg {
|
|
257
|
+
background-color: var(--account_secondaryColor12);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.account-secondary-color13 {
|
|
262
|
+
color: var(--account_secondaryColor13);
|
|
263
|
+
|
|
264
|
+
&-bg {
|
|
265
|
+
background-color: var(--account_secondaryColor13);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
237
269
|
//! Background color
|
|
238
270
|
.account-background-color {
|
|
239
271
|
color: var(--account_backgroundColor);
|
package/dist/translations/en.js
CHANGED
|
@@ -139,7 +139,7 @@ export default {
|
|
|
139
139
|
save: 'Save',
|
|
140
140
|
done: 'Done',
|
|
141
141
|
shopNow: 'Shop now',
|
|
142
|
-
add: '
|
|
142
|
+
add: 'Add',
|
|
143
143
|
backToShop: 'Back to shop',
|
|
144
144
|
backToLoginPAge: 'Back to log in page',
|
|
145
145
|
continueShopping: 'Continue shopping',
|
|
@@ -213,6 +213,7 @@ export default {
|
|
|
213
213
|
reorder: 'Reorder',
|
|
214
214
|
comment: 'Comment',
|
|
215
215
|
discount: 'Discount',
|
|
216
|
+
discountWithSymbol: '{discount}% off',
|
|
216
217
|
note: 'Note',
|
|
217
218
|
},
|
|
218
219
|
balance_promotions: {
|
package/dist/translations/hy.js
CHANGED
|
@@ -214,6 +214,7 @@ declare const _default: {
|
|
|
214
214
|
reorder: string;
|
|
215
215
|
comment: string;
|
|
216
216
|
discount: string;
|
|
217
|
+
discountWithSymbol: string;
|
|
217
218
|
note: string;
|
|
218
219
|
};
|
|
219
220
|
balance_promotions: {
|
|
@@ -453,6 +454,7 @@ declare const _default: {
|
|
|
453
454
|
reorder: string;
|
|
454
455
|
comment: string;
|
|
455
456
|
discount: string;
|
|
457
|
+
discountWithSymbol: string;
|
|
456
458
|
note: string;
|
|
457
459
|
};
|
|
458
460
|
balance_promotions: {
|
|
@@ -693,6 +695,7 @@ declare const _default: {
|
|
|
693
695
|
reorder: string;
|
|
694
696
|
comment: string;
|
|
695
697
|
discount: string;
|
|
698
|
+
discountWithSymbol: string;
|
|
696
699
|
note: string;
|
|
697
700
|
};
|
|
698
701
|
balance_promotions: {
|
package/dist/translations/ru.js
CHANGED