@bytebrand/fe-ui-core 4.3.0 → 4.4.0
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/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +4 -2
- package/common.ts +6 -2
- package/package.json +19 -28
- package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
- package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +15 -16
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
- package/source/components/FormattedNumber/FormattedNumber.tsx +2 -3
- package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
- package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -3
- package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.tsx} +8 -13
- package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -12
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
- package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +6 -4
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +6 -2
- package/source/components/SearchFilters/filters/AlternativeID.tsx +42 -53
- package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
- package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
- package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
- package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
- package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
- package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
- package/source/components/SearchFilters/filters/Power.tsx +36 -17
- package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
- package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
- package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
- package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
- package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
- package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
- package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
- package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
- package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
- package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
- package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
- package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
- package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
- package/source/components/Stepper/Stepper.tsx +4 -3
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +38 -0
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +120 -0
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +22 -0
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +84 -0
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +11 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +57 -38
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +183 -101
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +5 -7
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +33 -7
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +10 -2
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +54 -14
- package/source/components/VehicleDetailedSidebar/partials/Price.styl +5 -1
- package/source/components/VehicleDetailedSidebar/partials/Price.tsx +2 -1
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +16 -5
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +9 -4
- package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +121 -42
- package/source/components/VehicleDetailedSlider/partials/PriceData.styl +4 -1
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +8 -1
- package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +9 -7
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +9 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.styl +3 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -7
- package/source/components/_common/Badge/Badge.styl +3 -0
- package/source/components/_common/Badge/Badge.tsx +1 -1
- package/source/components/_common/Button/Button.tsx +5 -4
- package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
- package/source/components/_common/Chip/Chip.tsx +1 -3
- package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
- package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
- package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
- package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
- package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
- package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +12 -15
- package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
- package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +3 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
- package/source/components/_common/Modal/CookieModal.tsx +1 -3
- package/source/components/_common/Modal/Modal.styled.tsx +2 -1
- package/source/components/_common/Modal/Modal.tsx +1 -5
- package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +23 -7
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -36
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +29 -14
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +17 -10
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
- package/source/components/_common/Range/Range.tsx +27 -14
- package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
- package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
- package/source/components/_common/UserMenu/MaterialMenuItem.tsx +42 -20
- package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
- package/source/components/_common/withStats/withStats.styl +3 -0
- package/source/components/_common/withStats/withStats.tsx +19 -16
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +14 -1
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +78 -42
- package/source/framework/constants/common.ts +89 -60
- package/source/framework/constants/highlights.ts +1 -1
- package/source/framework/constants.ts +1 -1
- package/source/framework/types/types.ts +9 -4
- package/source/framework/utils/CommonUtils.ts +73 -62
- package/source/framework/utils/DateUtils.ts +10 -2
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +1 -2
- package/source/framework/vehiclesProps/decoratedProps.tsx +1 -2
- package/source/locales/data.ts +2 -2
- package/tslint.json +1 -2
- package/utils.ts +2 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@import '../../../../theme/mixins.styl'
|
|
2
|
+
|
|
3
|
+
.checkoutSection
|
|
4
|
+
padding: 0;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
max-width: calc(100vw - 32px);
|
|
7
|
+
// padding: 16px 16px 16px 22px;
|
|
8
|
+
|
|
9
|
+
+media-tablet-landscape-up()
|
|
10
|
+
max-width: 1100px;
|
|
11
|
+
padding: 0;
|
|
12
|
+
|
|
13
|
+
[class*='RecentlySection__wrapVehicleSmallCard']
|
|
14
|
+
max-width: calc(100vw - 32px);
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
|
|
17
|
+
+media-tablet-up()
|
|
18
|
+
max-width: calc(50vw - 64px);
|
|
19
|
+
|
|
20
|
+
+media-tablet-landscape-up()
|
|
21
|
+
max-width: 346px;
|
|
22
|
+
|
|
23
|
+
.checkoutWrapItem
|
|
24
|
+
& + &
|
|
25
|
+
border-top: 1px solid rgba(76,78,100,0.12);
|
|
26
|
+
|
|
27
|
+
.wrapFavorites
|
|
28
|
+
border: none !important;
|
|
29
|
+
|
|
30
|
+
.favoriteBtn
|
|
31
|
+
height: 30px;
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
text-transform: none !important
|
|
34
|
+
font-weight: 400 !important;
|
|
35
|
+
|
|
36
|
+
+media-tablet-landscape-up()
|
|
37
|
+
height: 38px;
|
|
38
|
+
font-size: 14px;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import _get from 'lodash/get';
|
|
3
|
+
import DashboardSection from '../../../containers/DasboardSection/DashboardSection';
|
|
4
|
+
import styles from './CheckoutSection.styl';
|
|
5
|
+
import { isMobileOnly } from 'react-device-detect';
|
|
6
|
+
import Slider from 'react-slick';
|
|
7
|
+
import { VehicleSmallCard } from '../../../../../common';
|
|
8
|
+
import { toJS } from 'mobx';
|
|
9
|
+
// import { toJS } from 'mobx';
|
|
10
|
+
|
|
11
|
+
interface ITFunction {
|
|
12
|
+
<T = string>(key: string, options?: object): T;
|
|
13
|
+
<T = string>(keys: string[], options?: object): T;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ICheckoutSectionProps {
|
|
17
|
+
carsStore: any;
|
|
18
|
+
appStore: any;
|
|
19
|
+
imagesStore: any;
|
|
20
|
+
t?: ITFunction;
|
|
21
|
+
LinkRouter: any;
|
|
22
|
+
PLACEHOLDER_IMAGE_SMALL_URL:string;
|
|
23
|
+
checkoutCars?:any;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class CheckoutSection extends React.Component<ICheckoutSectionProps, {}> {
|
|
27
|
+
onCarSelectCheckout = (carId?: string) => {
|
|
28
|
+
const checkoutCars = this.props.checkoutCars;
|
|
29
|
+
const car = checkoutCars.find((item: any) => item.id === carId);
|
|
30
|
+
const { mainImageId, title: { model, subModel, make } } = car;
|
|
31
|
+
window.open(`/checkout/contact-information?carId=${carId}&isSavedCheckout=true&mainImageId=${mainImageId}&model=${model}&subModel=${subModel}&make=${make}`, '_blank');
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
renderCheckouts = () => {
|
|
35
|
+
const { t, appStore: { language }, carsStore, imagesStore , PLACEHOLDER_IMAGE_SMALL_URL, checkoutCars } = this.props;
|
|
36
|
+
return checkoutCars.map((car: any) => {
|
|
37
|
+
const carId = _get(car, 'id');
|
|
38
|
+
const { mainImageId, title: { model, subModel, make } } = car;
|
|
39
|
+
const src = !!mainImageId && !!car.imagesCount
|
|
40
|
+
? imagesStore.getSupportedImageFormat(carId, mainImageId, 'small')
|
|
41
|
+
: PLACEHOLDER_IMAGE_SMALL_URL;
|
|
42
|
+
const vehicleProps = {
|
|
43
|
+
...car,
|
|
44
|
+
t,
|
|
45
|
+
language,
|
|
46
|
+
mainImageId,
|
|
47
|
+
src,
|
|
48
|
+
url: `/checkout/contact-information?carId=${carId}&isSavedCheckout=true&mainImageId=${mainImageId}&model=${model}&subModel=${subModel}&make=${make}`,
|
|
49
|
+
id: carId,
|
|
50
|
+
target: '_blank',
|
|
51
|
+
rel: 'noopener noreferrer',
|
|
52
|
+
showSlider: false,
|
|
53
|
+
showOfferBtn: true,
|
|
54
|
+
showFavoriteStar: false,
|
|
55
|
+
priceSubMtl: !isMobileOnly ? t('vehicleProps:value.priceSub') : null,
|
|
56
|
+
stats: {
|
|
57
|
+
imagesCount: _get(car, 'imagesCount'),
|
|
58
|
+
statsData: carsStore.aggStatsData.get(car.id)
|
|
59
|
+
},
|
|
60
|
+
dashboardButtonText: t('vehicleProps:title.toCheckoutCar'),
|
|
61
|
+
i18nPrefixForPriceRating: 'common:',
|
|
62
|
+
className: styles.wrapFavorites,
|
|
63
|
+
classButton: styles.favoriteBtn,
|
|
64
|
+
onDetailsClick: this.onCarSelectCheckout,
|
|
65
|
+
vehicleComponentName: 'favorite'
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div key={`checkoutCar${carId}`} className={styles.checkoutWrapItem}>
|
|
70
|
+
<VehicleSmallCard {...vehicleProps} />
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
render(): JSX.Element {
|
|
77
|
+
const { t, checkoutCars } = this.props;
|
|
78
|
+
|
|
79
|
+
const sliderProps = {
|
|
80
|
+
slidesToShow: 3,
|
|
81
|
+
slidesToScroll: 1,
|
|
82
|
+
initialSlide: 2,
|
|
83
|
+
dots: false,
|
|
84
|
+
arrow: false,
|
|
85
|
+
mobileFirst: true,
|
|
86
|
+
responsive: [
|
|
87
|
+
{
|
|
88
|
+
breakpoint: 991,
|
|
89
|
+
settings: { slidesToShow: 3 }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
breakpoint: 767,
|
|
93
|
+
settings: { slidesToShow: 2 }
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
breakpoint: 574,
|
|
97
|
+
settings: { slidesToShow: 1 }
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
{checkoutCars?.length !== 0 ?
|
|
105
|
+
<DashboardSection className={styles.checkoutSection} title={t('DashboardPage:checkoutTitle')}>
|
|
106
|
+
{!isMobileOnly ?
|
|
107
|
+
this.renderCheckouts()
|
|
108
|
+
: <Slider {...sliderProps}>
|
|
109
|
+
{this.renderCheckouts()}
|
|
110
|
+
</Slider>
|
|
111
|
+
}
|
|
112
|
+
</DashboardSection>
|
|
113
|
+
: false
|
|
114
|
+
}
|
|
115
|
+
</>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default CheckoutSection;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import '../../../../theme/mixins.styl'
|
|
2
|
+
|
|
3
|
+
.wrapFavorites
|
|
4
|
+
border: none !important;
|
|
5
|
+
|
|
6
|
+
.favoriteBtn
|
|
7
|
+
height: 30px;
|
|
8
|
+
font-size: 13px;
|
|
9
|
+
text-transform: none !important
|
|
10
|
+
font-weight: 400 !important;
|
|
11
|
+
|
|
12
|
+
+media-tablet-landscape-up()
|
|
13
|
+
height: 38px;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
|
|
16
|
+
.btnCarToFavorites
|
|
17
|
+
height: 38px;
|
|
18
|
+
min-width: 160px !important;
|
|
19
|
+
font-size: 13px !important;
|
|
20
|
+
+media-tablet-landscape-up()
|
|
21
|
+
min-width: 224px !important;
|
|
22
|
+
font-size: 14px !important;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import _get from 'lodash/get';
|
|
3
|
+
import DashboardSection from '../../../containers/DasboardSection/DashboardSection';
|
|
4
|
+
import styles from './FavoriteSection.styl';
|
|
5
|
+
import { isMobileOnly } from 'react-device-detect';
|
|
6
|
+
import { VehicleSmallCard, Button } from '../../../../../common';
|
|
7
|
+
|
|
8
|
+
interface ITFunction {
|
|
9
|
+
<T = string>(key: string, options?: object): T;
|
|
10
|
+
<T = string>(keys: string[], options?: object): T;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IFavoriteSectionProps {
|
|
14
|
+
favoriteStore: any;
|
|
15
|
+
carsStore: any;
|
|
16
|
+
appStore: any;
|
|
17
|
+
imagesStore: any;
|
|
18
|
+
t?: ITFunction;
|
|
19
|
+
PLACEHOLDER_IMAGE_SMALL_URL: string;
|
|
20
|
+
LinkRouter: any;
|
|
21
|
+
favoriteCars:any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class FavoriteSection extends React.Component<IFavoriteSectionProps, {}> {
|
|
25
|
+
|
|
26
|
+
onCarSelectFavorite = (url: string) => window.open(`/search/vehicle/${url}`, '_blank');
|
|
27
|
+
|
|
28
|
+
private renderFavorites = () => {
|
|
29
|
+
const { t, appStore: { language }, carsStore, imagesStore, PLACEHOLDER_IMAGE_SMALL_URL, LinkRouter,favoriteCars } = this.props;
|
|
30
|
+
return favoriteCars.map((car: any, key: any) => {
|
|
31
|
+
const carId = _get(car, 'id');
|
|
32
|
+
const mainImageId = _get(car, 'mainImageId');
|
|
33
|
+
const src = !!mainImageId && !!car.imagesCount
|
|
34
|
+
? imagesStore.getSupportedImageFormat(carId, mainImageId, 'small')
|
|
35
|
+
: PLACEHOLDER_IMAGE_SMALL_URL;
|
|
36
|
+
const vehicleProps = {
|
|
37
|
+
...car,
|
|
38
|
+
t,
|
|
39
|
+
language,
|
|
40
|
+
src,
|
|
41
|
+
linkTag: LinkRouter,
|
|
42
|
+
showSlider: false,
|
|
43
|
+
showOfferBtn: true,
|
|
44
|
+
showFavoriteStar: false,
|
|
45
|
+
priceSubMtl: !isMobileOnly ? t('vehicleProps:value.priceSub') : null,
|
|
46
|
+
stats: {
|
|
47
|
+
imagesCount: _get(car, 'imagesCount'),
|
|
48
|
+
statsData: carsStore.aggStatsData.get(car.id)
|
|
49
|
+
},
|
|
50
|
+
i18nPrefixForPriceRating: 'common:',
|
|
51
|
+
className: styles.wrapFavorites,
|
|
52
|
+
classButton: styles.favoriteBtn,
|
|
53
|
+
onDetailsClick: this.onCarSelectFavorite,
|
|
54
|
+
vehicleComponentName: 'favorite'
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (key === 0) && <VehicleSmallCard key={`favoriteCar${carId}`} {...vehicleProps} />;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
render(): JSX.Element {
|
|
62
|
+
const { t, favoriteStore, LinkRouter } = this.props;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
{favoriteStore.showList ? (
|
|
67
|
+
<DashboardSection
|
|
68
|
+
title={t('DashboardPage:favoriteTitle')}
|
|
69
|
+
link={
|
|
70
|
+
<LinkRouter to='/favourites'>
|
|
71
|
+
<Button className={styles.btnCarToFavorites} variant='outlined'>
|
|
72
|
+
{t('vehicleProps:title.toFavoritesCar')}
|
|
73
|
+
</Button>
|
|
74
|
+
</LinkRouter>}
|
|
75
|
+
>
|
|
76
|
+
{this.renderFavorites()}
|
|
77
|
+
</DashboardSection>
|
|
78
|
+
) : false}
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default FavoriteSection;
|
package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@import '../../../../theme/mixins.styl'
|
|
3
3
|
|
|
4
4
|
.container
|
|
5
|
-
padding: 8px 8px
|
|
5
|
+
padding: 8px 8px 0px
|
|
6
6
|
border-top: 1px solid rgba(76,78,100,0.12);
|
|
7
7
|
|
|
8
8
|
+media-tablet-landscape-up()
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
top: 0;
|
|
29
29
|
left: -16px;
|
|
30
30
|
|
|
31
|
+
.overallRate
|
|
32
|
+
border-top: 1px solid rgba(76,78,100,0.12)
|
|
33
|
+
padding-top: 15px
|
|
34
|
+
|
|
31
35
|
.labelText
|
|
32
36
|
color: $black50
|
|
33
37
|
font-size: 14px
|
|
@@ -40,6 +44,7 @@
|
|
|
40
44
|
padding-bottom: 8px
|
|
41
45
|
grid-area: addresses
|
|
42
46
|
display: grid
|
|
47
|
+
row-gap: 12px
|
|
43
48
|
|
|
44
49
|
.orderPriceSection
|
|
45
50
|
grid-area: orderPrice
|
|
@@ -88,4 +93,8 @@
|
|
|
88
93
|
font-size: 14px
|
|
89
94
|
|
|
90
95
|
.montlyUnit
|
|
91
|
-
font-size: 8px
|
|
96
|
+
font-size: 8px
|
|
97
|
+
|
|
98
|
+
.priceValue
|
|
99
|
+
text-align: right
|
|
100
|
+
min-width 100px
|
package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import VehicleFormattedPrice from '../../../Vehicle/VehicleFormattedPrice/Vehicl
|
|
|
5
5
|
import Button from '../../../_common/Button/Button';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { ITFunction } from '../../../../framework/types/types';
|
|
9
9
|
|
|
10
10
|
interface IAdditionalOrderData {
|
|
11
11
|
addressData: ({ value: string; label: string; })[];
|
|
@@ -14,7 +14,7 @@ interface IAdditionalOrderData {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface IAdditionalOrderInfo {
|
|
17
|
-
t:
|
|
17
|
+
t: ITFunction;
|
|
18
18
|
additionalOrderData: IAdditionalOrderData;
|
|
19
19
|
redirectToUrl: (url: string) => void;
|
|
20
20
|
buyingType: string;
|
|
@@ -29,8 +29,8 @@ const AdditionalOrderInfo = ({ t, additionalOrderData, redirectToUrl, buyingType
|
|
|
29
29
|
|
|
30
30
|
const supportSectionClassnames = classNames(
|
|
31
31
|
styles.customerSuport,
|
|
32
|
-
{[styles.supportSectionBorder]: addressData.length > 0}
|
|
33
|
-
)
|
|
32
|
+
{ [styles.supportSectionBorder]: addressData.length > 0 }
|
|
33
|
+
);
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<div className={styles.container}>
|
|
@@ -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={styles.labelText}>{value}</div>
|
|
58
|
+
<div className={classNames(styles.labelText, styles.priceValue)}>{value}</div>
|
|
59
59
|
</div>
|
|
60
60
|
);
|
|
61
61
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from 'react';
|
|
2
2
|
import styles from './OrderStatusSection.styl';
|
|
3
3
|
import OrderStatusCard from './OrderStatusCard';
|
|
4
|
-
import Image from '../../../_common/Image/Image';
|
|
4
|
+
// import Image from '../../../_common/Image/Image';
|
|
5
5
|
import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
|
|
6
|
+
import AdditionalOrderInfo from './AdditionalOrderInfo';
|
|
6
7
|
|
|
7
8
|
// tslint:disable-next-line:interface-name
|
|
8
|
-
interface
|
|
9
|
+
interface ITFunction {
|
|
9
10
|
<T = string>(key: string, options?: object): T;
|
|
10
11
|
<T = string>(keys: string[], options?: object): T;
|
|
11
12
|
}
|
|
@@ -20,11 +21,16 @@ interface IOrderStatusCar {
|
|
|
20
21
|
paybackPeriod?: number;
|
|
21
22
|
monthlyInstallment?: number;
|
|
22
23
|
status?: string;
|
|
23
|
-
t:
|
|
24
|
+
t: ITFunction;
|
|
24
25
|
request: string;
|
|
25
26
|
registration: boolean;
|
|
26
27
|
currentSalesPrice: number;
|
|
27
28
|
onClick: () => void;
|
|
29
|
+
isFinishedOrder?: boolean;
|
|
30
|
+
additionalOrderInfoProps?: any;
|
|
31
|
+
wonStatus?: string;
|
|
32
|
+
transformedDeliveryDate?: string | null;
|
|
33
|
+
delivery?: boolean;
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
const OrderStatusCar = ({
|
|
@@ -41,7 +47,11 @@ const OrderStatusCar = ({
|
|
|
41
47
|
request,
|
|
42
48
|
registration,
|
|
43
49
|
currentSalesPrice,
|
|
44
|
-
onClick
|
|
50
|
+
onClick,
|
|
51
|
+
additionalOrderInfoProps,
|
|
52
|
+
wonStatus,
|
|
53
|
+
transformedDeliveryDate,
|
|
54
|
+
delivery
|
|
45
55
|
}: IOrderStatusCar) => {
|
|
46
56
|
const ref = useRef(null);
|
|
47
57
|
const [activeStep, setActiveStep] = useState(0); // 0 - when we have no active steps
|
|
@@ -50,11 +60,16 @@ const OrderStatusCar = ({
|
|
|
50
60
|
{ icon: 'orderReceivedDashboard', selector: 'selector_status_order_received' },
|
|
51
61
|
{ icon: 'preparaionDashboard', selector: 'selector_status_preparation' },
|
|
52
62
|
{ icon: 'registrationDashboard', selector: 'selector_status_registration' },
|
|
53
|
-
selfPickup ? { icon: 'pickupDashboard', selector: 'selector_status_pick_up' }
|
|
63
|
+
selfPickup || !delivery ? { icon: 'pickupDashboard', selector: 'selector_status_pick_up' }
|
|
54
64
|
: { icon: 'deliveryDashboard', selector: 'selector_status_delivery' },
|
|
55
65
|
{ icon: 'handingOverDashboard', selector: 'selector_status_handing_over' }
|
|
56
66
|
];
|
|
57
67
|
|
|
68
|
+
const steps = cardItems.map((step) => {
|
|
69
|
+
const { selector } = step;
|
|
70
|
+
return selector;
|
|
71
|
+
})
|
|
72
|
+
|
|
58
73
|
useEffect(
|
|
59
74
|
() => {
|
|
60
75
|
cardItems.map((step, index) => {
|
|
@@ -63,13 +78,12 @@ const OrderStatusCar = ({
|
|
|
63
78
|
setActiveStep(index + 1);
|
|
64
79
|
}
|
|
65
80
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// }
|
|
81
|
+
if (!!ref && !!ref.current && typeof ref.current.scrollBy === 'function') {
|
|
82
|
+
ref.current.scrollBy({
|
|
83
|
+
behavior: 'smooth',
|
|
84
|
+
left: 156 * steps.indexOf(status)
|
|
85
|
+
})
|
|
86
|
+
}
|
|
73
87
|
},
|
|
74
88
|
[]
|
|
75
89
|
);
|
|
@@ -90,38 +104,43 @@ const OrderStatusCar = ({
|
|
|
90
104
|
<img data-testid='car-image' src={imageUrl}/>
|
|
91
105
|
</div>
|
|
92
106
|
<div className={styles.requestId}>{request}</div>
|
|
93
|
-
<div className={styles.carPayment}
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
<div className={styles.carPayment}>
|
|
108
|
+
{wonStatus === 'won' && !!transformedDeliveryDate ? transformedDeliveryDate
|
|
109
|
+
: <>
|
|
110
|
+
{t(`buyingType.${buyingType}`)},
|
|
111
|
+
{buyingType !== 'buy' && `${t('paybackPeriod', { paybackPeriod })},`}
|
|
112
|
+
{buyingType === 'buy' ?
|
|
113
|
+
t('currentSalesPrice', { currentSalesPrice: getFormattedPrice(currentSalesPrice) })
|
|
114
|
+
: t('monthlyInstallment', { monthlyInstallment: getFormattedPrice(monthlyInstallment, '$,.2f') })
|
|
115
|
+
}
|
|
116
|
+
</>
|
|
99
117
|
}
|
|
100
118
|
</div>
|
|
101
119
|
</div>
|
|
102
120
|
</div>
|
|
103
|
-
<
|
|
104
|
-
{
|
|
105
|
-
|
|
121
|
+
{wonStatus === 'won' ? <AdditionalOrderInfo { ...additionalOrderInfoProps } />
|
|
122
|
+
: <div className={styles.cardsSection} ref={ref}>
|
|
123
|
+
{cardItems.map((card, index) => {
|
|
124
|
+
const { icon, selector } = card;
|
|
106
125
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
126
|
+
const statusDescription = !registration && index === 2 ?
|
|
127
|
+
t('orderStatus.independentRegistration') :
|
|
128
|
+
t(`orderStatus.${selector}_desc`);
|
|
110
129
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
return (
|
|
131
|
+
<OrderStatusCard
|
|
132
|
+
title={t(`orderStatus.${selector}`)}
|
|
133
|
+
description={statusDescription}
|
|
134
|
+
icon={icon}
|
|
135
|
+
key={index}
|
|
136
|
+
isActive={index + 1 === activeStep}
|
|
137
|
+
isDisabled={index + 1 > activeStep}
|
|
138
|
+
isDone={index + 1 < activeStep}
|
|
139
|
+
/>
|
|
140
|
+
);
|
|
141
|
+
})}
|
|
142
|
+
</div>
|
|
143
|
+
}
|
|
125
144
|
</div>
|
|
126
145
|
</div>
|
|
127
146
|
);
|
|
@@ -13,7 +13,7 @@ interface IOrderStatusCard {
|
|
|
13
13
|
isDone?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const OrderStatusCard = ({ icon, title, description, isDisabled,
|
|
16
|
+
const OrderStatusCard = ({ icon, title, description, isDisabled, isActive, isDone }: IOrderStatusCard) => {
|
|
17
17
|
const orderReceivedCardClasses = classnames(
|
|
18
18
|
styles.orderReceivedCard,
|
|
19
19
|
{ [styles.cardInProgress]: isActive }
|
|
@@ -27,7 +27,7 @@ const OrderStatusCard = ({ icon, title, description, isDisabled, cardRef, isActi
|
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<div className={styles.orderReceivedCardContainer}>
|
|
30
|
-
<div data-testid='orderStatusCard' className={orderReceivedCardClasses}
|
|
30
|
+
<div data-testid='orderStatusCard' className={orderReceivedCardClasses}>
|
|
31
31
|
<div className={styles.cardIcon}>
|
|
32
32
|
<IconSVG disabled={isDisabled} customDimensions name={icon} width={87}/>
|
|
33
33
|
</div>
|