@bytebrand/fe-ui-core 4.1.23 → 4.1.25

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 (84) hide show
  1. package/package.json +1 -1
  2. package/source/components/AccordionWidget/AccordionWidget.tsx +1 -1
  3. package/source/components/Alternative/DealerInfo.tsx +17 -12
  4. package/source/components/OfferPanel/AboAccordion/AboAccordion.tsx +1 -1
  5. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +1 -1
  6. package/source/components/RateSearchWidget/RateSearchWidget.tsx +4 -4
  7. package/source/components/SearchFilters/common/FilterBlock/FilterBlock.styled.tsx +1 -1
  8. package/source/components/SearchFilters/common/FilterBlock/FilterBlock.tsx +24 -24
  9. package/source/components/SearchFilters/common/RangeControlled/RangeControlled.tsx +4 -5
  10. package/source/components/SearchFilters/filters/Consumption.tsx +2 -2
  11. package/source/components/SearchFilters/filters/Cost.tsx +30 -28
  12. package/source/components/SearchFilters/filters/EmissionSticker.tsx +14 -14
  13. package/source/components/SearchFilters/filters/FirstRegistration.tsx +2 -2
  14. package/source/components/SearchFilters/filters/ImagesCount.tsx +3 -3
  15. package/source/components/SearchFilters/filters/InteriorColor.tsx +2 -2
  16. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -2
  17. package/source/components/SearchFilters/filters/MakeModel.tsx +1 -2
  18. package/source/components/SearchFilters/filters/Mileage.tsx +3 -4
  19. package/source/components/SearchFilters/filters/Owners.tsx +0 -1
  20. package/source/components/SearchFilters/filters/Power.tsx +3 -6
  21. package/source/components/SearchFilters/filters/PriceDifference.tsx +4 -5
  22. package/source/components/SearchPage/ChipFilter/ChipFilter.tsx +1 -1
  23. package/source/components/SearchPage/Filters/MakeModel/MakeModel.tsx +3 -3
  24. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +1 -1
  25. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +1 -1
  26. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +4 -4
  27. package/source/components/SearchPageMobile/FiltersDetailed/FirstRegistration.tsx +1 -1
  28. package/source/components/SearchPageMobile/FiltersDetailed/Fuel.tsx +1 -1
  29. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -2
  30. package/source/components/SearchPageMobile/FiltersDetailed/Mileage.tsx +2 -3
  31. package/source/components/SearchPageMobile/FiltersDetailed/Power.tsx +4 -4
  32. package/source/components/SearchPageMobile/FiltersDetailed/Price.tsx +3 -4
  33. package/source/components/SearchPageMobile/FiltersDetailed/Rate.tsx +2 -2
  34. package/source/components/SearchPageMobile/FiltersDetailed/Seats.tsx +2 -2
  35. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +1 -1
  36. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +5 -7
  37. package/source/components/SearchWidget/OfferDetalisWidget/OfferDetailsWidgetMobile.tsx +1 -1
  38. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +10 -7
  39. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +7 -7
  40. package/source/components/SearchWidgetsMobile/EngineTransDriveWidget/EngineTransDriveWidget.tsx +4 -5
  41. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.styled.tsx +2 -2
  42. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +8 -9
  43. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidgetCategory.tsx +17 -17
  44. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +2 -2
  45. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  46. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +5 -5
  47. package/source/components/SearchWidgetsMobile/StateWidget/StateWidget.tsx +14 -11
  48. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +1 -1
  49. package/source/components/_common/Checkbox/FormCheckbox.tsx +1 -1
  50. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +30 -27
  51. package/source/components/_common/Chip/Chip.tsx +1 -1
  52. package/source/components/_common/DropDown/DropDown.tsx +1 -2
  53. package/source/components/_common/ExpansionPanel/ExpansionPanel.styled.tsx +2 -9
  54. package/source/components/_common/IconSVG/IconSVGConfig.tsx +26 -2
  55. package/source/components/_common/IconSVG/SVG/common/AddressIcon.tsx +20 -0
  56. package/source/components/_common/IconSVG/SVG/common/DashboardIcon.tsx +20 -0
  57. package/source/components/_common/IconSVG/SVG/common/DealersIcon.tsx +20 -0
  58. package/source/components/_common/IconSVG/SVG/common/FavoritesIcon.tsx +20 -0
  59. package/source/components/_common/IconSVG/SVG/common/ImageSettingsIcon.tsx +20 -0
  60. package/source/components/_common/IconSVG/SVG/common/LogoutIcon.tsx +20 -0
  61. package/source/components/_common/IconSVG/SVG/common/MyVehiclesIcon.tsx +20 -0
  62. package/source/components/_common/IconSVG/SVG/common/SavedSearchsIcon.tsx +20 -0
  63. package/source/components/_common/IconSVG/SVG/common/SupportCallbackIcon.tsx +20 -0
  64. package/source/components/_common/IconSVG/SVG/common/UserProfileIcon.tsx +20 -0
  65. package/source/components/_common/IconSVG/SVG/settings/RemoveEye.tsx +1 -1
  66. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +56 -56
  67. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +31 -31
  68. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.tsx +26 -27
  69. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +7 -7
  70. package/source/components/_common/MaterialField/MaterialField.tsx +3 -3
  71. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +3 -3
  72. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +34 -32
  73. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.styled.tsx +3 -7
  74. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +1 -2
  75. package/source/components/_common/Range/Range.tsx +1 -1
  76. package/source/components/_common/UserMenu/MenuItem.styled.tsx +11 -0
  77. package/source/components/_common/UserMenu/MenuItem.tsx +35 -0
  78. package/source/components/_common/UserMenu/UserMenu.story.js +60 -0
  79. package/source/components/_common/UserMenu/UserMenu.tsx +79 -0
  80. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +7 -2
  81. package/source/framework/constants/app.ts +1 -1
  82. package/source/framework/constants/highlights.ts +1 -1
  83. package/source/framework/types/types.ts +1 -1
  84. package/source/framework/utils/CommonUtils.ts +27 -15
