@bytebrand/fe-ui-core 4.8.52 → 4.8.53

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.8.52",
3
+ "version": "4.8.53",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -16,7 +16,6 @@ const OfferCheckboxGroup: FC<IOfferPeriod> = ({ additionalService, transferInsta
16
16
  return (
17
17
  <div className={offerGroupClass}>
18
18
  {isAboAccordionExpanded0 && <CheckboxContainer {...additionalService } />}
19
- {priceTabIndex === 2 && <CheckboxContainer {...{ ...transferInstallments, isAboAccordionExpanded0 }} />}
20
19
  </div>
21
20
  );
22
21
  };
@@ -44,8 +44,6 @@ interface IProps {
44
44
  hideModal: (id: string) => void;
45
45
  onCarFavorite: (event: MouseEvent<HTMLElement>) => void;
46
46
  showDownPayment: boolean;
47
- financingFirstInstallment?: number | null;
48
- leasingFirstInstallment?: number | null;
49
47
  handleSentryInit?: () => void;
50
48
  }
51
49
 
@@ -310,8 +308,6 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
310
308
  make,
311
309
  model,
312
310
  showDownPayment,
313
- financingFirstInstallment,
314
- leasingFirstInstallment,
315
311
  subModel,
316
312
  powerKW,
317
313
  powerPS,
@@ -341,8 +337,6 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
341
337
  financingConfig,
342
338
  showNewLabel,
343
339
  showDownPayment,
344
- financingFirstInstallment,
345
- leasingFirstInstallment,
346
340
  historyPriceDifference: price ? price.historyPriceDifference : 0,
347
341
  historyPriceDifferencePerCent: price ? price.historyPriceDifferencePerCent : 0,
348
342
  activeTab
@@ -3,28 +3,24 @@ import FormattedNumber from '../../FormattedNumber/FormattedNumber';
3
3
  import Badge from '../../_common/Badge/Badge';
4
4
 
5
5
  import styles from './PriceData.styl';
6
+ import { isNil } from 'lodash';
6
7
 
7
8
  interface IProps {
8
9
  t: (phrase: string, config?: any) => string;
9
10
  showNewLabel: boolean;
10
11
  historyPriceDifference: number;
11
12
  historyPriceDifferencePerCent: number;
12
- financingConfig?: any;
13
- activeTab?: number;
14
- showDownPayment: boolean;
15
- financingFirstInstallment?: number | null;
16
- leasingFirstInstallment?: number | null;
13
+ financingConfig?:any;
14
+ activeTab?:number;
15
+ showDownPayment:boolean;
17
16
  }
18
17
 
19
18
  const MIN_PERCENT = 5;
20
19
  const MIN_PRICE_DIFFERENCE = 500;
21
- const EUR = `€`;
20
+ const EUR = `\u20AC`;
22
21
 
23
- const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment, showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, activeTab, financingFirstInstallment, leasingFirstInstallment }) => {
24
- const showDownPaymentBadge = showDownPayment && (
25
- (activeTab === 0 && financingFirstInstallment === 0) ||
26
- (activeTab === 1 && leasingFirstInstallment === 0)
27
- );
22
+ const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment,showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, financingConfig, activeTab }) => {
23
+ const percentageOfFirstInstallment = activeTab === 0 ? financingConfig!.financing.percentageOfFirstInstallment : financingConfig!.leasing.percentageOfFirstInstallment;
28
24
  return (
29
25
  <div className={styles.topWrapper}>
30
26
  {showNewLabel && <Badge type='blue' className={styles.new}>{t('slider.new')}</Badge>}
@@ -34,8 +30,8 @@ const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment, showNe
34
30
  {` ${EUR} ${t('slider.save')}`}
35
31
  </Badge>
36
32
  )}
37
- {showDownPaymentBadge &&
38
- <Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`0${EUR} ${t('slider.firstInstallment')}`}</Badge>}
33
+ {(!isNil(percentageOfFirstInstallment) && activeTab !== 2 && showDownPayment) &&
34
+ <Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`${percentageOfFirstInstallment}${percentageOfFirstInstallment > 0 ? '%' : EUR} ${t('slider.firstInstallment')}`}</Badge>}
39
35
  {historyPriceDifferencePerCent >= MIN_PERCENT && (
40
36
  <Badge type='red' className={styles.priceDifferencePerCent}>
41
37
  -{historyPriceDifferencePerCent}%
@@ -161,7 +161,7 @@ const withStats = (WrappedComponent: any) => ({
161
161
  </Badge>
162
162
  )}
163
163
  {showDownPayment && (
164
- <Badge type='blue' className={styles.badgeItem}>
164
+ <Badge type='lightBlue' className={styles.badgeItem}>
165
165
  <span className={styles.badgeFull}>{downPaymentText}</span>
166
166
  <span className={styles.badgeShort}>{downPaymentShortText}</span>
167
167
  </Badge>