@bytebrand/fe-ui-core 4.2.20 → 4.2.22
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/package.json +1 -1
- package/source/components/Breadcrumbs/Breadcrumbs.tsx +8 -2
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +4 -3
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +9 -14
- package/source/framework/types/types.ts +1 -0
package/package.json
CHANGED
|
@@ -23,7 +23,13 @@ class Breadcrumbs extends React.PureComponent<IBreadcrumbsProps> {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
onBackButtonClick = () => {
|
|
26
|
+
onBackButtonClick = () => {
|
|
27
|
+
if (document.referrer) {
|
|
28
|
+
window.history.back();
|
|
29
|
+
} else {
|
|
30
|
+
window.location.href = '/search'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
27
33
|
|
|
28
34
|
renderList = (list: LinkItem[]) => {
|
|
29
35
|
const { t = (phrase: string) => _get(breadcrumbsTranslate(), phrase.replace(':', '.'), phrase), page } = this.props;
|
|
@@ -75,7 +81,7 @@ class Breadcrumbs extends React.PureComponent<IBreadcrumbsProps> {
|
|
|
75
81
|
<div className={styles.breadcrumbs}>
|
|
76
82
|
<span className={styles.homeLink}><a href='/search'></a></span>
|
|
77
83
|
{list && list.length ? this.renderList(list) : false}
|
|
78
|
-
{
|
|
84
|
+
{withBackBtn ? this.renderGoBackButton() : false}
|
|
79
85
|
</div>
|
|
80
86
|
{classBreadcrumbsAny ? <FirstInfoBlock {...infoBlockProps} /> : ''}
|
|
81
87
|
</div>
|
|
@@ -26,7 +26,8 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
26
26
|
onAdjustRateClick,
|
|
27
27
|
OfferBlockComponent,
|
|
28
28
|
priceTabActiveIndex,
|
|
29
|
-
offerBlockProps
|
|
29
|
+
offerBlockProps,
|
|
30
|
+
checkoutData
|
|
30
31
|
}) => {
|
|
31
32
|
const priceRatingProps = {
|
|
32
33
|
t,
|
|
@@ -40,6 +41,7 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
40
41
|
t,
|
|
41
42
|
car,
|
|
42
43
|
detailsText,
|
|
44
|
+
checkoutData,
|
|
43
45
|
OfferRequestButtonWrapper,
|
|
44
46
|
priceTabActiveIndex,
|
|
45
47
|
isAdditionalOption: true,
|
|
@@ -50,7 +52,6 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
50
52
|
styles.tabContentPadding,
|
|
51
53
|
{ [styles.tabContentPaddingForBuy]: isBuy }
|
|
52
54
|
);
|
|
53
|
-
|
|
54
55
|
return (
|
|
55
56
|
<>
|
|
56
57
|
<div className={tabContentPaddingClassName}>
|
|
@@ -95,7 +96,7 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
95
96
|
</div>
|
|
96
97
|
) : null}
|
|
97
98
|
</span>
|
|
98
|
-
<div
|
|
99
|
+
<div>
|
|
99
100
|
<PriceRating {...priceRatingProps} />
|
|
100
101
|
<span className={styles.priceInfo}>
|
|
101
102
|
<span className={styles.priceInfoLabel} onClick={onAdjustRateClick}>
|
|
@@ -16,6 +16,7 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
|
|
|
16
16
|
priceTabActiveIndex,
|
|
17
17
|
isAdditionalOption,
|
|
18
18
|
controlsClassContainer,
|
|
19
|
+
checkoutData = {},
|
|
19
20
|
onShowOfferDetails
|
|
20
21
|
}) => {
|
|
21
22
|
const btnEl = useRef(null);
|
|
@@ -30,11 +31,10 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
|
|
|
30
31
|
styles.controlsContainer,
|
|
31
32
|
controlsClassContainer
|
|
32
33
|
);
|
|
33
|
-
|
|
34
34
|
return (
|
|
35
35
|
<>
|
|
36
36
|
<div className={controlsContainerClassName}>
|
|
37
|
-
<OfferRequestButtonWrapper carId={carId} dealerId={dealerId}>
|
|
37
|
+
<OfferRequestButtonWrapper carId={carId} dealerId={dealerId} checkoutData={checkoutData} >
|
|
38
38
|
{(
|
|
39
39
|
onClick: () => void,
|
|
40
40
|
isOfferRequested: boolean,
|
|
@@ -48,21 +48,16 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
|
|
|
48
48
|
const offerButtonClassName = classnames(
|
|
49
49
|
styles.controlButton,
|
|
50
50
|
styles.offerButtonGet,
|
|
51
|
-
{ [styles.offerButtonSuccess]: isOfferRequested },
|
|
52
|
-
{ [styles.isAlternativeButton]: isAlternative || isSale || isAlternativeType
|
|
51
|
+
{ [styles.offerButtonSuccess]: isOfferRequested || !!Object.keys(checkoutData).length },
|
|
52
|
+
{ [styles.isAlternativeButton]: isAlternative || isSale || isAlternativeType}
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
const getRequestButtonTitle = () => {
|
|
56
|
-
if (isSale)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (isOfferRequested) {
|
|
63
|
-
return t('sidebar.successfullyRequested');
|
|
64
|
-
}
|
|
65
|
-
return t('sidebar.requestOffer');
|
|
56
|
+
if (isSale) return t('sidebar.requestOfferSale');
|
|
57
|
+
else if (isAlternativeType) return t('sidebar.importRequest');
|
|
58
|
+
else if (isOfferRequested) return t('CheckoutPage:onlineCheckoutModal.redirectBtn');
|
|
59
|
+
else if (checkoutData && Object.keys(checkoutData).length) return t('vehicleProps:title.toCheckoutCar');
|
|
60
|
+
else return t('sidebar.requestOffer');
|
|
66
61
|
};
|
|
67
62
|
|
|
68
63
|
return (
|
|
@@ -252,6 +252,7 @@ interface IOfferRequestButtonWrapper {
|
|
|
252
252
|
export interface IOfferRequestButtonWrapperProps {
|
|
253
253
|
t?: (key: string, options?: object) => string;
|
|
254
254
|
car: ICar;
|
|
255
|
+
checkoutData: object;
|
|
255
256
|
priceTabActiveIndex?: number;
|
|
256
257
|
detailsText?: string | null;
|
|
257
258
|
isAdditionalOption?: boolean;
|