@bytebrand/fe-ui-core 4.8.47 → 4.8.48
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.
|
Binary file
|
package/package.json
CHANGED
|
@@ -44,6 +44,8 @@ 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;
|
|
47
49
|
handleSentryInit?: () => void;
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -308,6 +310,8 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
|
|
|
308
310
|
make,
|
|
309
311
|
model,
|
|
310
312
|
showDownPayment,
|
|
313
|
+
financingFirstInstallment,
|
|
314
|
+
leasingFirstInstallment,
|
|
311
315
|
subModel,
|
|
312
316
|
powerKW,
|
|
313
317
|
powerPS,
|
|
@@ -334,9 +338,10 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
|
|
|
334
338
|
|
|
335
339
|
const priceProps = {
|
|
336
340
|
t,
|
|
337
|
-
financingConfig,
|
|
338
341
|
showNewLabel,
|
|
339
342
|
showDownPayment,
|
|
343
|
+
financingFirstInstallment,
|
|
344
|
+
leasingFirstInstallment,
|
|
340
345
|
historyPriceDifference: price ? price.historyPriceDifference : 0,
|
|
341
346
|
historyPriceDifferencePerCent: price ? price.historyPriceDifferencePerCent : 0,
|
|
342
347
|
activeTab
|
|
@@ -3,24 +3,25 @@ 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';
|
|
7
6
|
|
|
8
7
|
interface IProps {
|
|
9
8
|
t: (phrase: string, config?: any) => string;
|
|
10
9
|
showNewLabel: boolean;
|
|
11
10
|
historyPriceDifference: number;
|
|
12
11
|
historyPriceDifferencePerCent: number;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
activeTab?: number;
|
|
13
|
+
showDownPayment: boolean;
|
|
14
|
+
financingFirstInstallment?: number | null;
|
|
15
|
+
leasingFirstInstallment?: number | null;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const MIN_PERCENT = 5;
|
|
19
19
|
const MIN_PRICE_DIFFERENCE = 500;
|
|
20
20
|
const EUR = `\u20AC`;
|
|
21
21
|
|
|
22
|
-
const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment,showNewLabel, historyPriceDifference, historyPriceDifferencePerCent,
|
|
23
|
-
const
|
|
22
|
+
const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment, showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, activeTab, financingFirstInstallment, leasingFirstInstallment }) => {
|
|
23
|
+
const relevantFirstInstallment = activeTab === 0 ? financingFirstInstallment : activeTab === 1 ? leasingFirstInstallment : null;
|
|
24
|
+
const showZeroDownPayment = showDownPayment && relevantFirstInstallment === 0;
|
|
24
25
|
return (
|
|
25
26
|
<div className={styles.topWrapper}>
|
|
26
27
|
{showNewLabel && <Badge type='blue' className={styles.new}>{t('slider.new')}</Badge>}
|
|
@@ -30,8 +31,8 @@ const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment,showNew
|
|
|
30
31
|
{` ${EUR} ${t('slider.save')}`}
|
|
31
32
|
</Badge>
|
|
32
33
|
)}
|
|
33
|
-
{
|
|
34
|
-
<Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{
|
|
34
|
+
{showZeroDownPayment &&
|
|
35
|
+
<Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`0${EUR} ${t('slider.firstInstallment')}`}</Badge>}
|
|
35
36
|
{historyPriceDifferencePerCent >= MIN_PERCENT && (
|
|
36
37
|
<Badge type='red' className={styles.priceDifferencePerCent}>
|
|
37
38
|
-{historyPriceDifferencePerCent}%
|
|
@@ -161,7 +161,7 @@ const withStats = (WrappedComponent: any) => ({
|
|
|
161
161
|
</Badge>
|
|
162
162
|
)}
|
|
163
163
|
{showDownPayment && (
|
|
164
|
-
<Badge type='
|
|
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>
|