@bytebrand/fe-ui-core 4.2.185 → 4.2.187
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
|
@@ -37,6 +37,7 @@ interface IProps {
|
|
|
37
37
|
showModal?: (id: string, props?: any) => void;
|
|
38
38
|
hideModal: (id: string) => void;
|
|
39
39
|
onCarFavorite: (event: MouseEvent<HTMLElement>) => void;
|
|
40
|
+
showDownPayment:boolean;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
interface IState {
|
|
@@ -239,6 +240,7 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
|
|
|
239
240
|
showNewLabel,
|
|
240
241
|
make,
|
|
241
242
|
model,
|
|
243
|
+
showDownPayment,
|
|
242
244
|
subModel,
|
|
243
245
|
powerKW,
|
|
244
246
|
powerPS,
|
|
@@ -267,6 +269,7 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
|
|
|
267
269
|
t,
|
|
268
270
|
financingConfig,
|
|
269
271
|
showNewLabel,
|
|
272
|
+
showDownPayment,
|
|
270
273
|
historyPriceDifference: price ? price.historyPriceDifference : 0,
|
|
271
274
|
historyPriceDifferencePerCent: price ? price.historyPriceDifferencePerCent : 0,
|
|
272
275
|
activeTab
|
|
@@ -12,13 +12,14 @@ interface IProps {
|
|
|
12
12
|
historyPriceDifferencePerCent: number;
|
|
13
13
|
financingConfig?:any;
|
|
14
14
|
activeTab?:number;
|
|
15
|
+
showDownPayment:boolean;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const MIN_PERCENT = 5;
|
|
18
19
|
const MIN_PRICE_DIFFERENCE = 500;
|
|
19
20
|
const EUR = `\u20AC`;
|
|
20
21
|
|
|
21
|
-
const PriceData: React.FunctionComponent<IProps> = ({ t, showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, financingConfig, activeTab }) => {
|
|
22
|
+
const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment,showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, financingConfig, activeTab }) => {
|
|
22
23
|
const percentageOfFirstInstallment = activeTab === 0 ? financingConfig!.financing.percentageOfFirstInstallment : financingConfig!.leasing.percentageOfFirstInstallment;
|
|
23
24
|
return (
|
|
24
25
|
<div className={styles.topWrapper}>
|
|
@@ -29,7 +30,7 @@ const PriceData: React.FunctionComponent<IProps> = ({ t, showNewLabel, historyPr
|
|
|
29
30
|
{` ${EUR} ${t('slider.save')}`}
|
|
30
31
|
</Badge>
|
|
31
32
|
)}
|
|
32
|
-
{(!isNil(percentageOfFirstInstallment) && activeTab !== 2) &&
|
|
33
|
+
{(!isNil(percentageOfFirstInstallment) && activeTab !== 2 && showDownPayment) &&
|
|
33
34
|
<Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`${percentageOfFirstInstallment}${percentageOfFirstInstallment > 0 ? '%' : EUR} ${t('slider.firstInstallment')}`}</Badge>}
|
|
34
35
|
{historyPriceDifferencePerCent >= MIN_PERCENT && (
|
|
35
36
|
<Badge type='red' className={styles.priceDifferencePerCent}>
|
|
@@ -604,14 +604,13 @@ export const getUnixTimestampAfterTwoWeeks = () => {
|
|
|
604
604
|
* @returns {number} Return the number of days as the result
|
|
605
605
|
*/
|
|
606
606
|
export const convertUnixTimestampToDays = (unixTimestamp: number) => {
|
|
607
|
-
const milliseconds = unixTimestamp * 1000;
|
|
607
|
+
const milliseconds = Number(unixTimestamp * 1000);
|
|
608
608
|
const date = new Date(milliseconds);
|
|
609
609
|
const currentDate = new Date();
|
|
610
610
|
|
|
611
611
|
// Calculate the difference between the current date and the obtained date
|
|
612
612
|
const timeDifference = currentDate.getTime() - date.getTime();
|
|
613
613
|
const daysDifference = -Math.floor(timeDifference / (1000 * 3600 * 24));
|
|
614
|
-
|
|
615
614
|
return daysDifference;
|
|
616
615
|
};
|
|
617
616
|
|