@bytebrand/fe-ui-core 4.2.74 → 4.2.75

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.2.74",
3
+ "version": "4.2.75",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -19,10 +19,6 @@
19
19
  width: 1px;
20
20
  height: 100%
21
21
  background-color $grey-5f;
22
-
23
- [class^='OfferCheckboxGroup__labelContent']
24
- @media (min-width: 990px) and (max-width: 1073px)
25
- max-width: 230px
26
22
 
27
23
  .wrapConfigDetails
28
24
  box-sizing: border-box
@@ -73,6 +73,9 @@
73
73
  .labelContent
74
74
  flex: 1 1 auto
75
75
  color: $grey-3;
76
+ @media (min-width: 990px) and (max-width: 1112px)
77
+ max-width: 230px
78
+ padding-right: 10px !important;
76
79
 
77
80
  .icon
78
81
  display: block
@@ -117,4 +120,4 @@
117
120
  font-size: 12px;
118
121
 
119
122
  .hidePlus
120
- display: inline-block
123
+ display: inline-block
@@ -167,13 +167,14 @@
167
167
  [class*='MuiFormControlLabel-root']
168
168
  height: 20px
169
169
  min-height: 0
170
- margin-left:0
171
170
  .labelText
172
171
  font-size: 12px;
173
172
  font-weight: normal;
174
173
 
175
174
  [class*='labelContent']
176
175
  font-size: 12px
176
+ +media-phone-up()
177
+ padding-right: 62px;
177
178
 
178
179
 
179
180
  .checkBoxGroup
@@ -189,6 +190,3 @@
189
190
  margin: 0
190
191
  justify-content: space-between
191
192
  width: 100%
192
-
193
- [class*='MuiIconButton-root']
194
- padding:5px!important
@@ -33,6 +33,9 @@
33
33
  font-size: 14px
34
34
  line-height: 20px
35
35
 
36
+ .adressDataValue
37
+ margin-top: 16px
38
+
36
39
  .orderInfoAddresses
37
40
  padding-bottom: 8px
38
41
  grid-area: addresses
@@ -62,11 +65,13 @@
62
65
  @extend .labelText
63
66
  text-align: center
64
67
  padding: 16px 24px
65
- border-top: 1px solid rgba(76,78,100,0.12)
66
68
  grid-area: customerSuport
67
69
 
70
+ .supportSectionBorder
71
+ border-top: 1px solid rgba(76,78,100,0.12)
72
+
68
73
  .customerSuportButton
69
- margin-top: 8px
74
+ margin-top: 8px !important
70
75
  color: #26C6F9 !important
71
76
  border-color: #26C6F9 !important
72
77
  border-radius: 8px !important
@@ -8,8 +8,8 @@ import classNames from 'classnames';
8
8
  import { TFunction } from '../../../../framework/types/types';
9
9
 
10
10
  interface IAdditionalOrderData {
11
- addressData: { label: string, value: string }[];
12
- carPriceData: { label: string, value: string | number }[];
11
+ addressData: ({ value: string; label: string; })[];
12
+ carPriceData: ({ value: string; label: string; })[] | any;
13
13
  overallRate: { label: string, value: number };
14
14
  }
15
15
 
