@bytebrand/fe-ui-core 4.1.136 → 4.1.137
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
|
@@ -25,10 +25,31 @@ const DealerInfo = ({ infoSections, t, dealerPrice, link, linkName, currentSales
|
|
|
25
25
|
onCurrentSalesPriceChange(Math.max(currentSalesPrice, newPrice));
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
const handlePriceUpdating = () => {
|
|
29
|
+
if (isPriceUpdating) {
|
|
30
|
+
handleSubmit();
|
|
31
|
+
} else {
|
|
32
|
+
setPriceUpdating(true);
|
|
33
|
+
setTimeout(
|
|
34
|
+
() => {
|
|
35
|
+
inputRef.current.focus();
|
|
36
|
+
},
|
|
37
|
+
200
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
28
42
|
const onPriceChange = (e: any) => {
|
|
29
43
|
const newPrice = +e.target.value;
|
|
30
44
|
setNewPrice(Math.max(0, newPrice));
|
|
31
45
|
};
|
|
46
|
+
|
|
47
|
+
const onEnterSubmit = (e: any) => {
|
|
48
|
+
if (e.key === 'Enter') {
|
|
49
|
+
handleSubmit();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
32
53
|
const ourMargin = newPrice - dealerPrice;
|
|
33
54
|
|
|
34
55
|
return (
|
|
@@ -99,44 +120,48 @@ const DealerInfo = ({ infoSections, t, dealerPrice, link, linkName, currentSales
|
|
|
99
120
|
<span>
|
|
100
121
|
{t('vehicleProps:alternative.ourPrice')}
|
|
101
122
|
</span>
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
<div className={styles.editFieldWrapper}>
|
|
124
|
+
{isPriceUpdating
|
|
125
|
+
? <div className={styles.ourPriceBlock}>
|
|
126
|
+
<input
|
|
127
|
+
className={styles.ourPriceInput}
|
|
128
|
+
type='number'
|
|
129
|
+
value={newPrice}
|
|
130
|
+
onChange={e => onPriceChange(e)}
|
|
131
|
+
ref={inputRef}
|
|
132
|
+
onBlur={handleSubmit}
|
|
133
|
+
onKeyPress={onEnterSubmit}
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
: <span onClick={
|
|
137
|
+
() => {
|
|
138
|
+
setPriceUpdating(true);
|
|
139
|
+
setTimeout(
|
|
140
|
+
() => {
|
|
141
|
+
inputRef.current.focus();
|
|
142
|
+
},
|
|
143
|
+
200
|
|
144
|
+
);
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<VehicleFormattedPrice
|
|
148
|
+
className={classnames(styles.price, styles.ourPrice)}
|
|
149
|
+
numbersAfterDot={0}
|
|
150
|
+
price={newPrice}
|
|
151
|
+
unit='€'
|
|
152
|
+
isNew={true}
|
|
153
|
+
numberContainerClassName={styles.numberContainer}
|
|
154
|
+
unitWrapperClassName={styles.unitWrapper}
|
|
155
|
+
unitClassName={styles.unit}
|
|
156
|
+
monthlyClassName={styles.monthly}
|
|
111
157
|
/>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
setTimeout(
|
|
120
|
-
() => {
|
|
121
|
-
inputRef.current.focus();
|
|
122
|
-
},
|
|
123
|
-
200
|
|
124
|
-
);
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
<VehicleFormattedPrice
|
|
128
|
-
className={classnames(styles.price, styles.ourPrice)}
|
|
129
|
-
numbersAfterDot={0}
|
|
130
|
-
price={newPrice}
|
|
131
|
-
unit='€'
|
|
132
|
-
isNew={true}
|
|
133
|
-
numberContainerClassName={styles.numberContainer}
|
|
134
|
-
unitWrapperClassName={styles.unitWrapper}
|
|
135
|
-
unitClassName={styles.unit}
|
|
136
|
-
monthlyClassName={styles.monthly}
|
|
137
|
-
/>
|
|
138
|
-
</span>}
|
|
139
|
-
</span>
|
|
158
|
+
</span>
|
|
159
|
+
}
|
|
160
|
+
<span className={styles.editIconBlock} onClick={handlePriceUpdating}>
|
|
161
|
+
<IconSVG className={styles.editIcon} customDimensions name='editPriceIcon'></IconSVG>
|
|
162
|
+
</span>
|
|
163
|
+
</div>
|
|
164
|
+
</span>
|
|
140
165
|
</div>
|
|
141
166
|
</div>
|
|
142
167
|
);
|
|
@@ -376,7 +376,6 @@ export default memo(VehicleSmallCard, (props, nextProps) => { // shouldComponent
|
|
|
376
376
|
leasing: { monthlyInstallment: lMonthlyInstallment }
|
|
377
377
|
},
|
|
378
378
|
isCarInFavorite,
|
|
379
|
-
statsData,
|
|
380
379
|
compareProps,
|
|
381
380
|
children
|
|
382
381
|
} = props;
|
|
@@ -387,7 +386,6 @@ export default memo(VehicleSmallCard, (props, nextProps) => { // shouldComponent
|
|
|
387
386
|
&& withFinalInstallment === nextProps.price.financing.withFinalInstallment
|
|
388
387
|
&& lMonthlyInstallment === nextProps.price.leasing.monthlyInstallment
|
|
389
388
|
&& isCarInFavorite === nextProps.isCarInFavorite
|
|
390
|
-
&& statsData === nextProps.statsData
|
|
391
389
|
&& _get(compareProps, 'toCompare') === _get(compareProps, 'nextProps.toCompare')
|
|
392
390
|
&& children === nextProps.children;
|
|
393
391
|
});
|
|
@@ -130,7 +130,7 @@ export default function withStats(WrappedComponent: any) {
|
|
|
130
130
|
</span>
|
|
131
131
|
</div> : null}
|
|
132
132
|
{!!totalFavCount ? <div className={favoritesClassName} onClick={onFavoriteClick}>
|
|
133
|
-
<IconSVG name='
|
|
133
|
+
<IconSVG name='starNew' customDimensions className={favoritesIconClassName} />
|
|
134
134
|
<span>
|
|
135
135
|
{totalFavCount}
|
|
136
136
|
</span>
|