@bytebrand/fe-ui-core 4.8.46 → 4.8.48

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.
Files changed (190) hide show
  1. package/bytebrand-fe-ui-core-4.8.47.tgz +0 -0
  2. package/media/locales/de/promoSlider.json +0 -1
  3. package/media/locales/en/promoSlider.json +0 -1
  4. package/package.json +5 -3
  5. package/source/components/AccordionWidget/AccordionWidget.styl +0 -1
  6. package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
  7. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
  8. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -1
  9. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +9 -8
  10. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
  11. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
  12. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
  13. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
  14. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
  15. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
  16. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
  17. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  18. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +6 -15
  19. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
  20. package/source/components/_common/withStats/withStats.styl +21 -0
  21. package/source/components/_common/withStats/withStats.tsx +21 -4
  22. package/source/framework/DataTransformers.ts +0 -1
  23. package/source/framework/constants/common.ts +4 -8
  24. package/source/framework/types/types.ts +0 -1
  25. package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
  26. package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
  27. package/source/locales/data.ts +5 -4
  28. package/.husky/pre-push +0 -4
  29. package/.storybook/addons.js +0 -4
  30. package/.storybook/config.js +0 -64
  31. package/.storybook/postcss.config.js +0 -6
  32. package/.storybook/preview-head.html +0 -10
  33. package/.storybook/webpack.config.js +0 -130
  34. package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
  35. package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
  36. package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
  37. package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
  38. package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
  39. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
  40. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
  41. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
  42. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
  43. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
  44. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
  45. package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
  46. package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
  47. package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
  48. package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
  49. package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
  50. package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
  51. package/__tests__/components/_common/Image/Image.test.tsx +0 -82
  52. package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
  53. package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
  54. package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
  55. package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
  56. package/__tests__/mockedData/financingConfig.js +0 -202
  57. package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
  58. package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
  59. package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
  60. package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
  61. package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
  62. package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
  63. package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
  64. package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
  65. package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
  66. package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
  67. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
  68. package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
  69. package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
  70. package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
  71. package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
  72. package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
  73. package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
  74. package/source/components/Alternative/Dealer.story.js +0 -32
  75. package/source/components/Alternative/Dealer.story.styl +0 -3
  76. package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
  77. package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
  78. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
  79. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
  80. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
  81. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
  82. package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
  83. package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
  84. package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
  85. package/source/components/ContactForm/ContactForm.story.js +0 -94
  86. package/source/components/ContactForm/ContactForm.story.styl +0 -0
  87. package/source/components/ContactInfo/ContactInfo.story.js +0 -58
  88. package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
  89. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
  90. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
  91. package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
  92. package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
  93. package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
  94. package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
  95. package/source/components/OfferPanel/OfferPanel.story.js +0 -139
  96. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
  97. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
  98. package/source/components/PriceRating/PriceRating.story.js +0 -39
  99. package/source/components/PriceRating/PriceRating.story.styl +0 -2
  100. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
  101. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
  102. package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
  103. package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
  104. package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
  105. package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
  106. package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
  107. package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
  108. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
  109. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
  110. package/source/components/SearchWidget/SearchWidget.story.js +0 -191
  111. package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
  112. package/source/components/Stepper/Stepper.story.js +0 -119
  113. package/source/components/Stepper/Stepper.story.styl +0 -41
  114. package/source/components/Theme.story.js +0 -36
  115. package/source/components/Theme.story.styl +0 -85
  116. package/source/components/TickerText/TickerText.story.js +0 -17
  117. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
  118. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
  119. package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
  120. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
  121. package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
  122. package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
  123. package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
  124. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
  125. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
  126. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
  127. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
  128. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
  129. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
  130. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
  131. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
  132. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
  133. package/source/components/_common/Accordion/Accordion.story.js +0 -36
  134. package/source/components/_common/Badge/Badge.story.js +0 -27
  135. package/source/components/_common/Badge/Badge.story.styl +0 -5
  136. package/source/components/_common/Bubble/Bubble.story.js +0 -52
  137. package/source/components/_common/Button/Button.story.js +0 -52
  138. package/source/components/_common/Button/Button.story.styl +0 -5
  139. package/source/components/_common/ButtonOld/Button.story.js +0 -54
  140. package/source/components/_common/ButtonOld/Button.story.styl +0 -5
  141. package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
  142. package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
  143. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
  144. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
  145. package/source/components/_common/Chip/Chip.story.js +0 -43
  146. package/source/components/_common/ChipList/ChipList.story.js +0 -36
  147. package/source/components/_common/DropDown/DropDown.story.js +0 -35
  148. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
  149. package/source/components/_common/Histogram/Histogram.story.js +0 -51
  150. package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
  151. package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
  152. package/source/components/_common/Image/Image.story.js +0 -142
  153. package/source/components/_common/Image/Image.story.styl +0 -18
  154. package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
  155. package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
  156. package/source/components/_common/Loader/Loader.story.js +0 -21
  157. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
  158. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
  159. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
  160. package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
  161. package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
  162. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
  163. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
  164. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
  165. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
  166. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
  167. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
  168. package/source/components/_common/Modal/Modal.story.js +0 -37
  169. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
  170. package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
  171. package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
  172. package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
  173. package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
  174. package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
  175. package/source/components/_common/Radio/Radio.story.js +0 -54
  176. package/source/components/_common/Radio/RadioGroup.story.js +0 -90
  177. package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
  178. package/source/components/_common/Range/Range.story.js +0 -46
  179. package/source/components/_common/Range/Range.story.styl +0 -5
  180. package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
  181. package/source/components/_common/Tabs/Tabs.story.js +0 -56
  182. package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
  183. package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
  184. package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
  185. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
  186. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  187. package/source/components/_common/withLabel/withLabel.story.js +0 -62
  188. package/source/components/_common/withPopover/withPopover.story.js +0 -48
  189. package/source/components/_common/withPopover/withPopover.story.styl +0 -54
  190. package/source/components/_common/withStats/withStats.story.js +0 -75
