@weareconceptstudio/account 0.2.7 → 0.2.8
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/TotalCheckout/FreeShippingComp/index.d.ts +1 -1
- package/dist/components/TotalCheckout/FreeShippingComp/index.js +5 -4
- package/dist/components/TotalCheckout/index.js +3 -3
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/ProgressComponent/index.d.ts +12 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/ProgressComponent/index.js +45 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/ProgressComponent/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/ProgressComponent/style.js +54 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.d.ts +9 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.js +27 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/style.js +83 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/index.d.ts +13 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/index.js +35 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/style.js +118 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/ItemHistory/index.d.ts +8 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/ItemHistory/index.js +42 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/ItemHistory/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/ItemHistory/style.js +144 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/index.d.ts +3 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/index.js +42 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/style.js +90 -0
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.d.ts +8 -0
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.js +23 -0
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/index.d.ts +6 -0
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/index.js +77 -0
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/style.js +234 -0
- package/dist/modules/account/AccountBalanceTemplate/index.d.ts +7 -0
- package/dist/modules/account/AccountBalanceTemplate/index.js +31 -0
- package/dist/modules/account/AccountBalanceTemplate/style.d.ts +2 -0
- package/dist/modules/account/AccountBalanceTemplate/style.js +31 -0
- package/dist/modules/account/index.d.ts +1 -0
- package/dist/modules/account/index.js +1 -0
- package/dist/styles/theme.js +3 -0
- package/dist/styles/variables.js +3 -0
- package/dist/translations/en.d.ts +15 -0
- package/dist/translations/en.js +17 -0
- package/dist/translations/hy.d.ts +15 -0
- package/dist/translations/hy.js +17 -0
- package/dist/translations/index.d.ts +45 -0
- package/dist/translations/ru.d.ts +15 -0
- package/dist/translations/ru.js +17 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { useTranslation } from '@weareconceptstudio/core';
|
|
|
3
3
|
import { handlePriceCheckFunc } from '../../../utils/_functions';
|
|
4
4
|
//* Style
|
|
5
5
|
import FreeShippingCompStyle from './style';
|
|
6
|
-
const FreeShippingComp = ({ fakeShippingCost, freeShippingRange, shippingCost, currency
|
|
6
|
+
const FreeShippingComp = ({ fakeShippingCost, freeShippingRange, shippingCost, currency }) => {
|
|
7
7
|
const { translate } = useTranslation();
|
|
8
8
|
return freeShippingRange ? (React.createElement(FreeShippingCompStyle, null,
|
|
9
9
|
React.createElement("svg", { fill: 'none', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg', className: 'free-shipping-comp-icon' },
|
|
@@ -15,8 +15,9 @@ const FreeShippingComp = ({ fakeShippingCost, freeShippingRange, shippingCost, c
|
|
|
15
15
|
React.createElement("svg", { fill: 'none', viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', className: 'free-shipping-comp-icon' },
|
|
16
16
|
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' })),
|
|
17
17
|
React.createElement("span", { className: 'free-shipping-comp-attr' },
|
|
18
|
-
React.createElement("span", null, translate('
|
|
19
|
-
React.createElement("span", { className: 'range-value' },
|
|
20
|
-
|
|
18
|
+
React.createElement("span", null, translate('youHaveReachedFreeShipping')),
|
|
19
|
+
React.createElement("span", { className: 'range-value' },
|
|
20
|
+
handlePriceCheckFunc(fakeShippingCost, currency),
|
|
21
|
+
"!")))) : null;
|
|
21
22
|
};
|
|
22
23
|
export default FreeShippingComp;
|
|
@@ -13,7 +13,7 @@ import TotalCheckoutStyle from './style';
|
|
|
13
13
|
import SkeletonTotalCheckout from './Skeleton';
|
|
14
14
|
// TODO: Shipping Coast
|
|
15
15
|
const fakeShippingCost = 5000;
|
|
16
|
-
const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, itemsCount, subtotal, total, shippingCost, fillCheckoutData, checkoutData, isCheckout = false, loading, freeShippingRange
|
|
16
|
+
const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, itemsCount, subtotal, total, shippingCost, fillCheckoutData, checkoutData, isCheckout = false, loading, freeShippingRange }) => {
|
|
17
17
|
const { currency, useUser } = useAccountContext();
|
|
18
18
|
const { user } = useUser();
|
|
19
19
|
const savedCards = useMemo(() => {
|
|
@@ -54,8 +54,8 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, i
|
|
|
54
54
|
React.createElement("div", { className: `od-item-wrap` },
|
|
55
55
|
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-total`, text: `total` }),
|
|
56
56
|
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-currnecy2`, text: itemsCount ? handlePriceCheckFunc(total, currency) : `0 ${currency}` })),
|
|
57
|
-
React.createElement(FreeShippingComp, { shippingCost: shippingCost, fakeShippingCost: fakeShippingCost, freeShippingRange: freeShippingRange }),
|
|
58
|
-
React.createElement(PromoCodeComp,
|
|
57
|
+
React.createElement(FreeShippingComp, { currency: currency, shippingCost: shippingCost, fakeShippingCost: fakeShippingCost, freeShippingRange: freeShippingRange }),
|
|
58
|
+
React.createElement(PromoCodeComp, null),
|
|
59
59
|
isCheckout && typeof isShipping === 'boolean' && !isShipping ? (React.createElement(React.Fragment, null,
|
|
60
60
|
React.createElement(Input.TextArea, { containerClassName: `comment-field`, placeholder: 'checkoutCommentPlaceholder', onChange: (e) => fillCheckoutData('note', e.target.value), className: `account-p account-p3 account-font-regular account-primary-color1` }),
|
|
61
61
|
React.createElement(Radio.Group, { value: checkoutData.paymentType, onChange: (val) => fillCheckoutData('paymentType', val), options: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default ProgressComponent;
|
|
2
|
+
declare function ProgressComponent({ round, value, maxValue, size, gapSize, strokeWidth, className, percent }: {
|
|
3
|
+
round: any;
|
|
4
|
+
value?: number;
|
|
5
|
+
maxValue?: number;
|
|
6
|
+
size: any;
|
|
7
|
+
gapSize: any;
|
|
8
|
+
strokeWidth: any;
|
|
9
|
+
className: any;
|
|
10
|
+
percent: any;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
import React from 'react';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
//* Styles
|
|
3
|
+
import ProgressComponentStyle from './style';
|
|
4
|
+
import { useUi } from '@weareconceptstudio/core';
|
|
5
|
+
const ProgressComponent = ({ round, value = 50, maxValue = 100, size, gapSize, strokeWidth, className, percent }) => {
|
|
6
|
+
const { winWidth } = useUi();
|
|
7
|
+
const [styleElement, setStyleElement] = useState(null);
|
|
8
|
+
const [progressAnimation, setProgressAnimation] = useState(0);
|
|
9
|
+
function getValue(value) {
|
|
10
|
+
if (typeof value !== 'number' && styleElement) {
|
|
11
|
+
const computedStyle = getComputedStyle(styleElement);
|
|
12
|
+
const tempValue = computedStyle.getPropertyValue(value).trim();
|
|
13
|
+
styleElement.style.setProperty('width', tempValue);
|
|
14
|
+
styleElement.style.width = tempValue;
|
|
15
|
+
const resolvedValue = getComputedStyle(styleElement).width;
|
|
16
|
+
styleElement.style.removeProperty('width');
|
|
17
|
+
return parseInt(resolvedValue.match(/\d+/)[0], 10);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return parseInt(value, 10);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const sizeNumber = getValue(size || '--sizeProgress');
|
|
24
|
+
const strokeWidthNumber = getValue(strokeWidth || '--strokeWidth');
|
|
25
|
+
const gapSizeValue = getValue(gapSize || '--gapDistance');
|
|
26
|
+
const radius = (sizeNumber - strokeWidthNumber) / 2;
|
|
27
|
+
const circumference = 2 * Math.PI * radius;
|
|
28
|
+
const progress = progressAnimation;
|
|
29
|
+
// const progress = percent ? percent : (value / maxValue) * 100;
|
|
30
|
+
const filledLength = (progress / 100) * circumference;
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
setProgressAnimation(percent ? percent : (value / maxValue) * 100);
|
|
34
|
+
}, 10);
|
|
35
|
+
}, []);
|
|
36
|
+
return (React.createElement(ProgressComponentStyle, { ref: (element) => setStyleElement(element) }, sizeNumber ? (React.createElement("div", { className: `${className || ' '} progress-wrapper`, style: { position: 'relative', width: `${size}`, height: `${size}` } },
|
|
37
|
+
React.createElement("svg", { width: sizeNumber, height: sizeNumber, viewBox: `0 0 ${sizeNumber} ${sizeNumber}`, style: { transform: 'rotate(-90deg)' } },
|
|
38
|
+
React.createElement("circle", { cx: sizeNumber / 2, cy: sizeNumber / 2, r: radius, stroke: '#E9ECEE', strokeWidth: strokeWidthNumber, fill: 'none', strokeDasharray: `${circumference - filledLength - gapSizeValue * 2} ${filledLength + gapSizeValue}`, strokeDashoffset: circumference - filledLength - gapSizeValue * 2, strokeLinecap: round ? 'round' : 'none' }),
|
|
39
|
+
React.createElement("circle", { cx: sizeNumber / 2, cy: sizeNumber / 2, r: radius, stroke: 'url(#gradient)', strokeWidth: strokeWidthNumber, fill: 'none', strokeDasharray: `${filledLength} ${circumference - filledLength}`, strokeDashoffset: 0, strokeLinecap: round ? 'round' : 'none' }),
|
|
40
|
+
React.createElement("defs", null,
|
|
41
|
+
React.createElement("linearGradient", { id: 'gradient', x1: '1', y1: '0', x2: '0', y2: '1' },
|
|
42
|
+
React.createElement("stop", { offset: '0%', stopColor: '#a000ff' }),
|
|
43
|
+
React.createElement("stop", { offset: '100%', stopColor: '#ff007a' })))))) : null));
|
|
44
|
+
};
|
|
45
|
+
export default ProgressComponent;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default ProgressComponentStyle;
|
|
2
|
+
declare const ProgressComponentStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
const ProgressComponentStyle = styled.div `
|
|
3
|
+
/* --sizeProgress: var(--sp67x); */
|
|
4
|
+
|
|
5
|
+
--sizeProgress: 100%;
|
|
6
|
+
--strokeWidth: calc(var(--sizeProgress) * 4 / 100);
|
|
7
|
+
--gapDistance: calc(var(--sizeProgress) * 6 / 100);
|
|
8
|
+
|
|
9
|
+
.progress-wrapper {
|
|
10
|
+
height: fit-content;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
svg {
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* //! 1920 */
|
|
20
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
21
|
+
/* --sizeProgress: var(--sp51x); */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* //! 1510 */
|
|
25
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
26
|
+
/* --sizeProgress: var(--sp51x); */
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* //! 1440 */
|
|
30
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
31
|
+
/* --sizeProgress: var(--sp37x); */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* //! 1280 */
|
|
35
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
36
|
+
/* --sizeProgress: var(--sp34x); */
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* //! 1024 */
|
|
40
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
41
|
+
/* --sizeProgress: var(--sp35x); */
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* //! 768 */
|
|
45
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
46
|
+
/* --sizeProgress: var(--sp35x); */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* //! mobile */
|
|
50
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
51
|
+
/* --sizeProgress: var(--sp46x); */
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export default ProgressComponentStyle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default ProgressBalance;
|
|
2
|
+
declare function ProgressBalance({ progress, balance, nextStatusValue, nextStatusTitle, iconValue }: {
|
|
3
|
+
progress: any;
|
|
4
|
+
balance: any;
|
|
5
|
+
nextStatusValue: any;
|
|
6
|
+
nextStatusTitle: any;
|
|
7
|
+
iconValue: any;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
import React from 'react';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
// //* Styles
|
|
3
|
+
import ProgressBalanceStyle from './style';
|
|
4
|
+
import ProgressComponent from './ProgressComponent';
|
|
5
|
+
import { Icon, Text, useTranslation } from '@weareconceptstudio/core';
|
|
6
|
+
import { handlePriceCheckFunc } from '../../../../../utils/_functions';
|
|
7
|
+
const ProgressBalance = ({ progress, balance, nextStatusValue, nextStatusTitle, iconValue }) => {
|
|
8
|
+
const { translate } = useTranslation();
|
|
9
|
+
return (React.createElement(ProgressBalanceStyle, null,
|
|
10
|
+
React.createElement("div", { className: 'wrapper-progress-inner-info' },
|
|
11
|
+
React.createElement(ProgressComponent, { className: 'circular-progress', percent: progress, round: true }),
|
|
12
|
+
balance || balance == 0 ? (React.createElement("div", { className: 'wrapper-progress-text' },
|
|
13
|
+
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 first-letter balance-title' }, translate('progressBalanceTitle')),
|
|
14
|
+
React.createElement(Text, { className: 'account-primary-color1 account-h5 first-letter balance-value' }, typeof balance == 'number' ? handlePriceCheckFunc(balance, translate('priceValue')) : balance))) : null),
|
|
15
|
+
nextStatusValue ? (React.createElement("div", { className: 'wrapper-next-status' },
|
|
16
|
+
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 text-center next-status-text' },
|
|
17
|
+
translate('balanceNextStatusDescription1'),
|
|
18
|
+
' ',
|
|
19
|
+
React.createElement(Text, { className: 'account-font-medium next-status-value', tag: 'span' },
|
|
20
|
+
typeof nextStatusValue == 'number' ? handlePriceCheckFunc(nextStatusValue, '').trim() : nextStatusValue,
|
|
21
|
+
iconValue || null),
|
|
22
|
+
' ',
|
|
23
|
+
translate('balanceNextStatusDescription2'),
|
|
24
|
+
' ',
|
|
25
|
+
React.createElement(Text, { className: 'account-secondary-color9 account-font-medium next-status-title', tag: 'span' }, nextStatusTitle)))) : null));
|
|
26
|
+
};
|
|
27
|
+
export default ProgressBalance;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default ProgressBalanceStyle;
|
|
2
|
+
declare const ProgressBalanceStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
const ProgressBalanceStyle = styled.div `
|
|
3
|
+
--account_next_status_padLR: var(--sp13x);
|
|
4
|
+
/* --sizeProgress: var(--sp67x); */
|
|
5
|
+
--sizeProgress: 100%;
|
|
6
|
+
--account_distance_progress: var(--sp4x);
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
max-width: var(--sizeProgress);
|
|
11
|
+
gap: var(--account_distance_progress);
|
|
12
|
+
|
|
13
|
+
.wrapper-progress-inner-info {
|
|
14
|
+
position: relative;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.wrapper-progress-text {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: var(--sizeProgress);
|
|
25
|
+
height: var(--sizeProgress);
|
|
26
|
+
top: 0;
|
|
27
|
+
padding: calc(var(--sizeProgress) * 4 / 100);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.wrapper-next-status {
|
|
31
|
+
padding: 0 var(--account_next_status_padLR);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* //! 1920 */
|
|
35
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
36
|
+
/* --sizeProgress: var(--sp51x); */
|
|
37
|
+
--account_next_status_padLR: var(--sp9x);
|
|
38
|
+
--account_distance_progress: var(--sp3x);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* //! 1510 */
|
|
42
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
43
|
+
/* --sizeProgress: var(--sp51x); */
|
|
44
|
+
--account_next_status_padLR: var(--sp4x);
|
|
45
|
+
--account_distance_progress: var(--sp3x);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* //! 1440 */
|
|
49
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
50
|
+
/* --sizeProgress: var(--sp37x); */
|
|
51
|
+
--account_next_status_padLR: calc(var(--sp4x) - var(--sp0-5x) / 2);
|
|
52
|
+
--account_distance_progress: var(--sp3x);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* //! 1280 */
|
|
56
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
57
|
+
/* --sizeProgress: var(--sp34x); */
|
|
58
|
+
--account_next_status_padLR: var(--sp3x);
|
|
59
|
+
--account_distance_progress: var(--sp3x);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* //! 1024 */
|
|
63
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
64
|
+
/* --sizeProgress: var(--sp35x); */
|
|
65
|
+
--account_next_status_padLR: var(--sp3x);
|
|
66
|
+
--account_distance_progress: var(--sp2-5x);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* //! 768 */
|
|
70
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
71
|
+
/* --sizeProgress: var(--sp35x); */
|
|
72
|
+
--account_next_status_padLR: var(--sp3x);
|
|
73
|
+
--account_distance_progress: var(--sp2-5x);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* //! mobile */
|
|
77
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
78
|
+
/* --sizeProgress: var(--sp46x); */
|
|
79
|
+
--account_next_status_padLR: 0px;
|
|
80
|
+
--account_distance_progress: var(--sp3x);
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
export default ProgressBalanceStyle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default HeroBalance;
|
|
2
|
+
declare function HeroBalance({ iconValue, balance, cashback, progress, totalSpent, nextStatusValue, description, title, nextStatusTitle }: {
|
|
3
|
+
iconValue: any;
|
|
4
|
+
balance: any;
|
|
5
|
+
cashback: any;
|
|
6
|
+
progress: any;
|
|
7
|
+
totalSpent: any;
|
|
8
|
+
nextStatusValue: any;
|
|
9
|
+
description: any;
|
|
10
|
+
title: any;
|
|
11
|
+
nextStatusTitle: any;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
import React from 'react';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, useTranslation } from '@weareconceptstudio/core';
|
|
3
|
+
//* Styles
|
|
4
|
+
import HeroBalanceStyle from './style';
|
|
5
|
+
//* Helpers
|
|
6
|
+
import { handlePriceCheckFunc } from '../../../../utils/_functions';
|
|
7
|
+
//* Component
|
|
8
|
+
import ProgressBalance from './ProgressBalance';
|
|
9
|
+
const HeroBalance = ({ iconValue, balance, cashback, progress, totalSpent, nextStatusValue, description, title, nextStatusTitle }) => {
|
|
10
|
+
const { translate } = useTranslation();
|
|
11
|
+
const dataInformation = [cashback, totalSpent, balance];
|
|
12
|
+
const dataInformationTitle = ['balanceCashback', 'balanceTotalSpent', 'specialNameBalance'];
|
|
13
|
+
return (React.createElement(HeroBalanceStyle, { className: 'account-hero-balance' },
|
|
14
|
+
React.createElement("div", { className: 'inner-wrapper' },
|
|
15
|
+
React.createElement("div", { className: 'left-bar-account-balance' },
|
|
16
|
+
React.createElement("div", { className: 'inner-wrapper-left-bar' },
|
|
17
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p3 first-letter status-title', text: 'balanceStatus' }),
|
|
18
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-h5 first-letter text-title' }, title),
|
|
19
|
+
description && (React.createElement(Text, { className: 'account-primary-color1 account-p account-p2 first-letter description-status' },
|
|
20
|
+
description.description1,
|
|
21
|
+
" ",
|
|
22
|
+
cashback + '%',
|
|
23
|
+
" ",
|
|
24
|
+
description.description2)),
|
|
25
|
+
React.createElement("div", { className: 'wrapper-information-payment' }, dataInformation.map((item, i, arr) => {
|
|
26
|
+
return ((item || item == 0) && (React.createElement(Text, { key: i, className: 'account-primary-color1 account-p account-p3 first-letter account-font-medium info-text' },
|
|
27
|
+
translate(dataInformationTitle[i]),
|
|
28
|
+
":",
|
|
29
|
+
' ',
|
|
30
|
+
React.createElement(Text, { tag: 'span', className: 'account-primary-color1 account-p account-p3 first-letter account-font-regular info-value-text' }, arr[0] == item ? item + '%' : typeof item == 'number' ? handlePriceCheckFunc(item, translate('priceValue')) : item))));
|
|
31
|
+
})))),
|
|
32
|
+
React.createElement("div", { className: 'empty' }),
|
|
33
|
+
React.createElement(ProgressBalance, { iconValue: iconValue, balance: balance, progress: progress, nextStatusValue: nextStatusValue, nextStatusTitle: nextStatusTitle }))));
|
|
34
|
+
};
|
|
35
|
+
export default HeroBalance;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default HeroBalanceStyle;
|
|
2
|
+
declare const HeroBalanceStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
const HeroBalanceStyle = styled.section `
|
|
3
|
+
--account_distance_balance: var(--sp2x);
|
|
4
|
+
--account_title_distance_bottom: var(--sp3x);
|
|
5
|
+
--account_description_distance_T: var(--sp3x);
|
|
6
|
+
--account_description_distance_B: var(--sp4x);
|
|
7
|
+
--account_distance_leftRightBar: var(--sp30x);
|
|
8
|
+
--account_hero_section_distance: var(--sp6x);
|
|
9
|
+
|
|
10
|
+
margin-bottom: var(--account_hero_section_distance);
|
|
11
|
+
|
|
12
|
+
.status-title {
|
|
13
|
+
margin-bottom: var(--account_title_distance_bottom);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.description-status {
|
|
17
|
+
margin-top: var(--account_description_distance_T);
|
|
18
|
+
margin-bottom: var(--account_description_distance_B);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.inner-wrapper {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: 4fr 1fr 3fr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.left-bar-account-balance {
|
|
27
|
+
.wrapper-information-payment {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--account_distance_balance);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* //! 1920 */
|
|
35
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
36
|
+
--account_distance_balance: var(--sp1x);
|
|
37
|
+
--account_title_distance_bottom: var(--sp2x);
|
|
38
|
+
--account_description_distance_T: var(--sp2x);
|
|
39
|
+
--account_description_distance_B: var(--sp3x);
|
|
40
|
+
--account_distance_leftRightBar: var(--sp24x);
|
|
41
|
+
--account_hero_section_distance: var(--sp10x);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* //! 1510 */
|
|
45
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
46
|
+
--account_distance_balance: var(--sp1x);
|
|
47
|
+
--account_title_distance_bottom: var(--sp2x);
|
|
48
|
+
--account_description_distance_T: var(--sp2x);
|
|
49
|
+
--account_description_distance_B: var(--sp3x);
|
|
50
|
+
--account_distance_leftRightBar: var(--sp18x);
|
|
51
|
+
--account_hero_section_distance: var(--sp8x);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* //! 1440 */
|
|
55
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
56
|
+
--account_distance_balance: var(--sp1x);
|
|
57
|
+
--account_title_distance_bottom: var(--sp2x);
|
|
58
|
+
--account_description_distance_T: var(--sp2x);
|
|
59
|
+
--account_description_distance_B: var(--sp2x);
|
|
60
|
+
--account_distance_leftRightBar: var(--sp18x);
|
|
61
|
+
--account_hero_section_distance: var(--sp7x);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* //! 1280 */
|
|
65
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
66
|
+
--account_distance_balance: var(--sp1x);
|
|
67
|
+
--account_title_distance_bottom: var(--sp1x);
|
|
68
|
+
--account_description_distance_T: var(--sp1x);
|
|
69
|
+
--account_description_distance_B: var(--sp2x);
|
|
70
|
+
--account_distance_leftRightBar: var(--sp15x);
|
|
71
|
+
--account_hero_section_distance: var(--sp5x);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* //! 1024 */
|
|
75
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
76
|
+
--account_distance_balance: var(--sp1x);
|
|
77
|
+
--account_title_distance_bottom: var(--sp1x);
|
|
78
|
+
--account_description_distance_T: var(--sp1x);
|
|
79
|
+
--account_description_distance_B: var(--sp2x);
|
|
80
|
+
--account_distance_leftRightBar: var(--sp5x);
|
|
81
|
+
--account_hero_section_distance: var(--sp3x);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* //! 768 */
|
|
85
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
86
|
+
--account_distance_balance: var(--sp1x);
|
|
87
|
+
--account_title_distance_bottom: var(--sp1x);
|
|
88
|
+
--account_description_distance_T: var(--sp1x);
|
|
89
|
+
--account_description_distance_B: var(--sp2x);
|
|
90
|
+
--account_distance_leftRightBar: var(--sp5x);
|
|
91
|
+
--account_hero_section_distance: var(--sp3x);
|
|
92
|
+
|
|
93
|
+
.inner-wrapper {
|
|
94
|
+
grid-template-columns: 6.5fr 0.5fr 5fr;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* //! mobile */
|
|
99
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
100
|
+
--account_distance_balance: var(--sp1x);
|
|
101
|
+
--account_title_distance_bottom: var(--sp1x);
|
|
102
|
+
--account_description_distance_T: var(--sp1x);
|
|
103
|
+
--account_description_distance_B: var(--sp2x);
|
|
104
|
+
--account_distance_leftRightBar: var(--sp4x);
|
|
105
|
+
--account_hero_section_distance: var(--sp5x);
|
|
106
|
+
|
|
107
|
+
.inner-wrapper {
|
|
108
|
+
.empty {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
grid-template-rows: repeat(2, auto);
|
|
113
|
+
grid-template-columns: auto;
|
|
114
|
+
gap: var(--sp4x);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
export default HeroBalanceStyle;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Text, useTranslation } from '@weareconceptstudio/core';
|
|
3
|
+
//* Styles
|
|
4
|
+
import ItemHistoryStyle from './style';
|
|
5
|
+
const ItemHistory = ({ date, activity, value, action_type }) => {
|
|
6
|
+
const { translate } = useTranslation();
|
|
7
|
+
//! Refs
|
|
8
|
+
const titleWrapperRef = useRef();
|
|
9
|
+
const getSizeItem = useRef();
|
|
10
|
+
const innerWrapperRef = useRef();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
titleWrapperRef.current = document.getElementById('history-category-title');
|
|
13
|
+
if (titleWrapperRef.current && innerWrapperRef.current) {
|
|
14
|
+
getSizeItem.current = [...titleWrapperRef.current.children].map((item) => item.getBoundingClientRect().left);
|
|
15
|
+
getSizeItem.current = getSizeItem.current.slice(1).map((item, i) => {
|
|
16
|
+
return item - getSizeItem.current[i];
|
|
17
|
+
});
|
|
18
|
+
getSizeItem.current.pop();
|
|
19
|
+
[...innerWrapperRef.current.children].forEach((item, i) => {
|
|
20
|
+
if (getSizeItem.current[i]) {
|
|
21
|
+
item.style.width = getSizeItem.current[i] + 'px';
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, []);
|
|
26
|
+
return (React.createElement(ItemHistoryStyle, null,
|
|
27
|
+
React.createElement("div", { className: 'inner-wrapper-info', ref: innerWrapperRef },
|
|
28
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 date-info-text' },
|
|
29
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p1 mobile-date-info-text first-letter', tag: 'span' },
|
|
30
|
+
translate('balanceCategoryDate'),
|
|
31
|
+
":"),
|
|
32
|
+
' ',
|
|
33
|
+
date),
|
|
34
|
+
React.createElement("div", { className: 'wrapper-activity-text' },
|
|
35
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 activity-info-text' }, activity)),
|
|
36
|
+
React.createElement(Text, { className: `account-primary-color1 account-font-medium account-p account-p1 amount-info-text ${action_type}` },
|
|
37
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p1 mobile-amount-info-text first-letter', tag: 'span' }, translate('balanceCategoryAmount')),
|
|
38
|
+
' ',
|
|
39
|
+
value)),
|
|
40
|
+
React.createElement("div", { className: 'line-info' })));
|
|
41
|
+
};
|
|
42
|
+
export default ItemHistory;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default ItemHistoryStyle;
|
|
2
|
+
declare const ItemHistoryStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|