@bytebrand/fe-ui-core 4.8.56 → 4.8.57
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/media/locales/de/promoSlider.json +0 -1
- package/media/locales/en/promoSlider.json +0 -1
- package/package.json +120 -117
- package/source/components/AccordionWidget/AccordionWidget.styl +0 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +0 -24
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +2 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -2
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +9 -8
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -14
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -4
- package/source/components/_common/withStats/withStats.styl +0 -10
- package/source/components/_common/withStats/withStats.tsx +11 -2
- package/source/framework/DataTransformers.ts +0 -1
- package/source/framework/constants/common.ts +4 -8
- package/source/framework/types/types.ts +0 -1
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
- package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
- package/source/locales/data.ts +0 -3
- package/.husky/pre-push +0 -4
- package/.storybook/addons.js +0 -4
- package/.storybook/config.js +0 -64
- package/.storybook/postcss.config.js +0 -6
- package/.storybook/preview-head.html +0 -10
- package/.storybook/webpack.config.js +0 -130
- package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
- package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
- package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
- package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
- package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
- package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
- package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
- package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
- package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
- package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
- package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
- package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
- package/__tests__/components/_common/Image/Image.test.tsx +0 -82
- package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
- package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
- package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
- package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
- package/__tests__/mockedData/financingConfig.js +0 -202
- package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
- package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
- package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
- package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
- package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
- package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
- package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
- package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
- package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
- package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
- package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
- package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
- package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
- package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
- package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
- package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
- package/source/components/Alternative/Dealer.story.js +0 -32
- package/source/components/Alternative/Dealer.story.styl +0 -3
- package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
- package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
- package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
- package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
- package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
- package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
- package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
- package/source/components/ContactForm/ContactForm.story.js +0 -94
- package/source/components/ContactForm/ContactForm.story.styl +0 -0
- package/source/components/ContactInfo/ContactInfo.story.js +0 -58
- package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
- package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
- package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
- package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
- package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
- package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
- package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
- package/source/components/OfferPanel/OfferPanel.story.js +0 -139
- package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
- package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
- package/source/components/PriceRating/PriceRating.story.js +0 -39
- package/source/components/PriceRating/PriceRating.story.styl +0 -2
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
- package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
- package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
- package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
- package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
- package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
- package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
- package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
- package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
- package/source/components/SearchWidget/SearchWidget.story.js +0 -191
- package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
- package/source/components/Stepper/Stepper.story.js +0 -119
- package/source/components/Stepper/Stepper.story.styl +0 -41
- package/source/components/Theme.story.js +0 -36
- package/source/components/Theme.story.styl +0 -85
- package/source/components/TickerText/TickerText.story.js +0 -17
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
- package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
- package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
- package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
- package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
- package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
- package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
- package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
- package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
- package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
- package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
- package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
- package/source/components/_common/Accordion/Accordion.story.js +0 -36
- package/source/components/_common/Badge/Badge.story.js +0 -27
- package/source/components/_common/Badge/Badge.story.styl +0 -5
- package/source/components/_common/Bubble/Bubble.story.js +0 -52
- package/source/components/_common/Button/Button.story.js +0 -52
- package/source/components/_common/Button/Button.story.styl +0 -5
- package/source/components/_common/ButtonOld/Button.story.js +0 -54
- package/source/components/_common/ButtonOld/Button.story.styl +0 -5
- package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
- package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
- package/source/components/_common/Chip/Chip.story.js +0 -43
- package/source/components/_common/ChipList/ChipList.story.js +0 -36
- package/source/components/_common/DropDown/DropDown.story.js +0 -35
- package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
- package/source/components/_common/Histogram/Histogram.story.js +0 -51
- package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
- package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
- package/source/components/_common/Image/Image.story.js +0 -142
- package/source/components/_common/Image/Image.story.styl +0 -18
- package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
- package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
- package/source/components/_common/Loader/Loader.story.js +0 -21
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
- package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
- package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
- package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
- package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
- package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
- package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
- package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
- package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
- package/source/components/_common/Modal/Modal.story.js +0 -37
- package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
- package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
- package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
- package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
- package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
- package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
- package/source/components/_common/Radio/Radio.story.js +0 -54
- package/source/components/_common/Radio/RadioGroup.story.js +0 -90
- package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
- package/source/components/_common/Range/Range.story.js +0 -46
- package/source/components/_common/Range/Range.story.styl +0 -5
- package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
- package/source/components/_common/Tabs/Tabs.story.js +0 -56
- package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
- package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
- package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
- package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
- package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
- package/source/components/_common/withLabel/withLabel.story.js +0 -62
- package/source/components/_common/withPopover/withPopover.story.js +0 -48
- package/source/components/_common/withPopover/withPopover.story.styl +0 -54
- package/source/components/_common/withStats/withStats.story.js +0 -75
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
@import '../../../theme/theme.styl';
|
|
2
|
-
|
|
3
|
-
.wrapper
|
|
4
|
-
// position: fixed
|
|
5
|
-
width: 100%
|
|
6
|
-
height: 100%
|
|
7
|
-
left: 0px
|
|
8
|
-
background-color: red;
|
|
9
|
-
top: 0px
|
|
10
|
-
display: flex
|
|
11
|
-
background-color #CBCBCB
|
|
12
|
-
font-family: $font-style-arial
|
|
13
|
-
|
|
14
|
-
.resizable
|
|
15
|
-
margin-top: 0;
|
|
16
|
-
width: 375px;
|
|
17
|
-
padding: 100px;
|
|
18
|
-
|
|
19
|
-
.propsContainer
|
|
20
|
-
overflow-y: auto
|
|
21
|
-
|
|
22
|
-
.title
|
|
23
|
-
text-align: center
|
|
24
|
-
font-size: 22px
|
|
25
|
-
font-weight: bold
|
|
26
|
-
|
|
27
|
-
.input
|
|
28
|
-
display: inline-block !important
|
|
29
|
-
margin-left: 10px
|
|
30
|
-
position: absolute
|
|
31
|
-
right: 0
|
|
32
|
-
|
|
33
|
-
:global
|
|
34
|
-
.react-checkbox-tree
|
|
35
|
-
width: 550px
|
|
36
|
-
margin-right: 10px
|
|
37
|
-
padding-right: 10px
|
|
38
|
-
.rct-node
|
|
39
|
-
margin: 10px 0
|
|
40
|
-
position: relative
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
// Components
|
|
5
|
-
import SearchWidget from './SearchWidget';
|
|
6
|
-
|
|
7
|
-
// utils
|
|
8
|
-
import { getRequestOptions } from '../../framework/utils/RequestUtils';
|
|
9
|
-
import { buildBodyForRequest, buildQueryForSearch, changeLocation, checkRangeValuesOnEqual } from '../../framework/utils/CommonUtils';
|
|
10
|
-
import { transformManufacturers, transformModelsGeneral } from '../../framework/DataTransformers';
|
|
11
|
-
import { MANUFACTURER, MODEL, THROTTLE_DELAY, RATE_DEFAULT } from '../../framework/constants/SearchWidget';
|
|
12
|
-
import { BODY_TYPES } from '../../framework/constants/selectors';
|
|
13
|
-
|
|
14
|
-
import styles from './SearchWidget.story.styl';
|
|
15
|
-
|
|
16
|
-
const containerStyles = {
|
|
17
|
-
position: 'relative',
|
|
18
|
-
width: '600px',
|
|
19
|
-
height: '550px',
|
|
20
|
-
backgroundImage: 'url("https://dev.autode-static.de/wp-content/uploads/2019/02/startseite_br_tor_AXEL.png")'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const widget = {
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
top: '5%',
|
|
26
|
-
left: '50%',
|
|
27
|
-
transform: 'translateX(-50%)'
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const getCarsCounterUrl = 'https://www.autode-dev.de/service/car-search-endpoint/api/v1/count/car';
|
|
31
|
-
const getManufacturersUrl = 'https://www.autode-dev.de/service/car-makemodel-mapping/api/v1/information/makers';
|
|
32
|
-
const getModelsUrl = 'https://www.autode-dev.de/service/car-makemodel-mapping/api/v1/information/models?maker=';
|
|
33
|
-
|
|
34
|
-
let timeout = null;
|
|
35
|
-
|
|
36
|
-
class WidgetContainer extends React.Component {
|
|
37
|
-
constructor(props) {
|
|
38
|
-
super(props);
|
|
39
|
-
|
|
40
|
-
this.state = {
|
|
41
|
-
counter: 0,
|
|
42
|
-
counterLoading: true,
|
|
43
|
-
manufacturers: [],
|
|
44
|
-
models: [],
|
|
45
|
-
activeTab: 0,
|
|
46
|
-
filters: {
|
|
47
|
-
MANUFACTURER: '',
|
|
48
|
-
MODEL: '',
|
|
49
|
-
BODY_TYPE: [],
|
|
50
|
-
FIRST_REGISTRATION: '',
|
|
51
|
-
MILEAGE: '',
|
|
52
|
-
PRICE: { from: '', to: '' },
|
|
53
|
-
RATE: RATE_DEFAULT
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
componentDidMount() {
|
|
59
|
-
this.getCarsCounter();
|
|
60
|
-
this.getManufacturers();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
componentWillUnmount() {
|
|
64
|
-
timeout = null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
onChangeTab = (index) => this.setState(() => ({
|
|
68
|
-
activeTab: index
|
|
69
|
-
}));
|
|
70
|
-
|
|
71
|
-
onFilterChange = (value, name) => {
|
|
72
|
-
if (!name) return false;
|
|
73
|
-
const newState = Object.assign({}, this.state);
|
|
74
|
-
newState.filters[name] = value;
|
|
75
|
-
|
|
76
|
-
if (name === MANUFACTURER) {
|
|
77
|
-
newState.filters[MODEL] = '';
|
|
78
|
-
this.getModels(value.value);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
this.setState(() => (newState), () => {
|
|
82
|
-
clearTimeout(timeout);
|
|
83
|
-
timeout = setTimeout(this.getCarsCounter, THROTTLE_DELAY);
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
onSearchButtonClick = () => {
|
|
88
|
-
const { filters } = this.state;
|
|
89
|
-
const query = buildQueryForSearch(filters);
|
|
90
|
-
const resolvePrefix = query ? `search?${query}` : 'search';
|
|
91
|
-
|
|
92
|
-
this.onChangeLocation(resolvePrefix);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
onChangeLocation = (path) =>
|
|
96
|
-
changeLocation(path);
|
|
97
|
-
|
|
98
|
-
onBrandPanelClick = () => {
|
|
99
|
-
console.log(this.state.filters[MANUFACTURER]);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
getManufacturers = () =>
|
|
103
|
-
fetch(getManufacturersUrl, getRequestOptions('get'))
|
|
104
|
-
.then((res) => res.json())
|
|
105
|
-
.then((res) => {
|
|
106
|
-
const manufacturers = transformManufacturers(res.data);
|
|
107
|
-
this.updateManufacturersList(manufacturers);
|
|
108
|
-
})
|
|
109
|
-
.catch((error) => {
|
|
110
|
-
throw error;
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
getModels = (maker) =>
|
|
114
|
-
fetch(`${getModelsUrl}${maker}`, getRequestOptions('get'))
|
|
115
|
-
.then((res) => res.json())
|
|
116
|
-
.then((res) => {
|
|
117
|
-
const models = transformModelsGeneral(res.data);
|
|
118
|
-
this.setState(() => ({
|
|
119
|
-
models
|
|
120
|
-
}));
|
|
121
|
-
})
|
|
122
|
-
.catch((error) => {
|
|
123
|
-
throw error;
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
getCarsCounter = () => {
|
|
127
|
-
const { filters } = this.state;
|
|
128
|
-
const data = buildBodyForRequest(filters);
|
|
129
|
-
const obj = getRequestOptions('post', data);
|
|
130
|
-
this.setState(() => ({ counterLoading: true }));
|
|
131
|
-
|
|
132
|
-
fetch(getCarsCounterUrl, obj)
|
|
133
|
-
.then((res) => res.json())
|
|
134
|
-
.then((res) => {
|
|
135
|
-
this.updateCarCounter(res.count);
|
|
136
|
-
})
|
|
137
|
-
.catch((error) => {
|
|
138
|
-
throw error;
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
updateManufacturersList = (manufacturers) =>
|
|
143
|
-
this.setState(() => ({
|
|
144
|
-
manufacturers
|
|
145
|
-
}));
|
|
146
|
-
|
|
147
|
-
updateCarCounter = (counter) =>
|
|
148
|
-
this.setState(() => ({
|
|
149
|
-
counter,
|
|
150
|
-
counterLoading: false
|
|
151
|
-
}));
|
|
152
|
-
|
|
153
|
-
render() {
|
|
154
|
-
const { counter, counterLoading, activeTab, manufacturers, models, filters } = this.state;
|
|
155
|
-
|
|
156
|
-
const searchWidgetProps = {
|
|
157
|
-
counter,
|
|
158
|
-
counterLoading,
|
|
159
|
-
activeTab,
|
|
160
|
-
manufacturers,
|
|
161
|
-
models,
|
|
162
|
-
bodyTypes: BODY_TYPES,
|
|
163
|
-
filters,
|
|
164
|
-
showBottomLinks: false,
|
|
165
|
-
rateWidgetClassName: styles.rateWidget,
|
|
166
|
-
onChangeTab: this.onChangeTab,
|
|
167
|
-
onFilterChange: this.onFilterChange,
|
|
168
|
-
onSearchButtonClick: this.onSearchButtonClick,
|
|
169
|
-
onDetailedSearchClick: () => console.log('detailed'),
|
|
170
|
-
onBrandPanelClick: this.onBrandPanelClick,
|
|
171
|
-
rateWidgetPosition: 'left'
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
return (
|
|
175
|
-
<div>
|
|
176
|
-
<SearchWidget {...searchWidgetProps} />
|
|
177
|
-
</div>
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// For testing with api you need run storybook with custom port and host:
|
|
183
|
-
// yarn storybook -p 8080 -h local.autode-dev.de
|
|
184
|
-
storiesOf('SearchWidget', module)
|
|
185
|
-
.add('default', () => (
|
|
186
|
-
<div style={containerStyles}>
|
|
187
|
-
<div style={widget}>
|
|
188
|
-
<WidgetContainer />
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
));
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import {storiesOf} from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import Stepper from './Stepper';
|
|
6
|
-
import Step from "./Step/Step";
|
|
7
|
-
import IconSVG from "../_common/IconSVG/IconSVG";
|
|
8
|
-
import Button from "../_common/Button/Button";
|
|
9
|
-
|
|
10
|
-
import styles from './Stepper.story.styl';
|
|
11
|
-
import stepStyles from './Step/Step.styl';
|
|
12
|
-
|
|
13
|
-
const maxSteps = 4;
|
|
14
|
-
|
|
15
|
-
const CustomStep = ({index, title, active, completed, description, onClick}) => {
|
|
16
|
-
const circleClassName = React.useMemo(() => {
|
|
17
|
-
return classnames(stepStyles.circle, styles.customCircle, {
|
|
18
|
-
[styles.active]: active,
|
|
19
|
-
[styles.completed]: completed
|
|
20
|
-
});
|
|
21
|
-
}, [active, completed]);
|
|
22
|
-
|
|
23
|
-
const titleClassName = React.useMemo(() => {
|
|
24
|
-
return classnames(styles.customTitle, {
|
|
25
|
-
[styles.active]: active,
|
|
26
|
-
[styles.completed]: completed
|
|
27
|
-
})
|
|
28
|
-
}, [active, completed]);
|
|
29
|
-
|
|
30
|
-
const descriptionClassName = React.useMemo(() => {
|
|
31
|
-
return classnames(styles.customDescription, {
|
|
32
|
-
[styles.active]: active,
|
|
33
|
-
[styles.completed]: completed
|
|
34
|
-
})
|
|
35
|
-
}, [active, completed]);
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className={stepStyles.container}>
|
|
39
|
-
<div className={circleClassName} onClick={onClick}>
|
|
40
|
-
<div className={stepStyles.index}>{index + 1}</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div className={titleClassName}>{title}</div>
|
|
43
|
-
<div className={descriptionClassName}>{description}</div>
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const LinearStepper = () => {
|
|
49
|
-
const [currentStep, setStep] = React.useState(0);
|
|
50
|
-
const nextStep = React.useCallback(() => {
|
|
51
|
-
setStep(currentStep + 1);
|
|
52
|
-
}, [currentStep]);
|
|
53
|
-
|
|
54
|
-
const prevStep = React.useCallback(() => {
|
|
55
|
-
setStep(currentStep - 1);
|
|
56
|
-
}, [currentStep]);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<div className={styles.linearStepper}>
|
|
60
|
-
<div className={styles.title}>Linear stepper</div>
|
|
61
|
-
<Stepper currentStep={currentStep}>
|
|
62
|
-
<Step title='First step'/>
|
|
63
|
-
<Step title='Second step'/>
|
|
64
|
-
<CustomStep title='Custom step' description={'Description'}/>
|
|
65
|
-
<Step title='Star step' icon={
|
|
66
|
-
<IconSVG className={styles.icon} name='star' width='30px' height='30px' customDimensions/>
|
|
67
|
-
}/>
|
|
68
|
-
</Stepper>
|
|
69
|
-
<div className={styles.buttonContainer}>
|
|
70
|
-
<Button className={styles.button} disabled={currentStep < 1} onClick={prevStep}>Prev</Button>
|
|
71
|
-
<Button className={styles.button} disabled={currentStep >= maxSteps - 1} onClick={nextStep}>Next</Button>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const NonLinearStepper = () => {
|
|
78
|
-
const [currentStep, setStep] = React.useState(0);
|
|
79
|
-
const [completed, setCompleted] = React.useState(Array(maxSteps).fill(false));
|
|
80
|
-
const changeCompleted = React.useCallback((complete) => {
|
|
81
|
-
const array = completed.slice();
|
|
82
|
-
array[currentStep] = complete;
|
|
83
|
-
setCompleted(array);
|
|
84
|
-
}, [currentStep, completed]);
|
|
85
|
-
|
|
86
|
-
const complete = React.useCallback(() => {
|
|
87
|
-
changeCompleted(true);
|
|
88
|
-
}, [changeCompleted]);
|
|
89
|
-
|
|
90
|
-
const reset = React.useCallback(() => {
|
|
91
|
-
changeCompleted(false);
|
|
92
|
-
}, [changeCompleted]);
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<div>
|
|
96
|
-
<div className={styles.title}>Non linear stepper</div>
|
|
97
|
-
<Stepper currentStep={currentStep} nonLinear onStepChange={setStep}>
|
|
98
|
-
<Step title='First step' completed={completed[0]}/>
|
|
99
|
-
<Step title='Second step' completed={completed[1]}/>
|
|
100
|
-
<CustomStep title='Custom step' description={'Description'} completed={completed[2]}/>
|
|
101
|
-
<Step title='Star step' completed={completed[3]} icon={
|
|
102
|
-
<IconSVG className={styles.icon} name='star' width='30px' height='30px' customDimensions/>
|
|
103
|
-
}/>
|
|
104
|
-
</Stepper>
|
|
105
|
-
<div className={styles.buttonContainer}>
|
|
106
|
-
<Button className={styles.button} disabled={completed[currentStep]} onClick={complete}>Complete</Button>
|
|
107
|
-
<Button className={styles.button} disabled={!completed[currentStep]} onClick={reset}>Reset</Button>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
storiesOf('Stepper', module)
|
|
114
|
-
.add('default', () => (
|
|
115
|
-
<div style={{width: 720, height: 576, background: 'white', padding: 20}}>
|
|
116
|
-
<LinearStepper/>
|
|
117
|
-
<NonLinearStepper/>
|
|
118
|
-
</div>
|
|
119
|
-
));
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
.customCircle
|
|
2
|
-
background: #FCE4EC
|
|
3
|
-
|
|
4
|
-
&.completed
|
|
5
|
-
background: #F48FB1
|
|
6
|
-
|
|
7
|
-
&.active
|
|
8
|
-
background: #F06292
|
|
9
|
-
|
|
10
|
-
.customTitle
|
|
11
|
-
color: #999
|
|
12
|
-
font-weight: 600
|
|
13
|
-
|
|
14
|
-
&.completed
|
|
15
|
-
color: #F48FB1
|
|
16
|
-
|
|
17
|
-
&.active
|
|
18
|
-
color: #F06292
|
|
19
|
-
|
|
20
|
-
.customDescription
|
|
21
|
-
composes customTitle
|
|
22
|
-
font-size: 14px
|
|
23
|
-
font-weight: 400
|
|
24
|
-
|
|
25
|
-
.linearStepper
|
|
26
|
-
margin-bottom: 60px
|
|
27
|
-
|
|
28
|
-
.title
|
|
29
|
-
margin-bottom: 40px
|
|
30
|
-
font-size: 20px
|
|
31
|
-
text-align: center
|
|
32
|
-
|
|
33
|
-
.icon
|
|
34
|
-
fill: white
|
|
35
|
-
|
|
36
|
-
.buttonContainer
|
|
37
|
-
text-align: center
|
|
38
|
-
|
|
39
|
-
.button
|
|
40
|
-
display: inline-block
|
|
41
|
-
margin: 20px 10px
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { storiesOf } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import styles from './Theme.story.styl';
|
|
6
|
-
|
|
7
|
-
storiesOf('_Theme', module).
|
|
8
|
-
add('typography', () => (
|
|
9
|
-
<div className={styles.baseFont}>
|
|
10
|
-
<p className={styles.paragraph} style={{ width: '200px' }}>Lorem ipsum — класичний варіант умовного беззмістовного тексту, що вставляється в макет сторінки.</p>
|
|
11
|
-
<h1 className={styles.heading1}>Lorem ipsum heading 1</h1>
|
|
12
|
-
<h2 className={styles.heading2}>Lorem ipsum heading 2</h2>
|
|
13
|
-
<h3 className={styles.heading3}>Lorem ipsum heading 3</h3>
|
|
14
|
-
<h4 className={styles.heading4}>Lorem ipsum heading 4</h4>
|
|
15
|
-
<h5 className={styles.heading5}>Lorem ipsum heading 5</h5>
|
|
16
|
-
<h6 className={styles.heading6}>Lorem ipsum heading 6</h6>
|
|
17
|
-
</div>
|
|
18
|
-
))
|
|
19
|
-
.add('colors', () => (
|
|
20
|
-
<div className={styles.baseColor}>
|
|
21
|
-
<h3 className={styles.heading3}>Primary colors</h3>
|
|
22
|
-
<div className={styles.container}>
|
|
23
|
-
<div className={classnames(styles.plate, styles.primaryColor100)} />
|
|
24
|
-
<div className={classnames(styles.plate, styles.primaryColor70)} />
|
|
25
|
-
<div className={classnames(styles.plate, styles.primaryColor40)} />
|
|
26
|
-
<div className={classnames(styles.plate, styles.primaryColor15)} />
|
|
27
|
-
</div>
|
|
28
|
-
<h3 className={styles.heading3}>Secondary colors</h3>
|
|
29
|
-
<div className={styles.container}>
|
|
30
|
-
<div className={classnames(styles.plate, styles.secondaryColor100)} />
|
|
31
|
-
<div className={classnames(styles.plate, styles.secondaryColor70)} />
|
|
32
|
-
<div className={classnames(styles.plate, styles.secondaryColor40)} />
|
|
33
|
-
<div className={classnames(styles.plate, styles.secondaryColor15)} />
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
));
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
@import '../theme/theme.styl'
|
|
2
|
-
|
|
3
|
-
.baseFont
|
|
4
|
-
font-family: $font-style-arial
|
|
5
|
-
color: $grey-1
|
|
6
|
-
font-size: $font-size-default
|
|
7
|
-
|
|
8
|
-
.paragraph
|
|
9
|
-
composes: baseFont
|
|
10
|
-
font-weight: $font-weight-thin
|
|
11
|
-
font-size: $font-size-paragraph
|
|
12
|
-
|
|
13
|
-
.heading1
|
|
14
|
-
composes: baseFont
|
|
15
|
-
font-size: $font-size-h1
|
|
16
|
-
font-weight: $font-weight-bolder
|
|
17
|
-
|
|
18
|
-
.heading2
|
|
19
|
-
composes: baseFont
|
|
20
|
-
font-size: $font-size-h2
|
|
21
|
-
font-weight: $font-weight-bold
|
|
22
|
-
|
|
23
|
-
.heading3
|
|
24
|
-
composes: baseFont
|
|
25
|
-
font-size: $font-size-h3
|
|
26
|
-
font-weight: $font-weight-bold
|
|
27
|
-
|
|
28
|
-
.heading4
|
|
29
|
-
composes: baseFont
|
|
30
|
-
font-size: $font-size-h4
|
|
31
|
-
font-weight: $font-weight-medium
|
|
32
|
-
|
|
33
|
-
.heading5
|
|
34
|
-
composes: baseFont
|
|
35
|
-
font-size: $font-size-h5
|
|
36
|
-
font-weight: $font-weight-normal
|
|
37
|
-
|
|
38
|
-
.heading6
|
|
39
|
-
composes: baseFont
|
|
40
|
-
font-size: $font-size-h6
|
|
41
|
-
font-weight: $font-weight-normal
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.baseColor
|
|
45
|
-
position: relative
|
|
46
|
-
|
|
47
|
-
.primaryColor100
|
|
48
|
-
background-color: $primary
|
|
49
|
-
|
|
50
|
-
.primaryColor70
|
|
51
|
-
background-color: $primary70
|
|
52
|
-
|
|
53
|
-
.primaryColor40
|
|
54
|
-
background-color: $primary40
|
|
55
|
-
|
|
56
|
-
.primaryColor15
|
|
57
|
-
background-color: $primary15
|
|
58
|
-
|
|
59
|
-
.secondaryColor100
|
|
60
|
-
background-color: $secondary
|
|
61
|
-
|
|
62
|
-
.secondaryColor70
|
|
63
|
-
background-color: $secondary70
|
|
64
|
-
|
|
65
|
-
.secondaryColor40
|
|
66
|
-
background-color: $secondary40
|
|
67
|
-
|
|
68
|
-
.secondaryColor15
|
|
69
|
-
background-color: $secondary15
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.plate
|
|
73
|
-
width: 100px
|
|
74
|
-
height: 70px
|
|
75
|
-
|
|
76
|
-
.container
|
|
77
|
-
display: flex
|
|
78
|
-
flex-direction: row
|
|
79
|
-
align-items: center
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
// import { action } from '@storybook/addon-actions';
|
|
4
|
-
|
|
5
|
-
import TickerText from './TickerText';
|
|
6
|
-
|
|
7
|
-
const props = {
|
|
8
|
-
text: '+++ Wir sind unverändert für Sie da! +++ Autos bequeme von zu Hause aus kaufen. +++ Wir beraten gern telefonisch und unterstützen Sie dabei das richtige Auto zu finden. +++ Jetzt die großen Rabatte nutzen! +++ Bleiben Sie gesund, wir stehen Ihnen weiterhin mit Rat und Tat zur Seite.',
|
|
9
|
-
link: 'https://www.auto.de/magazin/online-kauf-in-zeiten-von-covid-19'
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
storiesOf('TickerText', module)
|
|
13
|
-
.add('Ticker Text', () => (
|
|
14
|
-
<div style={{ display: 'flex', justifyContent: 'center', width: '900px' }}>
|
|
15
|
-
<TickerText {...props} />
|
|
16
|
-
</div>
|
|
17
|
-
));
|
package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import OrderStatusSection from './OrderStatusSection';
|
|
5
|
-
|
|
6
|
-
const orderedCars = [
|
|
7
|
-
{
|
|
8
|
-
car: {
|
|
9
|
-
_id: '1234567890',
|
|
10
|
-
mainData: {
|
|
11
|
-
make: 'Volvo',
|
|
12
|
-
model: 'CX90',
|
|
13
|
-
subModel: 'sub model',
|
|
14
|
-
},
|
|
15
|
-
metaData: {
|
|
16
|
-
mainImageId: 'main image id'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
buyingType: 'leasing',
|
|
20
|
-
selfPickup: true,
|
|
21
|
-
paybackPeriod: 24,
|
|
22
|
-
monthlyInstallment: 1000,
|
|
23
|
-
status: 'selector_status_preparation',
|
|
24
|
-
request: '010203',
|
|
25
|
-
registration: true,
|
|
26
|
-
currentSalesPrice: 20000
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
car: {
|
|
30
|
-
_id: '1234567890',
|
|
31
|
-
mainData: {
|
|
32
|
-
make: 'Volvo',
|
|
33
|
-
model: 'CX90',
|
|
34
|
-
subModel: 'sub model',
|
|
35
|
-
},
|
|
36
|
-
metaData: {
|
|
37
|
-
mainImageId: 'main image id'
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
buyingType: 'leasing',
|
|
41
|
-
selfPickup: false,
|
|
42
|
-
paybackPeriod: 24,
|
|
43
|
-
monthlyInstallment: 1000,
|
|
44
|
-
status: 'selector_status_registration',
|
|
45
|
-
request: '010203',
|
|
46
|
-
registration: false,
|
|
47
|
-
currentSalesPrice: 20000
|
|
48
|
-
}
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
const translates = {
|
|
52
|
-
'orderStatus.title': 'Order status',
|
|
53
|
-
'orderStatus.selector_status_order_received': 'order received',
|
|
54
|
-
'orderStatus.selector_status_preparation': 'preparation',
|
|
55
|
-
'orderStatus.selector_status_registration': 'registration',
|
|
56
|
-
'orderStatus.selector_status_pick_up': 'pickup',
|
|
57
|
-
'orderStatus.selector_status_handing_over': 'handing over',
|
|
58
|
-
'orderStatus.selector_status_delivery': 'delivery',
|
|
59
|
-
'orderStatus.independentRegistration': 'independent registration',
|
|
60
|
-
'orderStatus.selector_status_order_received_desc': 'order received description',
|
|
61
|
-
'orderStatus.selector_status_preparation_desc': 'preparation description',
|
|
62
|
-
'orderStatus.selector_status_registration_desc': 'registration description',
|
|
63
|
-
'orderStatus.selector_status_pick_up_desc': 'pickup description',
|
|
64
|
-
'orderStatus.selector_status_handing_over_desc': 'handing over description',
|
|
65
|
-
'orderStatus.selector_status_delivery_desc': 'delivery description',
|
|
66
|
-
'buyingType.buy': 'buy',
|
|
67
|
-
'buyingType.leasing': 'leasing',
|
|
68
|
-
'buyingType.financing': 'financing',
|
|
69
|
-
'paybackPeriod': 'payback period',
|
|
70
|
-
'currentSalesPrice': 'current sales price',
|
|
71
|
-
'monthlyInstallment': 'monthly installment'
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const t = (phrase, options) => {
|
|
75
|
-
if (options) {
|
|
76
|
-
console.log('qqqq options ====', options);
|
|
77
|
-
const value = Object.values(options).map((option) => option)
|
|
78
|
-
return `${translates[phrase]} ${value}`;
|
|
79
|
-
}
|
|
80
|
-
return translates[phrase];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const props = {
|
|
84
|
-
t,
|
|
85
|
-
redirectToCar: (id) => console.log(`redirect to car with id: ${id}`),
|
|
86
|
-
getSupportedImageFormat: (id, mainImageId, size) => 'https://images.autode-dev.de/carimage/28121b1a-398c-4e9c-9097-51be545817c5/RQ_mHNek5hIk/small-cached.webp',
|
|
87
|
-
isFetching: false,
|
|
88
|
-
withAdditionalInfo: false,
|
|
89
|
-
orderedCars
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
storiesOf('userDashboard', module)
|
|
93
|
-
.add('OrderStatusSection', () => (
|
|
94
|
-
<OrderStatusSection {...props} />
|
|
95
|
-
));
|