@bytebrand/fe-ui-core 4.2.97 → 4.2.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +3 -1
- package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +2 -0
- package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.jsx → MuiOfferPeriod.theme.js} +12 -7
- package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +4 -28
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +10 -6
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +4 -0
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +2 -2
- 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 +1 -0
- package/source/components/SearchFilters/filters/Fuel.tsx +1 -1
- package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
- package/source/components/SearchFilters/filters/InteriorMaterial.tsx +1 -2
- package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
- package/source/components/SearchFilters/filters/Power.tsx +1 -1
- package/source/components/SearchFilters/filters/StateOptions.tsx +1 -0
- 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 +2 -1
- 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 +3 -4
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +1 -1
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +4 -1
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +18 -18
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
- package/source/components/_common/Chip/Chip.tsx +3 -1
- package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
- package/source/components/_common/IconSVG/SVG/flags/SK.tsx +1 -0
- package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +30 -22
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +1 -0
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +11 -8
- package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
- package/source/components/_common/Modal/Modal.tsx +5 -2
- package/source/components/_common/Modal/ModalsConfig.tsx +1 -5
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +3 -7
- package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +1 -0
- package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
- package/source/components/_common/UserMenu/MaterialMenuItem.tsx +6 -9
- package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +1 -1
- package/source/framework/constants/common.ts +1 -9
- package/source/framework/types/types.ts +2 -3
- package/source/framework/utils/DateUtils.ts +2 -2
|
@@ -12,15 +12,14 @@ export interface IProps {
|
|
|
12
12
|
children: React.ReactElement<IStepProps>[];
|
|
13
13
|
onStepChange?: (nextStep: number) => void;
|
|
14
14
|
className?: string;
|
|
15
|
-
completed?: boolean;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
const defaultStepsDivider: React.ReactElement<IStepsDividerProps> = <StepsDivider/>;
|
|
19
18
|
|
|
20
19
|
const Stepper: React.FunctionComponent<IProps> = ({ currentStep, nonLinear, stepsDivider = defaultStepsDivider, onStepChange, children, className }) => {
|
|
21
|
-
const childrenArray:
|
|
22
|
-
const steps = childrenArray.map((child
|
|
23
|
-
if (!React.isValidElement
|
|
20
|
+
const childrenArray: React.ReactElement<IStepProps>[] = React.Children.toArray<React.ReactElement<IStepProps>>(children);
|
|
21
|
+
const steps = childrenArray.map((child, index) => {
|
|
22
|
+
if (!React.isValidElement(child)) {
|
|
24
23
|
throw new Error('Stepper component has invalid child');
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from 'react';
|
|
2
2
|
import styles from './OrderStatusSection.styl';
|
|
3
3
|
import OrderStatusCard from './OrderStatusCard';
|
|
4
|
-
|
|
4
|
+
import Image from '../../../_common/Image/Image';
|
|
5
5
|
import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
|
|
6
6
|
|
|
7
7
|
// tslint:disable-next-line:interface-name
|
package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import styles from './RequestedCarsSection.styl';
|
|
3
3
|
|
|
4
4
|
import Slider from 'react-slick';
|
|
@@ -10,6 +10,9 @@ import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
|
|
|
10
10
|
// import { history } from '../../../../../AppRouter';
|
|
11
11
|
import Button from '../../../_common/Button/Button';
|
|
12
12
|
|
|
13
|
+
interface IWithRouter {
|
|
14
|
+
children?: JSX.Element;
|
|
15
|
+
}
|
|
13
16
|
// tslint:disable-next-line:interface-name
|
|
14
17
|
interface TFunction {
|
|
15
18
|
<T = string>(key: string, options?: object): T;
|
|
@@ -41,7 +41,7 @@ export interface IVehiclePriceSectionProps {
|
|
|
41
41
|
common: ICommonFinancing;
|
|
42
42
|
vatRate?: number;
|
|
43
43
|
onDetailsClick(id: string): void;
|
|
44
|
-
toggleCarToCompare?(carId
|
|
44
|
+
toggleCarToCompare?(carId?: React.ChangeEvent<HTMLInputElement>): void;
|
|
45
45
|
onRemoveClick?(carId: string): void;
|
|
46
46
|
toCompare?: boolean;
|
|
47
47
|
onAddOfferToMainSlideClick?: (id: string, mainImageId: string, price: number, financingConfig: any) => void;
|
|
@@ -49,23 +49,23 @@ export interface IVehiclePriceSectionProps {
|
|
|
49
49
|
typeAlternative?: string;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
interface IPriceData {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
52
|
+
// interface IPriceData {
|
|
53
|
+
// tooltipDescription?: string;
|
|
54
|
+
// perMonthOld?: any;
|
|
55
|
+
// isAlternativeText?: string;
|
|
56
|
+
// perMonthCurrent?: any;
|
|
57
|
+
// showAboIcon?: boolean;
|
|
58
|
+
// isPriceDisable?: boolean;
|
|
59
|
+
// isTotal?: boolean;
|
|
60
|
+
// isNewPriceCategory?: boolean;
|
|
61
|
+
// positionY?: any;
|
|
62
|
+
// priceSub?: string | null;
|
|
63
|
+
// prefixOldPrice?: string | null;
|
|
64
|
+
// postfix?: any;
|
|
65
|
+
// title?: string;
|
|
66
|
+
// margin?: number;
|
|
67
|
+
// totalCurrent: number;
|
|
68
|
+
// }
|
|
69
69
|
|
|
70
70
|
const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceSectionProps) => {
|
|
71
71
|
|
|
@@ -7,12 +7,13 @@ export interface IChip {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface IChipProps {
|
|
10
|
+
className?: string;
|
|
10
11
|
chip: IChip;
|
|
11
12
|
onClick?: (event: React.MouseEvent, chip: IChip) => void;
|
|
12
13
|
onDelete?: (event: React.MouseEvent, chip: IChip) => void;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, onClick, onDelete }) => {
|
|
16
|
+
const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, className, onClick, onDelete }) => {
|
|
16
17
|
const { key, value } = chip;
|
|
17
18
|
const onDeleteHandler = (event: any) => { event.stopPropagation(); onDelete(event, chip); };
|
|
18
19
|
const onClickHandler = (event: any) => { event.stopPropagation(); onClick(event, chip); };
|
|
@@ -30,6 +31,7 @@ const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, onClick, onDel
|
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
ChipLanding.defaultProps = {
|
|
34
|
+
className: '',
|
|
33
35
|
chip: { key: '', value: '' },
|
|
34
36
|
onClick: () => {},
|
|
35
37
|
onDelete: () => {}
|
|
@@ -8,10 +8,10 @@ import { ThemeProvider } from '@mui/material/styles';
|
|
|
8
8
|
import { Theme } from './ExpansionPanel.styled';
|
|
9
9
|
|
|
10
10
|
export interface IExpansionPanelProps {
|
|
11
|
-
title?: string;
|
|
11
|
+
title?: string | JSX.Element;
|
|
12
12
|
subTitle?: string;
|
|
13
13
|
defaultExpanded?: boolean;
|
|
14
|
-
onChange?:
|
|
14
|
+
onChange?: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;
|
|
15
15
|
className?: string;
|
|
16
16
|
children?: any;
|
|
17
17
|
reactScrollName?: string; // property "name" for "Element" component of "react-scroll" library
|
|
@@ -71,7 +71,7 @@ class ExpansionPanel extends React.Component<IExpansionPanelProps> {
|
|
|
71
71
|
<Accordion
|
|
72
72
|
defaultExpanded={defaultExpanded}
|
|
73
73
|
onChange={isCompare ? onChange : onChange && onChange(reactScrollName)}
|
|
74
|
-
expanded={
|
|
74
|
+
expanded={isCompare ? expanded : expanded && (expanded === reactScrollName)}
|
|
75
75
|
className={accordionClassName}
|
|
76
76
|
>
|
|
77
77
|
<AccordionSummary
|
|
@@ -3,7 +3,8 @@ import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
|
3
3
|
import IconSVG from '../IconSVG/IconSVG';
|
|
4
4
|
import {
|
|
5
5
|
ThemeProvider,
|
|
6
|
-
createTheme
|
|
6
|
+
createTheme,
|
|
7
|
+
experimental_sx as sx
|
|
7
8
|
} from '@mui/material/styles';
|
|
8
9
|
|
|
9
10
|
export interface IItem {
|
|
@@ -17,9 +18,7 @@ export interface IAccordionProps {
|
|
|
17
18
|
|
|
18
19
|
defaultOpened?: number;
|
|
19
20
|
|
|
20
|
-
variant?:
|
|
21
|
-
|
|
22
|
-
expandedDefault?: string;
|
|
21
|
+
variant?: string;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
declare module '@mui/material/AccordionSummary' {
|
|
@@ -47,9 +46,10 @@ const MaterialAccordion = (
|
|
|
47
46
|
const theme = createTheme({
|
|
48
47
|
components: {
|
|
49
48
|
MuiAccordion: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
variants: [
|
|
50
|
+
{
|
|
51
|
+
props: { variant: 'searchDetailed' },
|
|
52
|
+
style: {
|
|
53
53
|
margin: 0,
|
|
54
54
|
'&.Mui-expanded': {
|
|
55
55
|
margin: 0
|
|
@@ -57,8 +57,11 @@ const MaterialAccordion = (
|
|
|
57
57
|
'&.MuiAccordion-root:before': {
|
|
58
58
|
opacity: 0
|
|
59
59
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
props: { variant: 'searchDetailedSmall' },
|
|
64
|
+
style: {
|
|
62
65
|
margin: 0,
|
|
63
66
|
boxShadow: 'none',
|
|
64
67
|
'&.Mui-expanded': {
|
|
@@ -67,28 +70,32 @@ const MaterialAccordion = (
|
|
|
67
70
|
'&.MuiAccordion-root:before': {
|
|
68
71
|
opacity: 0
|
|
69
72
|
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
73
76
|
},
|
|
74
77
|
MuiAccordionSummary: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
variants: [
|
|
79
|
+
{
|
|
80
|
+
props: { variant: 'searchDetailed' },
|
|
81
|
+
style: {
|
|
78
82
|
color: '#005ccb',
|
|
79
83
|
fontWeight: 'bold',
|
|
80
84
|
fontSize: 14,
|
|
81
85
|
'&.Mui-expanded': {
|
|
82
86
|
borderBottom: '1px solid #e8e8e8'
|
|
83
87
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
props: { variant: 'searchDetailedSmall' },
|
|
92
|
+
style: {
|
|
86
93
|
color: '1f1f1f',
|
|
87
94
|
fontWeight: 'bold',
|
|
88
95
|
fontSize: 14
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
101
|
});
|
|
@@ -97,10 +104,10 @@ const MaterialAccordion = (
|
|
|
97
104
|
const [expanded, setExpanded] = useState(expandedDefault || false);
|
|
98
105
|
|
|
99
106
|
const handleChange =
|
|
100
|
-
(panel: string) => (
|
|
107
|
+
(panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
|
|
101
108
|
setExpanded(isExpanded ? panel : false);
|
|
102
109
|
};
|
|
103
|
-
return items.map((item:
|
|
110
|
+
return items.map((item: any, index: number) => {
|
|
104
111
|
return (
|
|
105
112
|
<ThemeProvider theme={theme}>
|
|
106
113
|
<Accordion
|
|
@@ -113,6 +120,7 @@ const MaterialAccordion = (
|
|
|
113
120
|
expandIcon={<IconSVG name={'arrowSelect'} customDimensions />}
|
|
114
121
|
aria-controls={item.title}
|
|
115
122
|
id={item.title}
|
|
123
|
+
variant={variant}
|
|
116
124
|
sx={{
|
|
117
125
|
borderBottom: '1px solid #e8e8e8',
|
|
118
126
|
borderImageWidth: 0
|
|
@@ -6,6 +6,7 @@ export const Theme = createTheme({
|
|
|
6
6
|
styleOverrides: {
|
|
7
7
|
input: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
|
|
8
8
|
...(size === 'smaller' && {
|
|
9
|
+
// tslint:disable-line
|
|
9
10
|
height: 28,
|
|
10
11
|
boxSizing: 'border-box'
|
|
11
12
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTheme } from '@mui/material/styles';
|
|
2
2
|
import { IconButton } from '@mui/material';
|
|
3
|
-
import { styled } from '@mui/system';
|
|
3
|
+
import { padding, styled } from '@mui/system';
|
|
4
4
|
import IconSVG from '../IconSVG/IconSVG';
|
|
5
5
|
import { isMobileOnly } from 'react-device-detect';
|
|
6
6
|
|
|
@@ -15,9 +15,9 @@ export const Theme = createTheme({
|
|
|
15
15
|
},
|
|
16
16
|
MuiInputLabel: {
|
|
17
17
|
styleOverrides: {
|
|
18
|
-
root: ({ ownerState
|
|
18
|
+
root: ({ ownerState }) => ({
|
|
19
19
|
maxWidth: 'calc(100% - 38px)',
|
|
20
|
-
...(size === 'custom' && {
|
|
20
|
+
...(ownerState.size === 'custom' && { // tslint:disable-line
|
|
21
21
|
marginTop: isMobileOnly ? '0px' :'-4px',
|
|
22
22
|
['&.MuiInputLabel-shrink, &.Mui-focused']: {
|
|
23
23
|
marginTop: 0
|
|
@@ -64,19 +64,22 @@ export const Theme = createTheme({
|
|
|
64
64
|
},
|
|
65
65
|
MuiOutlinedInput: {
|
|
66
66
|
styleOverrides: {
|
|
67
|
-
root: ({ ownerState
|
|
68
|
-
...(size === 'small' && {
|
|
67
|
+
root: ({ ownerState }) => ({
|
|
68
|
+
...(ownerState.size === 'small' && {
|
|
69
69
|
paddingRight: '0 !important',
|
|
70
|
-
flexWrap: 'nowrap !important'
|
|
70
|
+
flexWrap: 'nowrap !important',
|
|
71
|
+
['.Mui-disabled']: {
|
|
72
|
+
// backgroundColor: '#e8e8e8'
|
|
73
|
+
}
|
|
71
74
|
}),
|
|
72
|
-
...(size === 'custom' && {
|
|
75
|
+
...(ownerState.size === 'custom' && {
|
|
73
76
|
height: isMobileOnly ? 56 : 48,
|
|
74
77
|
boxSizing: 'border-box'
|
|
75
78
|
}),
|
|
76
79
|
['&.Mui-disabled svg']: {
|
|
77
80
|
opacity:'0.38'
|
|
78
81
|
}
|
|
79
|
-
}
|
|
82
|
+
})
|
|
80
83
|
}
|
|
81
84
|
},
|
|
82
85
|
MuiListItemText: {
|
|
@@ -9,7 +9,7 @@ import { isMobileOnly } from 'react-device-detect';
|
|
|
9
9
|
|
|
10
10
|
export interface IItems {
|
|
11
11
|
value: string | number;
|
|
12
|
-
label: string
|
|
12
|
+
label: string;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
isSeries?: boolean;
|
|
15
15
|
}
|
|
@@ -32,7 +32,7 @@ export interface IVehicleModalProps {
|
|
|
32
32
|
icon?: string;
|
|
33
33
|
children?: JSX.Element | JSX.Element[];
|
|
34
34
|
onChange: (value: any) => void;
|
|
35
|
-
items
|
|
35
|
+
items: IItems[];
|
|
36
36
|
selectClassName?: string;
|
|
37
37
|
amountOfItems?: number;
|
|
38
38
|
customDimensionsIcon?: boolean;
|
|
@@ -99,7 +99,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
|
|
|
99
99
|
onChange('' as string);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
const getLabel = (label: string
|
|
102
|
+
const getLabel = (label: string, disabled: boolean) => disabled ? <span>{label.toUpperCase()}</span> : label;
|
|
103
103
|
|
|
104
104
|
const IconClassNames = classnames(
|
|
105
105
|
classNameIcon
|
|
@@ -17,8 +17,8 @@ interface IMaterialTooltip {
|
|
|
17
17
|
|
|
18
18
|
const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
|
|
19
19
|
<Tooltip {...props} classes={{ popper: className }} />
|
|
20
|
-
))(
|
|
21
|
-
zIndex: zindex ? zindex : 9996,
|
|
20
|
+
))(props => ({
|
|
21
|
+
zIndex: props.zindex ? props.zindex : 9996,
|
|
22
22
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
23
23
|
backgroundColor: '#fff',
|
|
24
24
|
color: '#4C4E64AD',
|
|
@@ -46,7 +46,7 @@ const MaterialTooltip = ({ text, placement, className, disabled, zindex }: IMate
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const onHandleMenuToggle = debounce(
|
|
49
|
-
(
|
|
49
|
+
(event: any) => {
|
|
50
50
|
setIsOpen(() => !isOpen);
|
|
51
51
|
},
|
|
52
52
|
50
|
|
@@ -12,9 +12,12 @@ interface IBasicModal {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit }: IBasicModal) => {
|
|
15
|
-
|
|
15
|
+
const { onClearModalState } = modalProps;
|
|
16
16
|
return (
|
|
17
|
-
<Modal open={isVisible}
|
|
17
|
+
<Modal open={isVisible} onClose={() => {
|
|
18
|
+
// toggleModal();
|
|
19
|
+
// onClearModalState();
|
|
20
|
+
}}>
|
|
18
21
|
<BaseModalWrapper>
|
|
19
22
|
{ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
|
|
20
23
|
</BaseModalWrapper>
|
|
@@ -4,11 +4,7 @@ import TestModal from './modals/TestModal';
|
|
|
4
4
|
import PreviewCookieModal from './modals/PreviewCookieModal/PreviewCookieModal';
|
|
5
5
|
import ManageCookieModal from './modals/ManageCookieModal/ManageCookieModal';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
[key: string]: (props: any) => JSX.Element;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const ModalsConfig: ModalConfigProps = {
|
|
7
|
+
const ModalsConfig = {
|
|
12
8
|
TEST_MODAL: (props: any) => {
|
|
13
9
|
return <TestModal { ...props } />;
|
|
14
10
|
},
|
|
@@ -16,15 +16,11 @@ interface IManageCookieModal {
|
|
|
16
16
|
handleSentryInit?: () => void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
interface IMarketingSwitches {
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
19
|
const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModal) => {
|
|
24
20
|
const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(true);
|
|
25
21
|
const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(true);
|
|
26
|
-
const [analyticsSwitches, setAnalyticsSwitches] = useState
|
|
27
|
-
const [marketingSwitches, setMarketingSwitches] = useState
|
|
22
|
+
const [analyticsSwitches, setAnalyticsSwitches] = useState({});
|
|
23
|
+
const [marketingSwitches, setMarketingSwitches] = useState({});
|
|
28
24
|
|
|
29
25
|
useEffect(
|
|
30
26
|
() => {
|
|
@@ -64,7 +60,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
|
|
|
64
60
|
onChange: () => {}
|
|
65
61
|
};
|
|
66
62
|
|
|
67
|
-
const onAccept = (value?:
|
|
63
|
+
const onAccept = (value?: object) => {
|
|
68
64
|
const cookieConfig = value || {
|
|
69
65
|
marketing: Object.keys(marketingSwitches).filter(i => !marketingSwitches[i]) || [],
|
|
70
66
|
analytics: Object.keys(analyticsSwitches).filter(i => !analyticsSwitches[i]) || []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import Menu from '@mui/material/Menu';
|
|
3
3
|
import ListItem from './MaterialMenuItem';
|
|
4
4
|
import { ThemeProvider } from '@mui/material/styles';
|
|
@@ -24,7 +24,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
|
|
|
24
24
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
25
25
|
const [selectedIndex, setSelectedIndex] = React.useState(1);
|
|
26
26
|
const open = Boolean(anchorEl);
|
|
27
|
-
const handleClick = (event: MouseEvent<
|
|
27
|
+
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
|
|
28
28
|
setAnchorEl(event.currentTarget);
|
|
29
29
|
};
|
|
30
30
|
const handleClose = () => {
|
|
@@ -42,7 +42,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
|
|
|
42
42
|
<ThemeProvider theme={Theme}>
|
|
43
43
|
<div className={containerClassname}>
|
|
44
44
|
<HeaderComponent
|
|
45
|
-
onClick={(e
|
|
45
|
+
onClick={(e) => {
|
|
46
46
|
if (anchorEl) {
|
|
47
47
|
handleClose();
|
|
48
48
|
} else {
|
|
@@ -10,7 +10,7 @@ interface IListItem {
|
|
|
10
10
|
label: any;
|
|
11
11
|
amount?: number;
|
|
12
12
|
divider?: boolean;
|
|
13
|
-
onClick?: (e: React.MouseEvent<
|
|
13
|
+
onClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
14
14
|
href?: string;
|
|
15
15
|
isComponent?: boolean;
|
|
16
16
|
isSelect?: boolean;
|
|
@@ -20,12 +20,6 @@ interface IListItem {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose, isActive }: IListItem) => {
|
|
23
|
-
|
|
24
|
-
const onMenuItemClick = (e: React.MouseEvent<HTMLLIElement>) => {
|
|
25
|
-
onClick(e);
|
|
26
|
-
handleClose();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
return !!href ? (
|
|
30
24
|
<Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
|
|
31
25
|
<MenuItem
|
|
@@ -40,10 +34,13 @@ const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Li
|
|
|
40
34
|
</Link>
|
|
41
35
|
) : (
|
|
42
36
|
<MenuItem
|
|
43
|
-
onClick={
|
|
37
|
+
onClick={(e: React.MouseEvent<HTMLSpanElement>) => {
|
|
38
|
+
onClick(e);
|
|
39
|
+
handleClose();
|
|
40
|
+
}}
|
|
44
41
|
divider={divider}
|
|
45
42
|
disableRipple={isComponent ? true : false}
|
|
46
|
-
|
|
43
|
+
isactive={!!isActive ? isActive.toString() : 'false'}
|
|
47
44
|
>
|
|
48
45
|
{icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
|
|
49
46
|
<ListItemText>
|
|
@@ -17,7 +17,7 @@ export interface INestedMenuProps {
|
|
|
17
17
|
const NestedMenu = ({ nestedItems, label, icon, amount }: INestedMenuProps) => {
|
|
18
18
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
19
19
|
const open = Boolean(anchorEl);
|
|
20
|
-
const handleClick = (event: React.MouseEvent<
|
|
20
|
+
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
|
|
21
21
|
setAnchorEl(event.currentTarget);
|
|
22
22
|
};
|
|
23
23
|
const handleClose = () => {
|
|
@@ -7,7 +7,7 @@ import { isEqual } from 'lodash';
|
|
|
7
7
|
import { checkRangeValuesOnEqual, getGroupValuesForQuery } from '../../../../framework/utils/CommonUtils';
|
|
8
8
|
import { FilterBlockFactory } from '../../../SearchFilters/common/FilterBlock/FilterBlockFactory';
|
|
9
9
|
import { FilterGroups, IFilters } from '../../../SearchFilters/FiltersFactory';
|
|
10
|
-
import { MANUFACTURER_KEY, MM_GROUPS_EXCLUDE_KEY, MODEL_KEY, RANGE_FILTERS, SERIES_KEY, SUPER_ADMIN_FILTER_NAME } from '../../../../framework/constants/Search';
|
|
10
|
+
import { MANUFACTURER_KEY, MM_GROUPS_EXCLUDE_KEY, MODEL_KEY, RANGE_FILTERS, SERIES_KEY, SUPER_ADMIN_FILTER_NAME, SUB_MODEL_KEY } from '../../../../framework/constants/Search';
|
|
11
11
|
import { MMS_GROUPS_KEY, OBJECT_FILTERS } from '../../../../framework/constants/SearchWidget';
|
|
12
12
|
import { resolveMmsValue } from '../../../../framework/utils/FiltersUtils';
|
|
13
13
|
import FilterBlock from '../../../SearchFilters/common/FilterBlock/FilterBlock';
|
|
@@ -17,15 +17,7 @@ export const GOOGLE_BUNDLE_COOKIES = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/* tslint:disable */
|
|
20
|
-
export
|
|
21
|
-
[key: string]: {
|
|
22
|
-
[key: string]: {
|
|
23
|
-
name: string;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const COOKIE_SCHEMA: INecessaryCookieSchema = {
|
|
20
|
+
export const COOKIE_SCHEMA = {
|
|
29
21
|
necessary: {
|
|
30
22
|
__cfruid: { name: 'Cloudflare' },
|
|
31
23
|
cf_chl_2: { name: 'Cloudflare für Webverkehr zu identifizieren' },
|
|
@@ -98,6 +98,7 @@ export interface IVehicleInfo {
|
|
|
98
98
|
location?: IVehicleLocation;
|
|
99
99
|
common: {
|
|
100
100
|
currentSalesPrice?: number;
|
|
101
|
+
isStrikeShown?: boolean;
|
|
101
102
|
};
|
|
102
103
|
mileage?: string;
|
|
103
104
|
environmentEmissions?: any;
|
|
@@ -186,9 +187,7 @@ export interface IVehicleDetailedSidebarPriceProps {
|
|
|
186
187
|
isAlternative?: boolean;
|
|
187
188
|
// currentSalesPrice?: number;
|
|
188
189
|
originalSalesPrice?: number;
|
|
189
|
-
common
|
|
190
|
-
financing?: any;
|
|
191
|
-
currentSalesPrice?: number;
|
|
190
|
+
common: { isStrikeShown?: boolean, currentSalesPrice?: number };
|
|
192
191
|
}
|
|
193
192
|
export interface ITabsProps {
|
|
194
193
|
t?: (key: string, options?: object) => string;
|
|
@@ -8,10 +8,10 @@ export interface IFormatTimestamp {
|
|
|
8
8
|
|
|
9
9
|
export const timestampToDate = (timestamp: number) => {
|
|
10
10
|
if (!timestamp) return 'N/A';
|
|
11
|
-
const date = new Date(timestamp * 1000)
|
|
11
|
+
const date = new Date(timestamp * 1000);// tslint:disable-line
|
|
12
12
|
const year = date.getFullYear();
|
|
13
13
|
const month = date.getMonth() + 1;
|
|
14
|
-
const monthFormatted = month < 10 ? '0' + month : month
|
|
14
|
+
const monthFormatted = month < 10 ? '0' + month : month;// tslint:disable-line
|
|
15
15
|
return (`${monthFormatted}/${year}`);
|
|
16
16
|
};
|
|
17
17
|
|