@bytebrand/fe-ui-core 4.2.239 → 4.2.241
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/Checkout/CheckoutStepper/CheckoutStepper.styl +190 -2
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
- package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +6 -4
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +1 -5
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +1 -1
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +27 -43
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +27 -62
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +1 -9
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +32 -36
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +1 -1
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +0 -45
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +42 -112
- package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +2 -4
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +1 -35
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +2 -8
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +2 -11
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -2
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +2 -0
- package/source/components/_common/Button/Button.tsx +2 -4
- package/source/components/_common/IconSVG/IconSVGConfig.tsx +0 -2
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +4 -4
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +4 -12
- package/source/components/_common/withStats/withStats.styl +0 -3
- package/source/components/_common/withStats/withStats.tsx +15 -18
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +1 -3
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +7 -7
- package/source/framework/types/types.ts +0 -2
- package/source/framework/utils/CommonUtils.ts +0 -1
- package/source/framework/utils/DateUtils.ts +0 -8
- package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +0 -26
package/package.json
CHANGED
|
@@ -30,5 +30,193 @@
|
|
|
30
30
|
[class*='MuiPickersToolbar-toolbar']
|
|
31
31
|
background-color: #005CCB !important;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
// @import '../../../theme/mixins.styl'
|
|
35
|
+
|
|
36
|
+
// .root
|
|
37
|
+
// & [class*='MuiStepLabel-label'][class*='MuiStepLabel-alternativeLabel']
|
|
38
|
+
// fontSize: 10
|
|
39
|
+
// maxWidth: 56
|
|
40
|
+
|
|
41
|
+
// & [class*='MuiStepLabel-label'][class*='MuiStepLabel-active']
|
|
42
|
+
// fontWeight: bold
|
|
43
|
+
|
|
44
|
+
// & [class*='MuiSvgIcon-root']
|
|
45
|
+
// width: 24
|
|
46
|
+
// height: 24
|
|
47
|
+
|
|
48
|
+
// & [class*='MuiStepConnector-line']
|
|
49
|
+
// borderWidth: 2px
|
|
50
|
+
|
|
51
|
+
// & [class*='MuiStepConnector-vertical']
|
|
52
|
+
// marginLeft: 50,
|
|
53
|
+
// padding: 12px 0 16px
|
|
54
|
+
|
|
55
|
+
// .active
|
|
56
|
+
// @media (min-width: 992px):
|
|
57
|
+
// backgroundColor: rgba(0, 92, 203, 0.08)
|
|
58
|
+
|
|
59
|
+
// & [class*='MuiStepIcon-text']
|
|
60
|
+
// fill: white !important
|
|
61
|
+
|
|
62
|
+
// & [class*='MuiStepIcon-active']
|
|
63
|
+
// color: #005CCB
|
|
64
|
+
// fontWeight: bold
|
|
65
|
+
// & [class*='MuiStepConnector-line']
|
|
66
|
+
// borderColor: #005CCB
|
|
67
|
+
// borderTopWidth: 2px
|
|
68
|
+
|
|
69
|
+
// .isCompleted
|
|
70
|
+
// & [class*='MuiStep-vertical'] + [class*='MuiStepConnector-vertical']
|
|
71
|
+
// & [class*='MuiStepConnector-line']
|
|
72
|
+
// borderColor: #005CCB
|
|
73
|
+
|
|
74
|
+
// .stepper
|
|
75
|
+
// & [class*='MuiStepper-root']
|
|
76
|
+
// padding: 0
|
|
77
|
+
// // overflow: 'scroll'
|
|
78
|
+
|
|
79
|
+
// .labelWrap
|
|
80
|
+
// & [class*='MuiStepLabel-label']
|
|
81
|
+
// marginTop: 7
|
|
82
|
+
// lineHeight: 11px
|
|
83
|
+
|
|
84
|
+
// .verticalWrap
|
|
85
|
+
// padding: 14px 0 14px 26px
|
|
86
|
+
// borderRadius: 0px 38px 38px 0px
|
|
87
|
+
// boxSizing: border-box
|
|
88
|
+
|
|
89
|
+
// & [class*='MuiStepLabel-iconContainer']
|
|
90
|
+
// paddingRight: 17
|
|
91
|
+
|
|
92
|
+
// & [class*='MuiSvgIcon-root']
|
|
93
|
+
// width: 48
|
|
94
|
+
// height: 48
|
|
95
|
+
|
|
96
|
+
// & [class*='MuiStepLabel-label']
|
|
97
|
+
// color: rgba(0, 0, 0, 0.83)
|
|
98
|
+
// fontWeight: bold
|
|
99
|
+
// fontSize: 22
|
|
100
|
+
|
|
101
|
+
// .default
|
|
102
|
+
// & [class*='MuiStepIcon-text']
|
|
103
|
+
// fill: grey
|
|
104
|
+
|
|
105
|
+
// & [class*='MuiStepIcon-root']
|
|
106
|
+
// color: transparent
|
|
107
|
+
// border: 1px solid grey
|
|
108
|
+
// boxSizing: border-box
|
|
109
|
+
// borderRadius: 50%
|
|
110
|
+
|
|
111
|
+
// & [class*='MuiStepLabel-label']
|
|
112
|
+
// color: rgba(0, 0, 0, 0.38)
|
|
113
|
+
// fontWeight: 400
|
|
114
|
+
|
|
115
|
+
// .completeStep
|
|
116
|
+
// color: #005CCB
|
|
117
|
+
// & [class*='MuiStepIcon-root']
|
|
118
|
+
// borderColor: #005CCB
|
|
119
|
+
// borderWidth: 2px
|
|
120
|
+
|
|
121
|
+
// & [class*='MuiStepIcon-text']
|
|
122
|
+
// fill: #005CCB
|
|
123
|
+
// fontWeight: bold
|
|
124
|
+
|
|
125
|
+
// & [class*='MuiStepLabel-label'][class*='MuiStepLabel-alternativeLabel']
|
|
126
|
+
// color: #005CCB
|
|
127
|
+
|
|
128
|
+
// & [class*='MuiStepLabel-label']
|
|
129
|
+
// color: #005CCB
|
|
130
|
+
|
|
131
|
+
// & [class*='MuiStepConnector-lineVertical']
|
|
132
|
+
// borderColor: #005CCB
|
|
133
|
+
|
|
134
|
+
// .completeLine
|
|
135
|
+
// & [class*='MuiStepConnector-line']
|
|
136
|
+
// borderColor: #005CCB
|
|
137
|
+
// borderTopWidth: 2px
|
|
138
|
+
|
|
139
|
+
// & [class*='MuiStepConnector-line'][class*='MuiStepConnector-lineVertical']
|
|
140
|
+
// borderColor: #005CCB
|
|
141
|
+
|
|
142
|
+
// .activeLine
|
|
143
|
+
// & [class*='MuiStepConnector-line']
|
|
144
|
+
// borderColor: #005CCB
|
|
145
|
+
// borderTopWidth: 2px
|
|
146
|
+
|
|
147
|
+
// .minutes
|
|
148
|
+
// fontSize: 14
|
|
149
|
+
// color: rgba(0, 0, 0, 0.63)
|
|
150
|
+
// display: block
|
|
151
|
+
// textAlign: left
|
|
152
|
+
// fontWeight: 400
|
|
153
|
+
|
|
154
|
+
// .buttonItem
|
|
155
|
+
// margin: 0
|
|
156
|
+
// padding: 0
|
|
157
|
+
|
|
158
|
+
// // .checkoutFooter:
|
|
159
|
+
// // display: 'block'
|
|
160
|
+
// // width: '100%'
|
|
161
|
+
// // textAlign: 'center'
|
|
162
|
+
// // background: '#f2f2f2'
|
|
163
|
+
// // color: '#757575'
|
|
164
|
+
// // fontSize: '7px'
|
|
165
|
+
|
|
166
|
+
// // .checkoutFooterItem:
|
|
167
|
+
// // margin: '0 4px'
|
|
168
|
+
|
|
169
|
+
// // .buttonWeiter
|
|
170
|
+
// // width: '328px'
|
|
171
|
+
// // margin: '16px auto'
|
|
172
|
+
// // display: 'block'
|
|
173
|
+
// // height: '44px'
|
|
174
|
+
// // textTransform: 'none'
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
// .stepperWrapper
|
|
195
|
+
// width: 100%
|
|
196
|
+
// overflow: hidden
|
|
197
|
+
|
|
198
|
+
// +media-tablet-landscape-up()
|
|
199
|
+
// .stepperWrapper
|
|
200
|
+
// box-sizing: border-box
|
|
201
|
+
// background-color: #fff
|
|
202
|
+
// width: 376px
|
|
203
|
+
// box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.15);
|
|
204
|
+
// position fixed
|
|
205
|
+
// z-index: 1;
|
|
206
|
+
// padding: 35px 8px 35px
|
|
207
|
+
// height: 100%
|
|
208
|
+
|
|
209
|
+
// .menuArrow
|
|
210
|
+
// position: absolute;
|
|
211
|
+
// right: 0;
|
|
212
|
+
// top: 50%;
|
|
213
|
+
// max-width: 17px;
|
|
214
|
+
// transform: rotate(-90deg) translateY(-50%);
|
|
215
|
+
// transform-origin: 0 center;
|
|
216
|
+
// path
|
|
217
|
+
// fill: rgba(0, 0, 0, 0.38);
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
// [class*='MuiPickersToolbar-toolbar']
|
|
222
|
+
// background-color: #005CCB !important;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
.editableFieldWrapper
|
|
4
4
|
font-family: $font-style-arial
|
|
5
|
-
margin-top:
|
|
5
|
+
margin-top: 16px
|
|
6
6
|
|
|
7
7
|
.header
|
|
8
8
|
display: flex
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
.field
|
|
13
13
|
display: flex
|
|
14
14
|
justify-content: space-between
|
|
15
|
-
margin-top:
|
|
15
|
+
margin-top: 16px
|
|
16
16
|
color: $black60
|
|
17
17
|
font-size: 14px
|
|
18
18
|
|
|
@@ -15,18 +15,18 @@ interface IOrderOverviewItem {
|
|
|
15
15
|
rate?: string;
|
|
16
16
|
};
|
|
17
17
|
activeStep: number;
|
|
18
|
-
dontShowEdit?:boolean;
|
|
19
18
|
handleStep: (index: number) => () => void;
|
|
20
19
|
titleClassName?: string;
|
|
21
20
|
fieldClassName?: string;
|
|
22
21
|
fieldWrapperClassName?: string;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
const OrderOverviewItem: FC<IOrderOverviewItem> = ({
|
|
24
|
+
const OrderOverviewItem: FC<IOrderOverviewItem> = ({ fields, handleStep, activeStep, titleClassName, fieldClassName, fieldWrapperClassName }) => {
|
|
26
25
|
const wrapperClasses = classnames(
|
|
27
26
|
styles.editableFieldWrapper,
|
|
28
27
|
{ [fieldWrapperClassName]: fieldWrapperClassName }
|
|
29
28
|
);
|
|
29
|
+
|
|
30
30
|
return (
|
|
31
31
|
<div className={wrapperClasses}>
|
|
32
32
|
<div>
|
|
@@ -34,7 +34,7 @@ const OrderOverviewItem: FC<IOrderOverviewItem> = ({ dontShowEdit, fields, handl
|
|
|
34
34
|
<span className={titleClassName}>{fields.title} {fields.additionalTitle && <span className={styles.additionalTitle}>{fields.additionalTitle}</span>}</span>
|
|
35
35
|
<span className={styles.fieldLineWrapper} data-testid='editIcon' onClick={() => handleStep(activeStep)()}>
|
|
36
36
|
{fields.oneLineRate && <span className={classnames(styles.fieldLine, fieldClassName)}>{fields.oneLineRate}</span>}
|
|
37
|
-
{!
|
|
37
|
+
{!fieldWrapperClassName && <span className={styles.editIcon}><IconSVG name='editIcon'/></span >}
|
|
38
38
|
</span>
|
|
39
39
|
</div>
|
|
40
40
|
{fields.content && fields.content.map((fields, index) => (
|
package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
align-items: center;
|
|
23
23
|
width: 100%;
|
|
24
24
|
grid-template-columns: 1fr 82px;
|
|
25
|
-
grid-column-gap:
|
|
25
|
+
grid-column-gap: 44px;
|
|
26
26
|
padding: 17px 0
|
|
27
27
|
|
|
28
28
|
& + &
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
align-items: center;
|
|
34
34
|
|
|
35
35
|
.icon
|
|
36
|
-
margin-right:
|
|
36
|
+
margin-right: 22px
|
|
37
37
|
width: 64px
|
|
38
38
|
height: 64px
|
|
39
39
|
display block;
|
|
@@ -42,16 +42,18 @@
|
|
|
42
42
|
+media-phone-only()
|
|
43
43
|
width: 82px
|
|
44
44
|
height: 82px
|
|
45
|
+
margin-right: 0
|
|
45
46
|
grid-column: 2;
|
|
46
47
|
grid-row: 1 / span 3;
|
|
47
48
|
|
|
48
49
|
.title
|
|
49
|
-
font-size:
|
|
50
|
+
font-size: 18px
|
|
50
51
|
margin-bottom: 5px
|
|
51
52
|
color: $grey-3a;
|
|
52
53
|
+media-phone-only()
|
|
54
|
+
font-size: 16px;
|
|
53
55
|
grid-row: 1 / span 1;
|
|
54
|
-
text-align:
|
|
56
|
+
text-align: justify;
|
|
55
57
|
color: $grey-32;
|
|
56
58
|
|
|
57
59
|
.textContent
|
package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx
CHANGED
|
@@ -55,7 +55,7 @@ const AdditionalOrderInfo = ({ t, additionalOrderData, redirectToUrl, buyingType
|
|
|
55
55
|
return (
|
|
56
56
|
<div key={label} className={styles.flexContainer}>
|
|
57
57
|
<div className={styles.labelText}>{label}</div>
|
|
58
|
-
<div className={
|
|
58
|
+
<div className={styles.labelText}>{value}</div>
|
|
59
59
|
</div>
|
|
60
60
|
);
|
|
61
61
|
}
|
|
@@ -3,7 +3,6 @@ import styles from './OrderStatusSection.styl';
|
|
|
3
3
|
import OrderStatusCard from './OrderStatusCard';
|
|
4
4
|
// import Image from '../../../_common/Image/Image';
|
|
5
5
|
import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
|
|
6
|
-
import AdditionalOrderInfo from './AdditionalOrderInfo';
|
|
7
6
|
|
|
8
7
|
// tslint:disable-next-line:interface-name
|
|
9
8
|
interface ITFunction {
|
|
@@ -26,11 +25,6 @@ interface IOrderStatusCar {
|
|
|
26
25
|
registration: boolean;
|
|
27
26
|
currentSalesPrice: number;
|
|
28
27
|
onClick: () => void;
|
|
29
|
-
isFinishedOrder?: boolean;
|
|
30
|
-
additionalOrderInfoProps?: any;
|
|
31
|
-
wonStatus?: string;
|
|
32
|
-
transformedDeliveryDate?: string | null;
|
|
33
|
-
delivery?: boolean;
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
const OrderStatusCar = ({
|
|
@@ -47,11 +41,7 @@ const OrderStatusCar = ({
|
|
|
47
41
|
request,
|
|
48
42
|
registration,
|
|
49
43
|
currentSalesPrice,
|
|
50
|
-
onClick
|
|
51
|
-
additionalOrderInfoProps,
|
|
52
|
-
wonStatus,
|
|
53
|
-
transformedDeliveryDate,
|
|
54
|
-
delivery
|
|
44
|
+
onClick
|
|
55
45
|
}: IOrderStatusCar) => {
|
|
56
46
|
const ref = useRef(null);
|
|
57
47
|
const [activeStep, setActiveStep] = useState(0); // 0 - when we have no active steps
|
|
@@ -60,7 +50,7 @@ const OrderStatusCar = ({
|
|
|
60
50
|
{ icon: 'orderReceivedDashboard', selector: 'selector_status_order_received' },
|
|
61
51
|
{ icon: 'preparaionDashboard', selector: 'selector_status_preparation' },
|
|
62
52
|
{ icon: 'registrationDashboard', selector: 'selector_status_registration' },
|
|
63
|
-
selfPickup
|
|
53
|
+
selfPickup ? { icon: 'pickupDashboard', selector: 'selector_status_pick_up' }
|
|
64
54
|
: { icon: 'deliveryDashboard', selector: 'selector_status_delivery' },
|
|
65
55
|
{ icon: 'handingOverDashboard', selector: 'selector_status_handing_over' }
|
|
66
56
|
];
|
|
@@ -104,43 +94,37 @@ const OrderStatusCar = ({
|
|
|
104
94
|
<img data-testid='car-image' src={imageUrl}/>
|
|
105
95
|
</div>
|
|
106
96
|
<div className={styles.requestId}>{request}</div>
|
|
107
|
-
<div className={styles.carPayment}>
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
t('currentSalesPrice', { currentSalesPrice: getFormattedPrice(currentSalesPrice) })
|
|
114
|
-
: t('monthlyInstallment', { monthlyInstallment: getFormattedPrice(monthlyInstallment, '$,.2f') })
|
|
115
|
-
}
|
|
116
|
-
</>
|
|
97
|
+
<div className={styles.carPayment} >
|
|
98
|
+
{t(`buyingType.${buyingType}`)},
|
|
99
|
+
{buyingType !== 'buy' && `${t('paybackPeriod', { paybackPeriod })},`}
|
|
100
|
+
{buyingType === 'buy' ?
|
|
101
|
+
t('currentSalesPrice', { currentSalesPrice: getFormattedPrice(currentSalesPrice) })
|
|
102
|
+
: t('monthlyInstallment', { monthlyInstallment: getFormattedPrice(monthlyInstallment, '$,.2f') })
|
|
117
103
|
}
|
|
118
104
|
</div>
|
|
119
105
|
</div>
|
|
120
106
|
</div>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const { icon, selector } = card;
|
|
107
|
+
<div className={styles.cardsSection} ref={ref}>
|
|
108
|
+
{cardItems.map((card, index) => {
|
|
109
|
+
const { icon, selector } = card;
|
|
125
110
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
111
|
+
const statusDescription = !registration && index === 2 ?
|
|
112
|
+
t('orderStatus.independentRegistration') :
|
|
113
|
+
t(`orderStatus.${selector}_desc`);
|
|
129
114
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
115
|
+
return (
|
|
116
|
+
<OrderStatusCard
|
|
117
|
+
title={t(`orderStatus.${selector}`)}
|
|
118
|
+
description={statusDescription}
|
|
119
|
+
icon={icon}
|
|
120
|
+
key={index}
|
|
121
|
+
isActive={index + 1 === activeStep}
|
|
122
|
+
isDisabled={index + 1 > activeStep}
|
|
123
|
+
isDone={index + 1 < activeStep}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
})}
|
|
127
|
+
</div>
|
|
144
128
|
</div>
|
|
145
129
|
</div>
|
|
146
130
|
);
|
package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import styles from './OrderStatusSection.styl';
|
|
|
7
7
|
import { Skeleton } from '@mui/material';
|
|
8
8
|
|
|
9
9
|
import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
|
|
10
|
-
import { fromUTCToDateString } from '../../../../framework/utils/DateUtils';
|
|
11
10
|
|
|
12
11
|
interface ITFunction {
|
|
13
12
|
<T = string>(key: string, options?: object): T;
|
|
@@ -21,7 +20,6 @@ interface IOrderStatusSection {
|
|
|
21
20
|
isFetching: boolean;
|
|
22
21
|
withAdditionalInfo?: boolean; // for using on /account/my-order.
|
|
23
22
|
orderedCars: any[]; // TODO: create interface for orderedCars, when the object is formatted by the backend
|
|
24
|
-
wonCars?: any[];
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
const OrderStatusSection = ({
|
|
@@ -29,7 +27,6 @@ const OrderStatusSection = ({
|
|
|
29
27
|
t,
|
|
30
28
|
redirectToUrl,
|
|
31
29
|
orderedCars,
|
|
32
|
-
wonCars,
|
|
33
30
|
isFetching,
|
|
34
31
|
withAdditionalInfo = false
|
|
35
32
|
}: IOrderStatusSection) => {
|
|
@@ -44,21 +41,23 @@ const OrderStatusSection = ({
|
|
|
44
41
|
if (!!addressObj) {
|
|
45
42
|
Object.keys(addressObj).forEach((key) => {
|
|
46
43
|
switch (key) {
|
|
47
|
-
case '
|
|
48
|
-
case '
|
|
44
|
+
case 'customerFirstname':
|
|
45
|
+
case 'customerLastname':
|
|
49
46
|
addressString = `${addressString} ${addressObj[key]}`;
|
|
50
47
|
break;
|
|
51
|
-
case '
|
|
52
|
-
case '
|
|
53
|
-
case '
|
|
54
|
-
case '
|
|
48
|
+
case 'deliveryPartner':
|
|
49
|
+
case 'customerStreet':
|
|
50
|
+
case 'deliveryStreet':
|
|
51
|
+
case 'customerZip':
|
|
52
|
+
case 'deliveryZip':
|
|
55
53
|
if (!!addressString) {
|
|
56
54
|
addressString = `${addressString}, ${addressObj[key]}`;
|
|
57
55
|
} else {
|
|
58
56
|
addressString = `${addressString} ${addressObj[key]}`;
|
|
59
57
|
}
|
|
60
58
|
break;
|
|
61
|
-
case '
|
|
59
|
+
case 'customerCity':
|
|
60
|
+
case 'deliveryCity':
|
|
62
61
|
addressString = `${addressString} ${addressObj[key]}`;
|
|
63
62
|
break;
|
|
64
63
|
default: addressString = `${addressString} ${addressObj[key]}`;
|
|
@@ -113,21 +112,10 @@ const OrderStatusSection = ({
|
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
const
|
|
117
|
-
if (!warranty || !warranty.warrantyCost) {
|
|
118
|
-
return t('MyOrderPage:carPrice');
|
|
119
|
-
}
|
|
120
|
-
const warrantyPackage = t(`MyOrderPage:${warranty.warrantyPackage}`);
|
|
121
|
-
const warrantyPeriod = t(`MyOrderPage:${warranty.warrantyPeriod}year`, { warrantyPeriod: warranty.warrantyPeriod });
|
|
122
|
-
const carPriceIncWarrantyTitle =
|
|
123
|
-
`${t('MyOrderPage:carPrice')} ${t('MyOrderPage:incWarranty', { warrantyPackage, warrantyPeriod })}`;
|
|
124
|
-
return carPriceIncWarrantyTitle;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const renderRequestedCars = (cars: any[] = []) => {
|
|
115
|
+
const renderRequestedCars = () => {
|
|
128
116
|
return (
|
|
129
117
|
<>
|
|
130
|
-
{!!
|
|
118
|
+
{!!orderedCars && orderedCars.map((orderedCarData: any, index: number) => {
|
|
131
119
|
if (orderedCarData && typeof orderedCarData.car === 'object') {
|
|
132
120
|
const orderedCar = { ...defaultCarProps, ...orderedCarData };
|
|
133
121
|
const { car: { _id } } = orderedCar;
|
|
@@ -142,7 +130,6 @@ const OrderStatusSection = ({
|
|
|
142
130
|
request,
|
|
143
131
|
registration,
|
|
144
132
|
currentSalesPrice,
|
|
145
|
-
totalPrice,
|
|
146
133
|
deposit,
|
|
147
134
|
preparationCost,
|
|
148
135
|
licensePlateCost,
|
|
@@ -151,31 +138,20 @@ const OrderStatusSection = ({
|
|
|
151
138
|
customerAddress,
|
|
152
139
|
deliveryAddress,
|
|
153
140
|
firstRate,
|
|
154
|
-
paymentProtectionInsuranceCost
|
|
155
|
-
wonStatus,
|
|
156
|
-
warranty,
|
|
157
|
-
deliveryDate,
|
|
158
|
-
isLicensePlateFee,
|
|
159
|
-
delivery,
|
|
160
|
-
extrasSumCost
|
|
141
|
+
paymentProtectionInsuranceCost
|
|
161
142
|
} = orderedCar;
|
|
162
|
-
|
|
163
|
-
const transformedDeliveryDate = !!deliveryDate ? `${t('MyOrderPage:deliveredOn')} ${fromUTCToDateString(deliveryDate)}` : null;
|
|
164
|
-
|
|
165
|
-
const currentSalesPriceWithWarranty = !!warranty && !!warranty.warrantyCost ? currentSalesPrice + warranty.warrantyCost : currentSalesPrice;
|
|
166
143
|
|
|
167
144
|
const additionalOrderData = {
|
|
168
145
|
addressData: [
|
|
169
146
|
...customerAddress ? [{ label: t('MyOrderPage:billingAddress'), value: getTransformAddressToString(customerAddress) }] : [],
|
|
170
|
-
...deliveryAddress ? [{ label: t('MyOrderPage:vehicleDelivery'), value:
|
|
147
|
+
...deliveryAddress ? [{ label: t('MyOrderPage:vehicleDelivery'), value: getTransformAddressToString(deliveryAddress) }] : []
|
|
171
148
|
],
|
|
172
149
|
carPriceData: [
|
|
173
|
-
...currentSalesPrice ? [getDataPriceItem(
|
|
150
|
+
...currentSalesPrice ? [getDataPriceItem(currentSalesPrice, t('MyOrderPage:carPrice'))] : [],
|
|
174
151
|
...preparationCost ? [getDataPriceItem(preparationCost, t('MyOrderPage:preparationCost'))] : [],
|
|
175
|
-
...
|
|
176
|
-
...
|
|
177
|
-
...
|
|
178
|
-
...!!transportationCost && delivery ? [getDataPriceItem(transportationCost, t('MyOrderPage:delivery'))] : [],
|
|
152
|
+
...registrationCost ? [getDataPriceItem(registrationCost, t('MyOrderPage:vehicleRegistration'))] : [],
|
|
153
|
+
...licensePlateCost ? [getDataPriceItem(licensePlateCost, t('MyOrderPage:licensePlates'))] : [],
|
|
154
|
+
...transportationCost ? [getDataPriceItem(transportationCost, t('MyOrderPage:delivery'))] : [],
|
|
179
155
|
...paymentProtectionInsuranceCost ? [getDataPriceItem(paymentProtectionInsuranceCost, t('MyOrderPage:paymentProtectionInsuranceCost'))]: [],
|
|
180
156
|
...firstRate ? [getDataPriceItem(firstRate, t('MyOrderPage:firstRate'))] : [],
|
|
181
157
|
...buyingType !== 'buy' ? [
|
|
@@ -189,8 +165,8 @@ const OrderStatusSection = ({
|
|
|
189
165
|
] : []
|
|
190
166
|
],
|
|
191
167
|
overallRate: {
|
|
192
|
-
label:
|
|
193
|
-
value: buyingType === 'buy'
|
|
168
|
+
label: t('MyOrderPage:yourOverallRate'),
|
|
169
|
+
value: buyingType === 'buy' ? currentSalesPrice : monthlyInstallment
|
|
194
170
|
}
|
|
195
171
|
};
|
|
196
172
|
|
|
@@ -217,26 +193,18 @@ const OrderStatusSection = ({
|
|
|
217
193
|
request,
|
|
218
194
|
registration,
|
|
219
195
|
currentSalesPrice,
|
|
220
|
-
onClick: () => onDetailsClick(_id)
|
|
221
|
-
additionalOrderInfoProps,
|
|
222
|
-
wonStatus,
|
|
223
|
-
transformedDeliveryDate,
|
|
224
|
-
delivery
|
|
196
|
+
onClick: () => onDetailsClick(_id)
|
|
225
197
|
};
|
|
226
198
|
|
|
227
|
-
const title =
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
: <span>{t('orderStatus.myOrder')}</span>;
|
|
199
|
+
const title = <span>
|
|
200
|
+
{t('orderStatus.title')}:
|
|
201
|
+
<span className={styles.orderStatus}>{t(`orderStatus.${status}`)}</span>
|
|
202
|
+
</span>;
|
|
232
203
|
|
|
233
204
|
return (
|
|
234
205
|
<DashboardSection key={index} title={title}>
|
|
235
|
-
<OrderStatusCar
|
|
236
|
-
{withAdditionalInfo
|
|
237
|
-
<AdditionalOrderInfo { ...additionalOrderInfoProps } />
|
|
238
|
-
: null
|
|
239
|
-
}
|
|
206
|
+
<OrderStatusCar { ...orderStatusCarProps } />
|
|
207
|
+
{withAdditionalInfo ? <AdditionalOrderInfo { ...additionalOrderInfoProps } /> : null}
|
|
240
208
|
</DashboardSection>
|
|
241
209
|
);
|
|
242
210
|
}
|
|
@@ -251,10 +219,7 @@ const OrderStatusSection = ({
|
|
|
251
219
|
<div className={styles.skeletonBlock}>
|
|
252
220
|
<Skeleton animation='wave' variant='rectangular' width='100%' />
|
|
253
221
|
</div>
|
|
254
|
-
:
|
|
255
|
-
{renderRequestedCars(orderedCars)}
|
|
256
|
-
{renderRequestedCars(wonCars)}
|
|
257
|
-
</>
|
|
222
|
+
: renderRequestedCars()
|
|
258
223
|
}
|
|
259
224
|
</>
|
|
260
225
|
);
|