@@ -1,97 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
-
4
- import RequestedCarsSection from './RequestedCarsSection';
5
-
6
- const requestedCars = [
7
- {
8
- car: {
9
- _id: '1234567892',
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: 'financing',
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
- 'DealerDashboardPage:buyingType.buy': 'buy',
53
- 'DealerDashboardPage:buyingType.leasing': 'leasing',
54
- 'DealerDashboardPage:buyingType.financing': 'financing',
55
- 'DealerDashboardPage:paybackPeriod': 'payback period',
56
- 'DealerDashboardPage:currentSalesPrice': 'current sales price',
57
- 'DealerDashboardPage:monthlyInstallment': 'monthly installment',
58
- 'DealerDashboardPage:requestedCars.requestedCarsTitle':'Requested cars',
59
- 'DealerDashboardPage:requestedCars.toOffer': 'To offer',
60
- 'DealerDashboardPage:requestedCars.customerService':'Support',
61
- 'DealerDashboardPage:requestedCars.customerServiceText':'Do you have questions about your desired vehicle or about car financing, delivery or registration? Please use the contact form and let us know your question. We will get back to you as soon as possible. Thank you very much.',
62
- 'DealerDashboardPage:requestedCars.contact':'Contact'
63
- }
64
-
65
- const t = (phrase, options) => {
66
- if (options) {
67
- console.log('qqqq options ====', options);
68
- const value = Object.values(options).map((option) => option)
69
- return `${translates[phrase]} ${value}`;
70
- }
71
- return translates[phrase];
72
- }
73
- const LinkRouter = ({ children, link }) => {
74
- return (
75
- <a href={link} >
76
- { children }
77
- </a>
78
- );
79
- };
80
- const initHotjar = () => {
81
- console.log('Hotjar works')
82
- };
83
-
84
- const props = {
85
- t,
86
- redirectToCar: (id) => console.log(`redirect to car with id: ${id}`),
87
- getSupportedImageFormat: (id, mainImageId, size) => 'https://images.autode-dev.de/carimage/28121b1a-398c-4e9c-9097-51be545817c5/RQ_mHNek5hIk/small-cached.webp',
88
- requestedCars,
89
- LinkRouter,
90
- initHotjar
91
- };
92
-
93
-
94
- storiesOf('userDashboard', module)
95
- .add('RequestedCarsSection', () => (
96
- <RequestedCarsSection {...props} />
97
- ));
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
-
4
- import VehicleConsumption from './VehicleConsumption';
5
-
6
- // Stateful container for testing interaction
7
- class VehicleConsumptionContainer extends React.Component {
8
- render() {
9
- const props = {
10
- t: key => key,
11
- consumption: {
12
- consumptionCombined: 5.6
13
- },
14
- environmentEmissions: {
15
- co2: 127
16
- }
17
- };
18
-
19
- return (
20
- <div>
21
- <VehicleConsumption {...props} />
22
- </div>
23
- );
24
- }
25
- }
26
-
27
- storiesOf('VehicleConsumption', module).add('Default', () => (
28
- <div>
29
- <VehicleConsumptionContainer />
30
- </div>
31
- ));
@@ -1,247 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
-
4
- import VehicleFormattedPrice from './VehicleFormattedPrice';
5
-
6
- const container = {
7
- width: 400,
8
- };
9
-
10
- const item = {
11
- display: 'flex',
12
- justifyContent: 'space-between',
13
- alignItems: 'center'
14
- };
15
-
16
- const storiesDefault = [
17
- {
18
- title: 'simple case',
19
- props: {
20
- price: 176,
21
- isOld: true
22
- }
23
- },
24
- {
25
- title: 'falsie value',
26
- props: {
27
- price: 0,
28
- isOld: true,
29
- toRound: false
30
- }
31
- },
32
- {
33
- title: 'large number',
34
- props: {
35
- price: 6500000,
36
- isOld: true
37
- }
38
- },
39
- {
40
- title: 'not rounded',
41
- props: {
42
- price: 19689.23,
43
- toRound: false
44
- }
45
- },
46
- {
47
- title: 'type "new"',
48
- props: {
49
- price: 19689.23,
50
- isNew: true
51
- }
52
- },
53
- {
54
- title: 'type "old"',
55
- props: {
56
- price: 19689.23,
57
- isOld: true
58
- }
59
- }
60
- // {
61
- // title: 'short',
62
- // props: {
63
- // price: 42
64
- // }
65
- // },
66
- // {
67
- // title: 'short grouped',
68
- // props: {
69
- // price: 42069
70
- // }
71
- // },
72
- // {
73
- // title: 'long',
74
- // props: {
75
- // price: 69000000,
76
- // unit: '₴'
77
- // }
78
- // },
79
- // {
80
- // title: 'very long',
81
- // props: {
82
- // price: 419999999999999
83
- // }
84
- // },
85
- // {
86
- // title: 'postfixed',
87
- // props: {
88
- // price: 12345,
89
- // postfix: 1
90
- // }
91
- // }
92
- ];
93
-
94
- const storiesLarge= [
95
- {
96
- title: 'simple case',
97
- props: {
98
- price: 176,
99
- size: 'large'
100
- }
101
- },
102
- {
103
- title: 'large number',
104
- props: {
105
- price: 6500000,
106
- size: 'large'
107
- }
108
- },
109
- {
110
- title: 'not rounded',
111
- props: {
112
- price: 19689.23,
113
- toRound: false,
114
- size: 'large'
115
- }
116
- },
117
- {
118
- title: 'type "new"',
119
- props: {
120
- price: 19689.23,
121
- isNew: true,
122
- size: 'large'
123
- }
124
- },
125
- {
126
- title: 'type "old"',
127
- props: {
128
- price: 19689.23,
129
- isOld: true,
130
- size: 'large'
131
- }
132
- }
133
- ];
134
-
135
- const storiesSmall= [
136
- {
137
- title: 'simple case',
138
- props: {
139
- price: 176,
140
- size: 'small'
141
- }
142
- },
143
- {
144
- title: 'large number',
145
- props: {
146
- price: 6500000,
147
- size: 'small'
148
- }
149
- },
150
- {
151
- title: 'not rounded',
152
- props: {
153
- price: 19689.23,
154
- toRound: false,
155
- size: 'small'
156
- }
157
- },
158
- {
159
- title: 'type "new"',
160
- props: {
161
- price: 19689.23,
162
- isNew: true,
163
- size: 'small'
164
- }
165
- },
166
- {
167
- title: 'type "old"',
168
- props: {
169
- price: 19689.23,
170
- isOld: true,
171
- size: 'small'
172
- }
173
- }
174
- ];
175
-
176
- const otherCases = [
177
- {
178
- title: 'old',
179
- props: {
180
- price: 19689.23,
181
- disableStyles: true,
182
- toRound: false,
183
- isOld: true
184
- }
185
- },
186
- {
187
- title: 'disable unit and not rounded',
188
- props: {
189
- price: 19689.23,
190
- unit: '',
191
- disableStyles: true,
192
- toRound: false
193
- }
194
- },
195
- {
196
- title: 'disable formatting',
197
- props: {
198
- price: 19689.23,
199
- unit: '',
200
- disableStyles: true,
201
- toRound: false,
202
- disableFormatting: true
203
- }
204
- }
205
- ];
206
-
207
- storiesOf('FormattedPrice', module)
208
- .add('default', () => (
209
- <div style={container}>
210
- {storiesDefault.map(({ title, props }, index) => (
211
- <div style={item} key={index}>
212
- <p>{title} ({props.price})</p>
213
- <VehicleFormattedPrice {...props} />
214
- </div>
215
- ))}
216
- </div>
217
- ))
218
- .add('large', () => (
219
- <div style={container}>
220
- {storiesLarge.map(({ title, props }, index) => (
221
- <div style={item} key={index}>
222
- <p>{title} ({props.price})</p>
223
- <VehicleFormattedPrice {...props} />
224
- </div>
225
- ))}
226
- </div>
227
- ))
228
- .add('small', () => (
229
- <div style={container}>
230
- {storiesSmall.map(({ title, props }, index) => (
231
- <div style={item} key={index}>
232
- <p>{title} ({props.price})</p>
233
- <VehicleFormattedPrice {...props} />
234
- </div>
235
- ))}
236
- </div>
237
- ))
238
- .add('other cases (without styles)', () => (
239
- <div style={container}>
240
- {otherCases.map(({ title, props }, index) => (
241
- <div style={item} key={index}>
242
- <p>{title} ({props.price})</p>
243
- <VehicleFormattedPrice {...props} />
244
- </div>
245
- ))}
246
- </div>
247
- ));
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
-
5
- import CompareGeneral from './CompareGeneral.tsx';
6
-
7
- const props = {
8
- imageURL: 'http://87.118.82.201/carimage/c8374aa8-8266-4b40-81ca-f5fb0c71f993/swiJg18-76KK/small',
9
- title: {
10
- manufacturer: 'bmw',
11
- model: '320',
12
- subModel: 'Sport V6 HSE',
13
- powerKW: 120,
14
- powerPS: 100
15
- },
16
- price: {
17
- currentPrice: 29000,
18
- perMonthPrice: 1000,
19
- currency: '€',
20
- months: 20
21
- },
22
- onDeleteClick: action('click')
23
- };
24
-
25
- storiesOf('Compared vehicle', module)
26
- .add('Compare general', () => (
27
- <div style={{ width: 300 }}>
28
- <CompareGeneral {...props} />
29
- </div>
30
- ));
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import ComparePrice from './ComparePrice.tsx';
5
-
6
- const props = {
7
- currentPrice: 29000,
8
- perMonthPrice: 1000,
9
- currency: '€',
10
- months: 29
11
- };
12
-
13
- storiesOf('Compared vehicle', module)
14
- .add('Compare price', () => (
15
- <div style={{ background: 'lightgray', width: 300 }}>
16
- <ComparePrice {...props} />
17
- </div>
18
- ));
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import CompareTitle from './CompareTitle.tsx';
5
-
6
- const props = {
7
- manufacturer: 'bmw',
8
- model: '320',
9
- subModel: 'Sport V6 HSE',
10
- powerKW: 120,
11
- powerPS: 100
12
- };
13
-
14
- storiesOf('Compared vehicle', module)
15
- .add('Compare title', () => (
16
- <div style={{ background: 'lightgray', width: 300 }}>
17
- <CompareTitle {...props} />
18
- </div>
19
- ));
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- import { Resizable } from 're-resizable';
3
- import { storiesOf } from '@storybook/react';
4
- import { action } from '@storybook/addon-actions';
5
- import VehicleDetailedSidebar from './VehicleDetailedSidebar.tsx';
6
-
7
-
8
- const wrapperProps = {
9
- border: '1px solid rgba(0,0,0,0.1)',
10
- borderRadius: '2px',
11
- backgroundColor: '#fff'
12
- };
13
-
14
- const resizableProps = {
15
- minWidth: 595,
16
- defaultSize: { width: 724, height: 'auto' }
17
- };
18
-
19
- const VehicleDetailedSidebarStory = () => {
20
- const sidebarProps = {
21
- title: {
22
- make: 'BMW',
23
- model: '218',
24
- subModel: '218i Advantage',
25
- powerKW: 100,
26
- powerPS: 136,
27
- isCarInFavorite: true,
28
- onCarFavorite: action('onCarFavorite(event, id)')
29
- }
30
- };
31
-
32
- return (
33
- <>
34
- <p>Sidebar on CDP</p>
35
- <div style={wrapperProps}>
36
- <Resizable {...resizableProps}>
37
- <VehicleDetailedSidebar {...sidebarProps} />
38
- </Resizable>
39
- </div>
40
- </>
41
- );
42
- };
43
-
44
- storiesOf('VehicleDetailedSidebar', module).add('VehicleDetailedSidebar', () => <VehicleDetailedSidebarStory />);
@@ -1,120 +0,0 @@
1
- import React from 'react';
2
- import i18next from 'i18next';
3
- import { Resizable } from 're-resizable';
4
- import { withNamespaces } from 'react-i18next';
5
- import { storiesOf } from '@storybook/react';
6
- import { action } from '@storybook/addon-actions';
7
- import VehicleDetailedSlider from './VehicleDetailedSlider.tsx';
8
-
9
- i18next.addResourceBundle('de', 'VehicleDetailsPage', {
10
- "slider": {
11
- "topPrices": "Top-Preise",
12
- "comingSoon": "Demnächst",
13
- "firstPicture": "Erstes Bild",
14
- "currentSlide": "von",
15
- "fullScreen": "Vollbild",
16
- "exterior": "Außen",
17
- "interior": "Innen",
18
- "comparableCars": "Vergleichbare Autos",
19
- "comparableCarsMobile": "Vergleichbare Autos",
20
- "othersLooked": "Andere haben ebenso angeschaut",
21
- "saveCarAsFavorites": "{{ count }} Favoriten",
22
- "customersLookingTheCar": "{{ count}} Ansichten",
23
- "checked": "geprüft",
24
- "easy": "einfach",
25
- "safe": "sicher",
26
- "toBuy": "kaufen",
27
- "callForFree": "kostenfrei anrufen",
28
- "save": "sparen",
29
- "new": "neu"
30
- },
31
- });
32
-
33
- const wrapperProps = {
34
- border: '1px solid rgba(0,0,0,0.1)',
35
- borderRadius: '2px',
36
- backgroundColor: '#fff'
37
- };
38
-
39
- const resizableProps = {
40
- minWidth: 595,
41
- defaultSize: { width: 724, height: 'auto' }
42
- };
43
-
44
- const IMAGE_URL = 'https://picsum.photos/400/300/?random';
45
- const images = [];
46
- for (let i = 0; i <= 10; i++) {
47
- images.push({
48
- imageUrlSmall: `${IMAGE_URL}&tag=${Math.random()}`,
49
- imageUrlLarge: `${IMAGE_URL}&tag=${Math.random()}`
50
- });
51
- }
52
-
53
-
54
- const VehicleDetailedSliderStory = () => {
55
- const sliderProps = {
56
- showModal: action('showModal(id: string, props?: any)'),
57
- hideModal: action('hideModal(id: string)'),
58
- price: {
59
- monthlyInstallment: 29,
60
- oldMonthlyInstallment: 49,
61
- isStrikeShown: true,
62
- currency: "EUR",
63
- currentSalesPrice: 16160,
64
- historyPriceDifference: 5629.6,
65
- historyPriceDifferencePerCent: 26,
66
- mlCurrentSalesPriceCategory: null,
67
- mlCurrentSalesPriceDiffPercent: null,
68
- mlCurrentSalesPricePredicted: 100,
69
- totalCurrent: 50,
70
- originalSalesPrice: 13467,
71
- priceDate: null,
72
- priceId: null,
73
- recomendedRetailPrice: null,
74
- retailToCurrentPriceDifference: 0,
75
- vatDeductible: null,
76
- vatRate: 7,
77
- wasPrice: 10000,
78
- leasing: {
79
- monthlyInstallment: 49,
80
- oldMonthlyInstallment: 69,
81
- isActive: true
82
- },
83
- buy: {
84
- currentSalesPriceExtra: 16110,
85
- highestPriceExtra: 19349
86
- }
87
- },
88
- modificationDate: 1535760000,
89
- mainImageUrl: 'http://placehold.jp/400x300.png?text=mainImage',
90
- mainImageBlur: true,
91
- showNewLabel: true,
92
- photos: images,
93
- exteriorPhotos: 'http://placehold.jp/400x300.png?text=mainImage',
94
- interiorPhoto: 'http://placehold.jp/400x300.png?text=mainImage',
95
- statsData: {
96
- totalCarImpCount: 10,
97
- totalFavCount: 20,
98
- },
99
- make: 'Audi',
100
- model: 'A4',
101
- subModel: 'Shooting Brake',
102
- powerKW: 35,
103
- powerPS: 120,
104
- isFavorite: false,
105
- onCarFavorite: action('onCarFavorite(event, id)')
106
- };
107
-
108
- return (
109
- <>
110
- <p>Main image on CDP with MagnifyGlass</p>
111
- <div style={wrapperProps}>
112
- <Resizable {...resizableProps}>
113
- <VehicleDetailedSlider {...sliderProps} />
114
- </Resizable>
115
- </div>
116
- </>
117
- );
118
- };
119
-
120
- storiesOf('VehicleDetailedSlider', module).add('VehicleDetailedSlider', () => <VehicleDetailedSliderStory />);
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
-
5
- import VehiclePromoInfo from './VehiclePromoInfo';
6
-
7
- // Stateful container for testing interaction
8
- class VehiclePromoInfoContainer extends React.Component {
9
- render() {
10
- const { t } = this.props;
11
-
12
- const props = {
13
- t: key => key,
14
- price: {
15
- wasPrice: 18660,
16
- currentSalesPrice: 18440,
17
- historyPriceDifferencePerCent: 2,
18
- purchasePrice: 0,
19
- vatRate: 19
20
- },
21
- consumption: { consumptionCombined: 6.1 },
22
- environmentEmissions: { co2: 159 },
23
- monthlyInstallment: 269.8,
24
- oldMonthlyInstallment: 259.8,
25
- onButtonClick: action('offer button click'),
26
- onFinancingDetailsClick: action('financing button click')
27
- };
28
-
29
- return (
30
- <div style={{ marginTop: 100 }}>
31
- <VehiclePromoInfo {...props} />
32
- </div>
33
- );
34
- }
35
- }
36
-
37
- storiesOf('VehiclePromoInfo', module)
38
- .add('Default', () => (
39
- <div>
40
- <VehiclePromoInfoContainer />
41
- </div>
42
- ));