@@ -11,17 +11,17 @@ export const Theme = createTheme({
11
11
  top: 'calc(50% - 12px)'
12
12
  },
13
13
  popupIndicator: {
14
- padding: 4,
14
+ padding: 4
15
15
  },
16
16
  root: ({ ownerState }) => ({
17
- ['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-root']: {
17
+ ['&.Mui-focused + [data-popper-placement*=`bottom`] .MuiOutlinedInput-root']: {
18
18
  borderTopRightRadius: 0,
19
19
  borderTopLeftRadius: 0
20
20
  },
21
21
  ['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-notchedOutline']: {
22
22
  ...(ownerState.name === 'mobileSearch' && { // tslint:disable-line
23
23
  borderTop: isMobileOnly ? '2px solid #1976d2' : 0
24
- }),
24
+ })
25
25
  },
26
26
  ['&.Mui-focused .MuiInputLabel-root']: {
27
27
  zIndex: 9999
@@ -32,7 +32,7 @@ export const Theme = createTheme({
32
32
  borderLeft: '1px solid rgba(0, 0, 0, 0.23)',
33
33
  borderRight: '1px solid rgba(0, 0, 0, 0.23)',
34
34
  borderTop: '1px solid rgba(0, 0, 0, 0.23)',
35
- marginLeft: 0,
35
+ marginLeft: 0
36
36
  },
37
37
  ['&.Mui-focused + [data-popper-placement*="top"] > .MuiPaper-root']: {
38
38
  borderBottomLeftRadius: 0,
@@ -135,10 +135,10 @@ export const Theme = createTheme({
135
135
  backgroundColor: '#e8e8e8'
136
136
  },
137
137
  ['& > .MuiChip-root > span:after']: {
138
- content: "','"
138
+ content: `','`
139
139
  },
140
140
  ['& > .MuiChip-root + .MuiChip-root > span:after']: {
141
- content: "''"
141
+ content: `''`
142
142
  },
143
143
  ['&.Mui-disabled']: {
144
144
  pointerEvents: 'none',
@@ -150,36 +150,36 @@ export const Theme = createTheme({
150
150
  },
151
151
  ['& .MuiAutocomplete-input']: {
152
152
  ...(ownerState.name === 'mobileSearch' && {
153
- textAlign: isMobileOnly ? 'right !important' : 'left',
153
+ textAlign: isMobileOnly ? 'right !important' : 'left'
154
154
  })
155
155
  },
156
156
  ...(ownerState.size === 'custom' && {
157
- height: isMobileOnly ? 56 : 48,
158
- boxSizing: 'border-box',
159
- backgroundColor: '#fff',
160
- paddingRight: '42px !important',
157
+ height: isMobileOnly ? 56 : 48,
158
+ boxSizing: 'border-box',
159
+ backgroundColor: '#fff',
160
+ paddingRight: '42px !important',
161
161
 
162
- ['& .MuiOutlinedInput-input']: {
163
- padding: '5.5px 4px 7.5px 6px !important'
164
- }
162
+ ['& .MuiOutlinedInput-input']: {
163
+ padding: '5.5px 4px 7.5px 6px !important'
164
+ }
165
165
  }),
166
166
  ...(ownerState.name === 'mobileSearch' && {
167
- color: isMobileOnly ? '#005ccb' : 'rgba(0, 0, 0, 0.87)',
168
- backgroundColor: isMobileOnly ? 'transparent' : '#fff',
169
- paddingRight: isMobileOnly ? '33px !important' : '42px !important',
170
- textAlign: isMobileOnly ? 'right !important' : 'left',
171
- ['& .MuiOutlinedInput-notchedOutline']: {
172
- borderWidth: isMobileOnly ? 0 : 1
173
- },
174
- 'input': {
175
- ['&::placeholder']: {
176
- color: isMobileOnly ? '#005ccb !important' : 'rgba(0, 0, 0, 0.87) !important'
177
- },
178
- },
179
- ['&.Mui-focused .MuiOutlinedInput-notchedOutline']: {
180
- borderWidth: isMobileOnly ? 0 : 1
167
+ color: isMobileOnly ? '#005ccb' : 'rgba(0, 0, 0, 0.87)',
168
+ backgroundColor: isMobileOnly ? 'transparent' : '#fff',
169
+ paddingRight: isMobileOnly ? '33px !important' : '42px !important',
170
+ textAlign: isMobileOnly ? 'right !important' : 'left',
171
+ ['& .MuiOutlinedInput-notchedOutline']: {
172
+ borderWidth: isMobileOnly ? 0 : 1
173
+ },
174
+ input: {
175
+ ['&::placeholder']: {
176
+ color: isMobileOnly ? '#005ccb !important' : 'rgba(0, 0, 0, 0.87) !important'
181
177
  }
182
- })
178
+ },
179
+ ['&.Mui-focused .MuiOutlinedInput-notchedOutline']: {
180
+ borderWidth: isMobileOnly ? 0 : 1
181
+ }
182
+ })
183
183
  })
184
184
  }
185
185
  }
@@ -197,5 +197,5 @@ export const FlexWrap = styled('div')({
197
197
  });
198
198
 
199
199
  export const CheckboxLabel = styled('span')({
200
- whiteSpace: 'pre-line'
201
- })
200
+ whiteSpace: 'pre-line'
201
+ });
@@ -11,12 +11,12 @@ import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
11
11
  import { Theme, ArrowSelect, CheckboxLabel } from './MaterialAutocomplete.styled';
12
12
  import isEqual from 'lodash/isEqual';
13
13
 
14
- export interface Items {
14
+ export interface IItems {
15
15
  value: string | number;
16
16
  label: string;
17
17
  isDisabled?: boolean;
18
18
  isSeries?: boolean;
19
- };
19
+ }
20
20
 
21
21
  interface IFilmOptionType {
22
22
  inputValue?: string;
@@ -79,7 +79,7 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
79
79
  placeholder
80
80
  }: IMaterialAutocompleteProps) => {
81
81
  const filter = createFilterOptions<IFilmOptionType>();
82
-
82
+
83
83
  return (
84
84
  <ThemeProvider theme={Theme}>
85
85
  <Autocomplete
@@ -101,10 +101,10 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
101
101
  onChange(newValue);
102
102
  } else if (newValue && newValue.inputValue) {
103
103
  onChange(newValue.inputValue);
104
- } else {
104
+ } else {
105
105
  if (multiple) {
106
106
  if (_indexOf(value, details.option) !== -1) {
107
- onChange(_filter(newValue, (value) => details.option !== value));
107
+ onChange(_filter(newValue, value => details.option !== value));
108
108
  } else {
109
109
  onChange(newValue);
110
110
  }
@@ -115,15 +115,15 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
115
115
  }
116
116
  }
117
117
  }}
