@bytebrand/fe-ui-core 4.1.0 → 4.1.2
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 +1 -1
- package/source/components/Alternative/DealerInfo.styl +16 -3
- package/source/components/Alternative/DealerInfo.tsx +16 -8
- package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +6 -11
- package/source/components/SearchFilters/filters/Mileage.tsx +5 -2
- package/source/components/SearchFilters/filters/Power.tsx +2 -1
- package/source/components/_common/Button/Button.styled.tsx +3 -2
package/package.json
CHANGED
|
@@ -86,12 +86,25 @@
|
|
|
86
86
|
text-align: right
|
|
87
87
|
font-weight: 700
|
|
88
88
|
font-size: 16px;
|
|
89
|
-
color: $black80
|
|
89
|
+
color: $black80;
|
|
90
|
+
width: 60px;
|
|
90
91
|
|
|
91
92
|
.ourPriceInput:focus
|
|
92
93
|
outline: none
|
|
93
94
|
|
|
94
95
|
.editIcon
|
|
95
|
-
width:
|
|
96
|
+
width: 1.5rem;
|
|
96
97
|
height: auto;
|
|
97
|
-
fill: $skyBlue
|
|
98
|
+
fill: $skyBlue
|
|
99
|
+
|
|
100
|
+
.ourPriceBlock
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
column-gap: 5px;
|
|
104
|
+
|
|
105
|
+
.ourPrice
|
|
106
|
+
color: $skyBlue !important;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
|
|
109
|
+
.editIconBlock
|
|
110
|
+
cursor: pointer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
2
|
import styles from './DealerInfo.styl';
|
|
3
3
|
import IconSVG from '../_common/IconSVG/IconSVG';
|
|
4
4
|
import VehicleFormattedPrice from '../Vehicle/VehicleFormattedPrice/VehicleFormattedPrice';
|
|
@@ -17,6 +17,7 @@ interface IDealerInfo {
|
|
|
17
17
|
const DealerInfo = ({ infoSections, t, dealerPrice, ourMargin, link, linkName, currentSalesPrice, onCurrentSalesPriceChange }: IDealerInfo) => {
|
|
18
18
|
const [isPriceUpdating, setPriceUpdating] = useState(false);
|
|
19
19
|
const [newPrice, setNewPrice] = useState(dealerPrice);
|
|
20
|
+
const inputRef = useRef(null);
|
|
20
21
|
|
|
21
22
|
const handleSubmit = () => {
|
|
22
23
|
setPriceUpdating(false);
|
|
@@ -87,25 +88,32 @@ const DealerInfo = ({ infoSections, t, dealerPrice, ourMargin, link, linkName, c
|
|
|
87
88
|
/>
|
|
88
89
|
</span>
|
|
89
90
|
</span>
|
|
90
|
-
<span className={styles.priceItem}
|
|
91
|
+
<span className={styles.priceItem}>
|
|
91
92
|
<span>
|
|
92
93
|
{t('vehicleProps:alternative.ourPrice')}
|
|
93
94
|
</span>
|
|
94
95
|
{isPriceUpdating
|
|
95
|
-
?
|
|
96
|
+
? <div className={styles.ourPriceBlock}>
|
|
96
97
|
<input
|
|
97
98
|
className={styles.ourPriceInput}
|
|
98
99
|
type="number"
|
|
99
100
|
value={newPrice}
|
|
100
101
|
onChange={(e) => setNewPrice(+e.target.value)}
|
|
102
|
+
ref={inputRef}
|
|
103
|
+
onBlur={() => setPriceUpdating(false)}
|
|
101
104
|
/>
|
|
102
|
-
<
|
|
105
|
+
<span className={styles.editIconBlock} onClick={handleSubmit}>
|
|
103
106
|
<IconSVG className={styles.editIcon} customDimensions name='editIcon'></IconSVG>
|
|
104
|
-
</
|
|
105
|
-
|
|
106
|
-
: <span
|
|
107
|
+
</span>
|
|
108
|
+
</div>
|
|
109
|
+
: <span onClick={() => {
|
|
110
|
+
setPriceUpdating(true);
|
|
111
|
+
setTimeout(() => {
|
|
112
|
+
inputRef.current.focus();
|
|
113
|
+
}, 200)
|
|
114
|
+
}}>
|
|
107
115
|
<VehicleFormattedPrice
|
|
108
|
-
className={styles.price}
|
|
116
|
+
className={classnames(styles.price, styles.ourPrice)}
|
|
109
117
|
numbersAfterDot={0}
|
|
110
118
|
price={currentSalesPrice}
|
|
111
119
|
unit='€'
|
|
@@ -6,8 +6,8 @@ import { getFormattedPrice } from '../../../framework/utils/CommonUtils';
|
|
|
6
6
|
import { IPanelConfigProps } from '../../../framework/types/types';
|
|
7
7
|
import VehicleFormattedPrice from '../../Vehicle/VehicleFormattedPrice/VehicleFormattedPrice';
|
|
8
8
|
import RequestOffer from '../../_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper';
|
|
9
|
-
import IconSVG from '../../_common/IconSVG/IconSVG';
|
|
10
9
|
import styles from './PanelConfig.styl';
|
|
10
|
+
import ExpansionPanel from '../../_common/ExpansionPanel/ExpansionPanel';
|
|
11
11
|
|
|
12
12
|
const PanelConfig: React.FunctionComponent<IPanelConfigProps> = ({
|
|
13
13
|
t,
|
|
@@ -108,16 +108,11 @@ const PanelConfig: React.FunctionComponent<IPanelConfigProps> = ({
|
|
|
108
108
|
</Hidden>
|
|
109
109
|
</div>
|
|
110
110
|
<Visible xs sm md>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
className={styles.detailsIcon}
|
|
117
|
-
customDimensions
|
|
118
|
-
/>
|
|
119
|
-
</span>
|
|
120
|
-
{isOpenDetails ? renderConfigDetails(true) : null}
|
|
111
|
+
<ExpansionPanel
|
|
112
|
+
title={t(`sidebar.financingDetalis.${titleKey}`)}
|
|
113
|
+
>
|
|
114
|
+
{renderConfigDetails(true)}
|
|
115
|
+
</ExpansionPanel>
|
|
121
116
|
</Visible>
|
|
122
117
|
</>
|
|
123
118
|
);
|
|
@@ -52,7 +52,8 @@ const Mileage = ({ controls, onChange, onChangeControls, t, values, options }: I
|
|
|
52
52
|
values: transformValues(values),
|
|
53
53
|
onChange: (value: string, name: string) => {
|
|
54
54
|
onChange(name, value);
|
|
55
|
-
onChangeControls(name,
|
|
55
|
+
onChangeControls(name, value);
|
|
56
|
+
// onChangeControls(name, RANGE_FILTERS_DEFAULT_CONTROLS);
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
|
|
@@ -99,5 +100,7 @@ const Mileage = ({ controls, onChange, onChangeControls, t, values, options }: I
|
|
|
99
100
|
export default memo(Mileage, (prevProps: any, nextProps: any) => {
|
|
100
101
|
return prevProps.controls.from === nextProps.controls.from &&
|
|
101
102
|
prevProps.controls.to === nextProps.controls.to &&
|
|
102
|
-
prevProps.t === nextProps.t
|
|
103
|
+
prevProps.t === nextProps.t &&
|
|
104
|
+
prevProps.values === nextProps.values
|
|
105
|
+
|
|
103
106
|
});
|
|
@@ -73,7 +73,8 @@ class Power extends React.Component<IPowerProps, {}> {
|
|
|
73
73
|
this.tempValues = value;
|
|
74
74
|
|
|
75
75
|
onChange(name, { ...value, type });
|
|
76
|
-
onChangeControls(this.name, { ...
|
|
76
|
+
onChangeControls(this.name, { ...value, type });
|
|
77
|
+
// onChangeControls(this.name, { ...RANGE_FILTERS_DEFAULT_CONTROLS, type });
|
|
77
78
|
}
|
|
78
79
|
};
|
|
79
80
|
|
|
@@ -14,14 +14,15 @@ export const useStyles = {
|
|
|
14
14
|
transition: 'all 0.2s ease-in-out',
|
|
15
15
|
textDecoration: 'none',
|
|
16
16
|
textTransform: 'none',
|
|
17
|
-
borderRadius:
|
|
17
|
+
borderRadius: 4,
|
|
18
18
|
outline: 'none',
|
|
19
19
|
userSelect: 'none',
|
|
20
20
|
whiteSpace: 'nowrap',
|
|
21
21
|
overflow: 'hidden',
|
|
22
22
|
textOverflow: 'ellipsis',
|
|
23
23
|
'&.MuiButton-containedPrimary': {
|
|
24
|
-
backgroundColor: '#005ccb'
|
|
24
|
+
backgroundColor: '#005ccb',
|
|
25
|
+
borderRadius: '4px !important'
|
|
25
26
|
},
|
|
26
27
|
'&.MuiButton-containedSecondary': {
|
|
27
28
|
backgroundColor: 'red'
|