@@ -27,29 +27,38 @@ const AdditionalOrderInfo = ({ t, additionalOrderData, redirectToUrl, buyingType
27
27
  return redirectToUrl('/account/kontakt');
28
28
  };
29
29
 
30
+ const supportSectionClassnames = classNames(
31
+ styles.customerSuport,
32
+ {[styles.supportSectionBorder]: addressData.length > 0}
33
+ )
34
+
30
35
  return (
31
36
  <div className={styles.container}>
32
37
  <div className={styles.orderInfoAddresses}>
33
38
  {addressData.map((data) => {
34
39
  const { value, label } = data;
35
- return (
36
- <div key={label}>
37
- <div className={styles.labelText}>{label}</div>
38
- <div className={styles.labelText}>{value}</div>
39
- </div>
40
- );
40
+ if (!!value) {
41
+ return (
42
+ <div key={label}>
43
+ <div className={styles.labelText}>{label}</div>
44
+ <div className={classNames(styles.labelText, styles.adressDataValue)}>{value}</div>
45
+ </div>
46
+ );
47
+ }
41
48
  })}
42
49
  </div>
43
50
  <div className={styles.orderPriceSection}>
44
51
  <div className={styles.orderInfoPrice}>
45
- {carPriceData.map((data) => {
52
+ {carPriceData.map((data: { value: string, label: string }) => {
46
53
  const { value, label } = data;
47
- return (
48
- <div key={label} className={styles.flexContainer}>
49
- <div className={styles.labelText}>{label}</div>
50
- <div className={styles.labelText}>{value}</div>
51
- </div>
52
- );
54
+ if (!!value) {
55
+ return (
56
+ <div key={label} className={styles.flexContainer}>
57
+ <div className={styles.labelText}>{label}</div>
58
+ <div className={styles.labelText}>{value}</div>
59
+ </div>
60
+ );
61
+ }
53
62
  })}
54
63
  </div>
55
64
  <div className={styles.orderInfoFinancing}>
@@ -70,9 +79,9 @@ const AdditionalOrderInfo = ({ t, additionalOrderData, redirectToUrl, buyingType
70
79
  </div>
71
80
  </div>
72
81
  </div>
73
- <div className={styles.customerSuport}>
74
- <div>{t('customerSupportText')}</div>
75
- <Button onClick={redirectToContactPage} className={styles.customerSuportButton} variant='outlined'>{t('customerSupport')}</Button>
82
+ <div className={supportSectionClassnames}>
83
+ <div>{t('MyOrderPage:customerSupportText')}</div>
84
+ <Button onClick={redirectToContactPage} className={styles.customerSuportButton} variant='outlined'>{t('MyOrderPage:customerSupport')}</Button>
76
85
  </div>
77
86
  </div>
78
87
  );
@@ -35,6 +35,43 @@ const OrderStatusSection = ({
35
35
  return redirectToUrl(`/search/vehicle/${carId}`);
36
36
  };
37
37
 
38
+ // transforming address object to string
39
+ const getTransformAddressToString = (addressObj: {[key: string]: string}) => {
40
+ let addressString = '';
41
+ if (!!addressObj) {
42
+ Object.keys(addressObj).forEach((key) => {
43
+ switch (key) {
44
+ case 'customerFirstname':
45
+ case 'customerLastname':
46
+ addressString = `${addressString} ${addressObj[key]}`;
47
+ break;
48
+ case 'deliveryPartner':
49
+ case 'customerStreet':
50
+ case 'deliveryStreet':
51
+ case 'customerZip':
52
+ case 'deliveryZip':
53
+ if (!!addressString) {
54
+ addressString = `${addressString}, ${addressObj[key]}`;
55
+ } else {
56
+ addressString = `${addressString} ${addressObj[key]}`;
57
+ }
58
+ break;
59
+ case 'customerCity':
60
+ case 'deliveryCity':
61
+ addressString = `${addressString} ${addressObj[key]}`;
62
+ break;
63
+ }
64
+ })
65
+ }
66
+ return addressString;
67
+ };
68
+
69
+ const getDataPriceItem = (value: number, label: string): {value: string, label: string} | [] => {
70
+ if (!!value && value !== 0) {
71
+ return { value: getFormattedPrice(value, '$,.2f', ' €'), label };
72
+ }
73
+ }
74
+
38
75
  const renderRequestedCars = () => {
39
76
  return (
40
77
  <>
@@ -56,31 +93,33 @@ const OrderStatusSection = ({
56
93
  licensePlateCost,
57
94
  registrationCost,
58
95
  transportationCost,
59
- customerAddress: {
60
- customerFirstname = '',
61
- customerLastname = ''
62
- } = {}
96
+ customerAddress,
97
+ deliveryAddress
63
98
  } = orderedCar;
64
99
 
65
100
  const additionalOrderData = {
66
101
  addressData: [
67
- { label: 'Billing address:', value: `${customerFirstname} ${customerLastname}` },
68
- { label: 'Vehicle delivery:', value: 'Hannes Käther, Wittenberger Str. 81, 04129 Leipzig' }
102
+ ...customerAddress ? [{ label: t('MyOrderPage:billingAddress'), value: getTransformAddressToString(customerAddress) }] : [],
103
+ ...deliveryAddress ? [{ label: t('MyOrderPage:vehicleDelivery'), value: getTransformAddressToString(deliveryAddress) }] : []
69
104
  ],
70
105
  carPriceData: [
71
- { label: 'Car price', value: getFormattedPrice(currentSalesPrice, '$,.2f', ' €') },
72
- { label: 'Preparation cost', value: getFormattedPrice(preparationCost, '$,.2f', ' €')},
73
- { label: 'vehicle registration', value: getFormattedPrice(registrationCost, '$,.2f', ' €') },
74
- { label: 'license plates', value: getFormattedPrice(licensePlateCost, '$,.2f', ' €') },
75
- { label: 'Delivery', value: getFormattedPrice(transportationCost, '$,.2f', ' €') },
106
+ ...currentSalesPrice ? [getDataPriceItem(currentSalesPrice, t('MyOrderPage:carPrice'))] : [],
107
+ ...preparationCost ? [getDataPriceItem(preparationCost, t('MyOrderPage:preparationCost'))] : [],
108
+ ...registrationCost ? [getDataPriceItem(registrationCost, t('MyOrderPage:vehicleRegistration'))] : [],
109
+ ...licensePlateCost ? [getDataPriceItem(licensePlateCost, t('MyOrderPage:licensePlates'))] : [],
110
+ ...transportationCost ? [getDataPriceItem(transportationCost, t('MyOrderPage:delivery'))] : [],
76
111
  ...buyingType !== 'buy' ? [
77
- { label: `${buyingType} rate`, value: `${getFormattedPrice(monthlyInstallment, '$,.2f', '', '€')} per month` },
78
- { label: 'Running time (months)', value: `${paybackPeriod} months` },
79
- { label: 'Deposit', value: getFormattedPrice(deposit, '$,.2f', ' €') }
112
+ ...monthlyInstallment ? [
113
+ {
114
+ label: t(`MyOrderPage:${buyingType}Rate`),
115
+ value: t('MyOrderPage:monthlyInstallment', { monthlyInstallment: getFormattedPrice(monthlyInstallment, '$,.2f', '', '€') })
116
+ }] : [],
117
+ ...paybackPeriod ? [{ label: t('MyOrderPage:runningTime'), value: t('MyOrderPage:paybackPeriod', { paybackPeriod })}] : [],
118
+ ...deposit ? [getDataPriceItem(deposit, t('MyOrderPage:deposit'))] : []
80
119
  ] : []
81
120
  ],
82
121
  overallRate: {
83
- label: 'Your overall rate',
122
+ label: t('MyOrderPage:yourOverallRate'),
84
123
  value: buyingType === 'buy' ? currentSalesPrice : monthlyInstallment
85
124
  }
86
125
  };