118
- getOptionDisabled={(option) => option.isDisabled || option.label === 'default'}
118
+ getOptionDisabled={option => option.isDisabled || option.label === 'default'}
119
119
  filterOptions={(options, params) => {
120
120
 
121
121
  const filtered = filter(options, params);
122
-
122
+
123
123
  const { inputValue } = params;
124
124
  // Suggest the creation of a new value
125
125
 
126
- const isExisting = options.some((option) => inputValue === option.label);
126
+ const isExisting = options.some(option => inputValue === option.label);
127
127
  if (inputValue !== '' && !isExisting && freeSolo) {
128
128
  filtered.push({
129
129
  value: inputValue,
@@ -158,26 +158,25 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
158
158
  <Checkbox checked={_indexOf(value, props.key) !== -1} />
159
159
  <CheckboxLabel>{t(`cbd:${option}`)}</CheckboxLabel>
160
160
  </li>
161
- )
162
- } else {
163
- const isSeries = (option.isDisabled && option.label !== 'No options') || option.isSeries;
164
- const label = isSeries ? option.label.toUpperCase() : option.label;
165
- return (
166
- <li
167
- {...props}
168
- key={_uniqueId(option.label)}
169
- style={isSeries ? {
170
- backgroundColor: 'rgba(58, 53, 65, 0.08)',
171
- color: 'rgba(76, 78, 100, 0.87)',
172
- fontWeight: 600
173
- } : null}
174
- >
175
- {label}
176
- </li>
177
- )
161
+ );
178
162
  }
163
+ const isSeries = (option.isDisabled && option.label !== 'No options') || option.isSeries;
164
+ const label = isSeries ? option.label.toUpperCase() : option.label;
165
+ return (
166
+ <li
167
+ {...props}
168
+ key={_uniqueId(option.label)}
169
+ style={isSeries ? {
170
+ backgroundColor: 'rgba(58, 53, 65, 0.08)',
171
+ color: 'rgba(76, 78, 100, 0.87)',
172
+ fontWeight: 600
173
+ } : null}
174
+ >
175
+ {label}
176
+ </li>
177
+ );
179
178
  }}
