@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.136",
3
+ "version": "4.1.137",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -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
- {isPriceUpdating
103
- ? <div className={styles.ourPriceBlock}>
104
- <input
105
- className={styles.ourPriceInput}
106
- type='number'
107
- value={newPrice}
108
- onChange={e => onPriceChange(e)}
109
- ref={inputRef}
110
- onBlur={handleSubmit}
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
- <span className={styles.editIconBlock} onClick={handleSubmit}>
113
- <IconSVG className={styles.editIcon} customDimensions name='editIcon'></IconSVG>
114
- </span>
115
- </div>
116
- : <span onClick={
117
- () => {
118
- setPriceUpdating(true);
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
  });
@@ -77,11 +77,8 @@ $indent = 10px
77
77
 
78
78
  .statsStarIcon
79
79
  margin-right: 5px
80
- margin-bottom: 3px
81
- width: 20px
82
- height: 20px
83
- fill: rgb(100,100,100)
84
- transform:scale(0.8)
80
+ width: 1.2em
81
+ height: 1.3em
85
82
 
86
83
  .accented
87
84
  color: $primary
@@ -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='star' customDimensions className={favoritesIconClassName} />
133
+ <IconSVG name='starNew' customDimensions className={favoritesIconClassName} />
134
134
  <span>
135
135
  {totalFavCount}
136
136
  </span>