@bytebrand/fe-ui-core 4.2.21 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.2.21",
3
+ "version": "4.2.22",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -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 className={styles.wrapper}>
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
- return t('sidebar.requestOfferSale');
58
- }
59
- if (isAlternativeType) {
60
- return t('sidebar.importRequest');
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;