@bytebrand/fe-ui-core 4.2.207 → 4.2.209

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.207",
3
+ "version": "4.2.209",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -30,6 +30,7 @@ interface IOrderStatusCar {
30
30
  additionalOrderInfoProps?: any;
31
31
  wonStatus?: string;
32
32
  transformedDeliveryDate?: string | null;
33
+ delivery?: boolean;
33
34
  }
34
35
 
35
36
  const OrderStatusCar = ({
@@ -49,7 +50,8 @@ const OrderStatusCar = ({
49
50
  onClick,
50
51
  additionalOrderInfoProps,
51
52
  wonStatus,
52
- transformedDeliveryDate
53
+ transformedDeliveryDate,
54
+ delivery
53
55
  }: IOrderStatusCar) => {
54
56
  const ref = useRef(null);
55
57
  const [activeStep, setActiveStep] = useState(0); // 0 - when we have no active steps
@@ -58,7 +60,7 @@ const OrderStatusCar = ({
58
60
  { icon: 'orderReceivedDashboard', selector: 'selector_status_order_received' },
59
61
  { icon: 'preparaionDashboard', selector: 'selector_status_preparation' },
60
62
  { icon: 'registrationDashboard', selector: 'selector_status_registration' },
61
- selfPickup ? { icon: 'pickupDashboard', selector: 'selector_status_pick_up' }
63
+ selfPickup || !delivery ? { icon: 'pickupDashboard', selector: 'selector_status_pick_up' }
62
64
  : { icon: 'deliveryDashboard', selector: 'selector_status_delivery' },
63
65
  { icon: 'handingOverDashboard', selector: 'selector_status_handing_over' }
64
66
  ];
@@ -155,7 +155,10 @@ const OrderStatusSection = ({
155
155
  paymentProtectionInsuranceCost,
156
156
  wonStatus,
157
157
  warranty,
158
- deliveryDate
158
+ deliveryDate,
159
+ isLicensePlateFee,
160
+ delivery,
161
+ extrasSumCost
159
162
  } = orderedCar;
160
163
 
161
164
  const transformedDeliveryDate = !!deliveryDate ? `${t('MyOrderPage:deliveredOn')} ${fromUTCToDateString(deliveryDate)}` : null;
@@ -170,9 +173,10 @@ const OrderStatusSection = ({
170
173
  carPriceData: [
171
174
  ...currentSalesPrice ? [getDataPriceItem(currentSalesPriceWithWarranty, carPriceWithWarrantyTitle(warranty))] : [],
172
175
  ...preparationCost ? [getDataPriceItem(preparationCost, t('MyOrderPage:preparationCost'))] : [],
173
- ...registrationCost ? [getDataPriceItem(registrationCost, t('MyOrderPage:vehicleRegistration'))] : [],
174
- ...licensePlateCost ? [getDataPriceItem(licensePlateCost, t('MyOrderPage:licensePlates'))] : [],
175
- ...transportationCost ? [getDataPriceItem(transportationCost, t('MyOrderPage:delivery'))] : [],
176
+ ...extrasSumCost ? [getDataPriceItem(extrasSumCost, t('MyOrderPage:extrasSumCost'))] : [],
177
+ ...registrationCost && registration ? [getDataPriceItem(registrationCost, t('MyOrderPage:vehicleRegistration'))] : [],
178
+ ...licensePlateCost && isLicensePlateFee ? [getDataPriceItem(licensePlateCost, t('MyOrderPage:licensePlates'))] : [],
179
+ ...transportationCost && delivery ? [getDataPriceItem(transportationCost, t('MyOrderPage:delivery'))] : [],
176
180
  ...paymentProtectionInsuranceCost ? [getDataPriceItem(paymentProtectionInsuranceCost, t('MyOrderPage:paymentProtectionInsuranceCost'))]: [],
177
181
  ...firstRate ? [getDataPriceItem(firstRate, t('MyOrderPage:firstRate'))] : [],
178
182
  ...buyingType !== 'buy' ? [
@@ -217,7 +221,8 @@ const OrderStatusSection = ({
217
221
  onClick: () => onDetailsClick(_id),
218
222
  additionalOrderInfoProps,
219
223
  wonStatus,
220
- transformedDeliveryDate
224
+ transformedDeliveryDate,
225
+ delivery
221
226
  };
222
227
 
223
228
  const title = <span>
@@ -15,6 +15,7 @@ export interface IButtonProps {
15
15
  color?: variantColor;
16
16
  children?: any;
17
17
  variant?: variantType;
18
+ getRef?: (ref: HTMLButtonElement) => void;
18
19
 
19
20
  disabled?: boolean;
20
21
  loading?: boolean;
@@ -25,7 +26,7 @@ export interface IButtonProps {
25
26
  onMouseLeave?: (event: React.MouseEvent<HTMLButtonElement>) => void;
26
27
  }
27
28
 
28
- const Button: React.FC<IButtonProps> = ({ className, color, onClick, onMouseEnter, onMouseLeave, variant, loading, disabled, children }: IButtonProps) => {
29
+ const Button: React.FC<IButtonProps> = ({ getRef, className, color, onClick, onMouseEnter, onMouseLeave, variant, loading, disabled, children }: IButtonProps) => {
29
30
  const onHandlerClick = (event: React.MouseEvent<HTMLButtonElement>) => {
30
31
  event.stopPropagation();
31
32
  event.nativeEvent.stopImmediatePropagation();
@@ -52,6 +53,7 @@ const Button: React.FC<IButtonProps> = ({ className, color, onClick, onMouseEnte
52
53
  onClick: onHandlerClick,
53
54
  onMouseEnter: onHandlerMouseEnter,
54
55
  onMouseLeave: onHandlerMouseLeave,
56
+ ref:getRef,
55
57
  disabled: disabled || loading
56
58
  };
57
59
 
@@ -69,7 +71,7 @@ Button.defaultProps = {
69
71
  buttonType: 'button',
70
72
 
71
73
  onClick: () => { },
72
-
74
+ getRef: () => { },
73
75
  onMouseEnter: () => { },
74
76
  onMouseLeave: () => { }
75
77
  };
@@ -23,13 +23,17 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
23
23
  const dealerId = _get(car, 'metaData.ownerId') || null;
24
24
  const carId = _get(car, '_id', '');
25
25
  const onAutoDeIdClick = () => {
26
- btnEl.current.onClick();
26
+ btnEl.current?.click();
27
27
  };
28
28
 
29
29
  const controlsContainerClassName = classnames(
30
30
  styles.controlsContainer,
31
31
  controlsClassContainer
32
32
  );
33
+
34
+ const getRef = (ref: HTMLButtonElement): void => {
35
+ btnEl.current = ref;
36
+ };
33
37
  return (
34
38
  <>
35
39
  <div className={controlsContainerClassName}>
@@ -42,7 +46,7 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
42
46
  isLoading: boolean,
43
47
  isSale: boolean,
44
48
  isAlternative: boolean
45
- ) => {
49
+ ) => {
46
50
  const { metaData } = car;
47
51
  const isAlternativeType = !!metaData && !!metaData.type;
48
52
  const offerButtonClassName = classnames(
@@ -63,10 +67,10 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
63
67
 
64
68
  return (
65
69
  <StyledButton
66
- refs={btnEl}
67
70
  className={offerButtonClassName}
68
71
  onClick={onClick}
69
72
  loading={isLoading}
73
+ getRef={getRef}
70
74
  >
71
75
  {isOfferRequested
72
76
  ? null