180
- renderInput={(params) => (
179
+ renderInput={params => (
181
180
  <TextField
182
181
  {...params}
183
182
  type={type}
@@ -222,5 +221,5 @@ export default memo(MaterialAutocomplete, (prevProps: any, nextProps: any) => {
222
221
  prevProps.error === nextProps.error &&
223
222
  prevProps.label === nextProps.label &&
224
223
  isEqual(prevProps.items, nextProps.items) &&
225
- (!_isEmpty(prevProps.items) ? prevProps.items[0].label === nextProps.items[0].label : false) // condition for radioButtons KW PS
224
+ (!_isEmpty(prevProps.items) ? prevProps.items[0].label === nextProps.items[0].label : false); // condition for radioButtons KW PS
226
225
  });
@@ -5,17 +5,17 @@ export const Theme = createTheme({
5
5
  MuiOutlinedInput: {
6
6
  styleOverrides: {
7
7
  input: ({ ownerState }) => ({
8
- ...(ownerState.size === "smaller" && {
8
+ ...(ownerState.size === 'smaller' && {
9
9
  // tslint:disable-line
10
10
  height: 28,
11
11
  boxSizing: 'border-box'
12
12
  }),
13
- ...(ownerState.size === "custom" && {
13
+ ...(ownerState.size === 'custom' && {
14
14
  height: isMobileOnly ? 56 : 48,
15
15
  boxSizing: 'border-box'
16
- }),
17
- }),
18
- },
19
- },
20
- },
16
+ })
17
+ })
18
+ }
19
+ }
20
+ }
21
21
  });
