@bytebrand/fe-ui-core 4.1.50 → 4.1.51

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.50",
3
+ "version": "4.1.51",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -6,7 +6,7 @@ import { searchTopBarTranslate } from '../../../locales/data';
6
6
  import MaterialMenu from '../../_common/UserMenu/MaterialMenu';
7
7
  import { isMobileOnly } from 'react-device-detect';
8
8
  import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
9
- import { IconSVG } from '@bytebrand/fe-ui-core/common';
9
+ import IconSVG from '../../_common/IconSVG/IconSVG';
10
10
 
11
11
  interface ISearchTopBarProps {
12
12
  t?: (key: string, options?: object) => string;
@@ -19,4 +19,3 @@ const SvgDate = (props: any) => (
19
19
 
20
20
  export default SvgDate;
21
21
  /* tslint:enable */
22
-
@@ -16,4 +16,3 @@ const SvgOwner = (props: any) => (
16
16
 
17
17
  export default SvgOwner;
18
18
  /* tslint:enable */
19
-
@@ -22,7 +22,7 @@ const MaterialSwitch = ({ disabled, label, onChange, value = false, labelPlaceme
22
22
  labelPlacement={labelPlacement}
23
23
  control={
24
24
  <Switch
25
- checked={checked}
25
+ checked={value || checked}
26
26
  onChange={handleChange}
27
27
  disabled={disabled}
28
28
  onClick={e => e.stopPropagation()}
@@ -49,4 +49,8 @@
49
49
  text-transform: uppercase !important
50
50
 
51
51
  .outlinedBtn
52
- border: none !important
52
+ border: none !important
53
+
54
+ .switchBlock
55
+ display: flex
56
+ justify-content: space-between
@@ -1,12 +1,25 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import styles from './ManageCookieModal.styl';
3
3
 
4
4
  import IconSVG from '../../../IconSVG/IconSVG';
5
5
  import Button from '../../../Button/Button';
6
6
  import MaterialAccordionGroup from '../../../MaterialAccordionGroup/MaterialAccordionGroup';
7
7
  import classNames from 'classnames';
8
+ import MaterialSwitch from '../../../MaterialSwitch/MaterialSwitch';
8
9
 
9
10
  const ManageCookieModal = () => {
11
+ const [accordionSwitchValue, setAccordionSwitchValue] = useState(false);
12
+ const [switchValue, setSwitchValue] = useState(false);
13
+
14
+ const onHandleAccordionSwitchValue = (value: boolean) => {
15
+ setAccordionSwitchValue(value);
16
+ };
17
+
18
+ const accordionSwitchProps = {
19
+ value: accordionSwitchValue,
20
+ onChange: onHandleAccordionSwitchValue
21
+ };
22
+
10
23
  return (
11
24
  <div className={styles.modalWrapper}>
12
25
  <IconSVG name='autodeLogo' customDimensions />
@@ -17,6 +30,7 @@ const ManageCookieModal = () => {
17
30
  title='Notwendig'
18
31
  tooltipText='tooltip text'
19
32
  withSwitch
33
+ switchProps={accordionSwitchProps}
20
34
  >
21
35
  Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert.
22
36
  Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen
@@ -27,6 +41,7 @@ const ManageCookieModal = () => {
27
41
  <MaterialAccordionGroup
28
42
  title='Analytisch'
29
43
  withSwitch
44
+ switchProps={accordionSwitchProps}
30
45
  >
31
46
  Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt
32
47
  unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen,
@@ -36,11 +51,16 @@ const ManageCookieModal = () => {
36
51
  <MaterialAccordionGroup
37
52
  title='Marketing'
38
53
  withSwitch
54
+ switchProps={accordionSwitchProps}
39
55
  >
40
56
  Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites.
41
57
  Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der Seiten, die Sie auf unserer
42
58
  Website besuchen, anzeigen.
43
59
  For example, we may serve you a personalized ad based on the pages you visit on our site.
60
+ <div className={styles.switchBlock}>
61
+ <span>Cookie</span>
62
+ <MaterialSwitch value={switchValue} onChange={(value: boolean) => setSwitchValue(value)} />
63
+ </div>
44
64
  </MaterialAccordionGroup>
45
65
  </div>
46
66
  <div className={styles.buttonsContainer}>
@@ -13,7 +13,7 @@ const PreviewCookieModal = ({ toggleModal, setModal }: IPreviewCookieModal) => {
13
13
  const onAcceptAll = () => {
14
14
  localStorage.setItem('cookieConfig', JSON.stringify([]));
15
15
  toggleModal();
16
- }
16
+ };
17
17
  return (
18
18
  <div className={styles.modalWrapper}>
19
19
  <IconSVG name='autodeLogo' customDimensions />