@@ -83,12 +83,12 @@ const MaterialField: React.FC<IVehicleModalProps> = ({
83
83
  placeholder={placeholder}
84
84
  InputProps={{
85
85
  endAdornment: type === 'password' ? (
86
- <InputAdornment position="end">
86
+ <InputAdornment position='end'>
87
87
  <IconButton
88
- aria-label="toggle password visibility"
88
+ aria-label='toggle password visibility'
89
89
  onClick={handleClickShowPassword}
90
90
  onMouseDown={handleMouseDownPassword}
91
- edge="end"
91
+ edge='end'
92
92
  >
93
93
  {showPassword ? <IconSVG name='removeEyeIcon' customDimensions /> : <IconSVG name='removeEyeIcon' customDimensions />}
94
94
  </IconButton>
@@ -65,7 +65,7 @@ export const Theme = createTheme({
65
65
  },
66
66
  ['::-webkit-scrollbar-thumb:hover']: {
67
67
  backgroundColor: 'grey'
68
- },
68
+ }
69
69
  }
70
70
  }
71
71
  },
@@ -124,10 +124,10 @@ export const FlexWrap = styled('div')({
124
124
 
125
125
  ['& > span:after']: {
126
126
  position: 'relative',
127
- content: "', '"
127
+ content: `', '`
128
128
  },
129
129
  ['& > span:last-of-type:after']: {
130
130
  position: 'relative',
131
- content: "''"
131
+ content: `''`
132
132
  }
133
133
  });
@@ -7,12 +7,12 @@ import _isEmpty from 'lodash/isEmpty';
7
7
  import { Theme, ArrowSelect, CloseButton, FlexWrap } from './MaterialSelect.styled';
8
8
  import { isMobileOnly } from 'react-device-detect';
9
9
 
10
- export interface Items {
10
+ export interface IItems {
11
11
  value: string | number;
12
12
  label: string;
13
13
  isDisabled?: boolean;
14
14
  isSeries?: boolean;
15
- };
15
+ }
16
16
 
17
17
  export interface IVehicleModalProps {
18
18
  t?: (key: string, options?: object) => string;
@@ -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: Items[];
35
+ items: IItems[];
36
36
  selectClassName?: string;
37
37
  }
38
38
 
@@ -59,19 +59,22 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
59
59
  selectClassName,
60
60
  required,
61
61
  items,
62
- icon,
62
+ icon
63
63
  }: IVehicleModalProps) => {
64
- const [ newValue, setValue ] = useState('');
65
- const [ multipleValue, setMultipleValue ] = React.useState([]);
64
+ const [newValue, setValue] = useState('');
65
+ const [multipleValue, setMultipleValue] = React.useState([]);
66
66
 
67
- useEffect(() => {
68
- setValue(value);
69
- setMultipleValue(value);
70
- }, [value]);
67
+ useEffect(
68
+ () => {
69
+ setValue(value);
70
+ setMultipleValue(value);
71
+ },
72
+ [value]
73
+ );
71
74
 
72
75
  const handleChange = (event: SelectChangeEvent<any>) => {
73
76
  const {
74
- target: { value },
77
+ target: { value }
75
78
  } = event;
76
79
 
77
80
  if (multiple) {
@@ -96,9 +99,9 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
96
99
  classNameIcon
97
100
  );
98
101
 
99
- const renderItems = (items: Items[]) => {
100
- if (_isEmpty(items)) return <MenuItem disabled>No options</MenuItem>
101
- return items.map(({ value, label, isDisabled = false, isSeries = false } : Items, index: number) => {
102
+ const renderItems = (items: IItems[]) => {
103
+ if (_isEmpty(items)) return <MenuItem disabled>No options</MenuItem>;
104
+ return items.map(({ value, label, isDisabled = false, isSeries = false } : IItems, index: number) => {
102
105
  const setDisabled = isDisabled || isSeries;
103
106
  if (multiple) {
104
107
  return (
@@ -106,23 +109,22 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
106
109
  <Checkbox checked={multipleValue.indexOf(value) > -1} />
107
110
  <ListItemText primary={label} />
108
111
  </MenuItem>
109
- )
110
- } else {
111
- return (
112
- <MenuItem
113
- key={`${value}_${index}`}
114
- value={value}
115
- disabled={setDisabled}
116
- sx={setDisabled ? {
117
- backgroundColor: '#e8e8e8',
118
- color: '#333',
119
- opacity: '1 !important'
120
- } : null}
121
- >
122
- {!!t ? t(`${namespace}${cbd ? ':' : '.'}${label}`) : getLabel(label, setDisabled)}
123
- </MenuItem>
124
- )
112
+ );
125
113
  }
114
+ return (
115
+ <MenuItem
116
+ key={`${value}_${index}`}
117
+ value={value}
118
+ disabled={setDisabled}
119
+ sx={setDisabled ? {
120
+ backgroundColor: '#e8e8e8',
121
+ color: '#333',
122
+ opacity: '1 !important'
123
+ } : null}
124
+ >
125
+ {!!t ? t(`${namespace}${cbd ? ':' : '.'}${label}`) : getLabel(label, setDisabled)}
126
+ </MenuItem>
127
+ );
126
128
  });
127
129
  };
128
130
 
@@ -156,7 +158,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
156
158
  <>
157
159
  {isClearable && (
158
160
  // tslint-disable-next-line
159
- <CloseButton sx={{ display: !!isValueEmpty ? 'block' : 'none'}} onClick={handleClearClick}>
161
+ <CloseButton sx={{ display: !!isValueEmpty ? 'block' : 'none' }} onClick={handleClearClick}>
160
162
  <IconSVG name='close' customDimensions />
161
163
  </CloseButton>
162
164
  )}
@@ -171,7 +173,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
171
173
  disableAutoFocus: true,
172
174
  elevation: 0,
173
175
  style: {
174
- position: "absolute",
176
+ position: 'absolute',
175
177
  marginTop: 'auto'
176
178
  },
177
179
  PaperProps: {
@@ -12,16 +12,12 @@ export const StyledButton = styled(Button)({
12
12
  alignItems: 'center',
13
13
  justifyContent: 'center',
14
14
  ['@media all and (min-width: 992px)'] :// and (min-height: $tablet)// -- set mobile layout for high resolution in a landscape mode ACF-3974
15
- {textTransform: 'uppercase'}
15
+ { textTransform: 'uppercase' }
16
16
  });
17
17
 
18
18
  export const StyledIconSVG = styled(IconSVG)({
19
19
  marginRight: 10,
20
20
  fill: 'white',
21
21
  width: '1.5em',
22
-
23
- path: {
24
- fill: ({color}) => (color ? color: '#fff')
25
- }
26
-
27
- });
22
+ path: { fill: ({ color }) => (color ? color : '#fff') }
23
+ });
@@ -8,7 +8,6 @@ import styles from './OfferRequestButtonWrapper.styl';
8
8
  import { supportPhoneLink } from '../../../framework/constants/app';
9
9
  import { StyledButton, StyledIconSVG } from './OfferRequestButtonWrapper.styled';
10
10
 
11
-
12
11
  const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapperProps> = ({
13
12
  t,
14
13
  car,
@@ -86,7 +85,7 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
86
85
 
87
86
  {isAdditionalOption ? (
88
87
  <Visible xs sm md>
89
- <StyledButton onClick={() => location.href=`tel:${supportPhoneLink}`} variant='outlined' color='primary' className={classnames(styles.controlButton, styles.phoneButton)}>
88
+ <StyledButton onClick={() => location.href = `tel:${supportPhoneLink}`} variant='outlined' color='primary' className={classnames(styles.controlButton, styles.phoneButton)}>
90
89
  <StyledIconSVG name='popoverPhone' className={styles.phoneIcon} customDimensions />
91
90
  {t('sidebar.callUp')}
92
91
  </StyledButton>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormattedNumber from '../../FormattedNumber/FormattedNumber';
3
- import { Slider} from '@mui/material';
3
+ import { Slider } from '@mui/material';
4
4
  import { isMobileOnly } from 'react-device-detect';
5
5
  import { ThemeProvider } from '@mui/material/styles';
6
6
 
@@ -0,0 +1,11 @@
1
+ import { styled } from '@mui/system';
2
+
3
+ export const AmountBlock = styled('span')({
4
+ backgroundColor: '#5C88FF',
5
+ color: '#fff',
6
+ borderRadius: '64px',
7
+ padding: '0 6px',
8
+ lineHeight: '20px',
9
+ fontSize: '12px',
10
+ fontWeight: 'bold'
11
+ });
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import MenuItem from '@mui/material/MenuItem';
3
+ import ListItemIcon from '@mui/material/ListItemIcon';
4
+ import IconSVG from '../IconSVG/IconSVG';
5
+ import ListItemText from '@mui/material/ListItemText';
6
+ import { AmountBlock } from './MenuItem.styled';
7
+ import { Link } from '@mui/material';
8
+
9
+ interface IListItem {
10
+ icon: string;
11
+ text: string;
12
+ amount?: number;
13
+ divider?: boolean;
14
+ onClick?: () => void;
15
+ href?: string;
16
+ }
17
+
18
+ const ListItem = ({ icon, text, amount, divider, onClick, href }: IListItem) => {
19
+ return (
20
+ <Link color='#4C4E64DE' variant='caption' href={href} underline='none' onClick={onClick}>
21
+ <MenuItem
22
+ sx={{ height: 44 }}
23
+ divider={divider}
24
+ >
25
+ <ListItemIcon>
26
+ <IconSVG name={icon} />
27
+ </ListItemIcon>
28
+ <ListItemText>{text}</ListItemText>
29
+ {amount && <AmountBlock>{amount}</AmountBlock>}
30
+ </MenuItem>
31
+ </Link>
32
+ );
33
+ };
34
+
35
+ export default ListItem;
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+
3
+ import { storiesOf } from '@storybook/react';
4
+ import UserMenu from './UserMenu';
5
+
6
+ const superAdmin = true;
7
+
8
+ const userMenuItems = [
9
+ {
10
+ icon: 'dashboardIcon',
11
+ text: 'Dashboard'
12
+ },
13
+ {
14
+ icon: 'userProfileIcon',
15
+ text: 'Profile'
16
+ },
17
+ {
18
+ icon: 'addressIcon',
19
+ text: 'Address'
20
+ },
21
+ {
22
+ icon: 'myVehiclesIcon',
23
+ text: 'My Vehicles'
24
+ },
25
+ {
26
+ icon: 'savedSearchsIcon',
27
+ text: 'Saved searchs'
28
+ },
29
+ {
30
+ icon: 'favoritesIcon',
31
+ text: 'Favorites',
32
+ amount: 122
33
+ },
34
+ {
35
+ icon: 'dealersIcon',
36
+ text: 'Dealers',
37
+ amount: 1234,
38
+ divider: true
39
+ },
40
+ {
41
+ icon: 'imageSettingsIcon',
42
+ text: 'Image Settings'
43
+ },
44
+ superAdmin && {
45
+ icon: 'supportCallbackIcon',
46
+ text: 'Support & Call back',
47
+ divider: true
48
+ },
49
+ {
50
+ icon: 'logoutIcon',
51
+ text: 'Logout'
52
+ },
53
+
54
+ ];
55
+
56
+ storiesOf('_Common_UI', module).add('UserMenu', () => (
57
+ <div>
58
+ <UserMenu userMenuItems={userMenuItems} profileName='Firstname Lastname' />
59
+ </div>
60
+ ));
@@ -0,0 +1,79 @@
1
+ import React, { useState, useRef } from 'react';
2
+ import Menu from '@mui/material/Menu';
3
+ import MenuItem from '@mui/material/MenuItem';
4
+ import Typography from '@mui/material/Typography';
5
+ import Tooltip from '@mui/material/Tooltip';
6
+ import ListItem from './MenuItem';
7
+
8
+ export interface ILoggedInUserInfoProps {
9
+ profileName: string;
10
+ userMenuItems: any;
11
+ }
12
+
13
+ const LoggedInUserInfo = ({ profileName, userMenuItems }: ILoggedInUserInfoProps) => {
14
+
15
+ const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
16
+ const open = Boolean(anchorEl);
17
+ const handleClick = (event: React.MouseEvent<HTMLElement>) => {
18
+ setAnchorEl(event.currentTarget);
19
+ };
20
+ const handleClose = () => {
21
+ setAnchorEl(null);
22
+ };
23
+
24
+ const containerRef = useRef(null);
25
+
26
+ return (
27
+ <>
28
+ <div
29
+ ref={containerRef}
30
+ onMouseEnter={handleClick}
31
+ >
32
+ <div>
33
+ <Tooltip title='Account settings'>
34
+ <Typography sx={{ minWidth: 100 }} onClick={handleClick}>{profileName}</Typography>
35
+ </Tooltip>
36
+ </div>
37
+ <Menu
38
+ anchorEl={anchorEl}
39
+ id='account-menu'
40
+ open={open}
41
+ onClose={handleClose}
42
+ onClick={handleClose}
43
+ PaperProps={{
44
+ elevation: 0,
45
+ sx: {
46
+ overflow: 'visible',
47
+ filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
48
+ mt: 1.5,
49
+ width: '230px',
50
+ borderRadius: '10px',
51
+ '& .MuiAvatar-root': {
52
+ width: 32,
53
+ height: 32,
54
+ ml: -0.5,
55
+ mr: 1
56
+ }
57
+ }
58
+ }}
59
+ transformOrigin={{ horizontal: 'right', vertical: 'top' }}
60
+ anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
61
+ >
62
+ <MenuItem
63
+ divider={true}
64
+ sx={{ justifyContent: 'center', height: 48 }}
65
+ disableRipple={true}
66
+ >
67
+ {profileName}
68
+ </MenuItem>
69
+
70
+ {userMenuItems.map((listItemProps: any) => {
71
+ return !!listItemProps && <ListItem key={listItemProps.text} { ...listItemProps } />;
72
+ })}
73
+ </Menu>
74
+ </div>
75
+ </>
76
+ );
77
+ };
78
+
79
+ export default LoggedInUserInfo;
@@ -103,7 +103,7 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
103
103
  onFilterChange = (field: string, value: any, index?: number, isSeries?: boolean) => {
104
104
  const { addModelsToFilters, changeFilterValue, changeSeries, getModelsInfoByMaker } = this.props;
105
105
  let newValue = _get(value, 'value') || value;
106
-
106
+
107
107
  if (newValue && newValue.from === 0) {
108
108
  newValue.from = '0';
109
109
  }
@@ -370,7 +370,12 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
370
370
  if ((!isDealerSuperAdmin || isAlternative) && title === SUPER_ADMIN_FILTER_NAME) return null;
371
371
 
372
372
  return (
373
- <FilterBlock isAdminPanel={title === SUPER_ADMIN_FILTER_NAME} key={index} title={t(`SearchPage:filterGroups.${title}`)} expand={index === (isDealerSuperAdmin && !isAlternative ? 0 : 1)} className={title}>
373
+ <FilterBlock
374
+ isAdminPanel={title === SUPER_ADMIN_FILTER_NAME}
375
+ key={index} title={t(`SearchPage:filterGroups.${title}`)}
376
+ expand={index === (isDealerSuperAdmin && !isAlternative ? 0 : 1)}
377
+ className={title}
378
+ >
374
379
  {component}
375
380
  </FilterBlock>
376
381
  );
@@ -16,7 +16,7 @@ export const config: IConfig = {
16
16
  },
17
17
 
18
18
  production: {
19
- DOMAIN: productionDomain,
19
+ DOMAIN: productionDomain
20
20
  }
21
21
  };
22
22