@bytebrand/fe-ui-core-autobahn 1.0.175 → 1.0.176

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/cards/CarCard.tsx CHANGED
@@ -38,7 +38,6 @@ import {
38
38
  GalleryActivityPill,
39
39
  cardSpec,
40
40
  PaymentMode,
41
- startPaymentMode,
42
41
  callDealerSalesPhone,
43
42
  DEALER_SALES_PHONE,
44
43
  } from './cardParts';
@@ -99,11 +98,6 @@ export interface CarCardProps {
99
98
  * (still onOpenRateAdjust).
100
99
  */
101
100
  onShowFinancingDetails?: (car: AutobahnCar, mode: PaymentMode) => void;
102
- /**
103
- * Tab the price block opens on (default Finanzierung) — e.g. the SRP's leasing-only results
104
- * open every card on Leasing. Ignored for a car without a lease rate (it has no Leasing tab).
105
- */
106
- initialMode?: PaymentMode;
107
101
  }
108
102
 
109
103
  const CarCard: React.FunctionComponent<CarCardProps> = ({
@@ -119,9 +113,8 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
119
113
  onCall,
120
114
  onOpenRateAdjust,
121
115
  onShowFinancingDetails,
122
- initialMode,
123
116
  }) => {
124
- const [mode, setMode] = useState<PaymentMode>(() => startPaymentMode(car, initialMode));
117
+ const [mode, setMode] = useState<PaymentMode>('financing');
125
118
  const [photoIndex, setPhotoIndex] = useState(0);
126
119
  const [viewerOpen, setViewerOpen] = useState(false);
127
120
  const mediaRef = useRef<HTMLDivElement | null>(null);
@@ -164,8 +157,6 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
164
157
  // active that's already 3, so NEU is dropped rather than causing a 4th to overflow.
165
158
  const activeDealChips = [showDrop || showSave, showPct, !!car.zeroDown].filter(Boolean).length;
166
159
  const showNeu = asGoodAsNew && car.isNew && activeDealChips < 3;
167
- // tabs the price block can switch to (PriceTabs shows Leasing only when the car has a lease rate)
168
- const paymentModes: PaymentMode[] = car.lease != null ? ['financing', 'leasing', 'buy'] : ['financing', 'buy'];
169
160
  return (
170
161
  <article
171
162
  className="mcard mcard--interactive cc-card"
@@ -286,46 +277,18 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
286
277
  <div className="cc-price" style={{ marginTop: 0, borderTop: '1px solid var(--md-outline-variant)' }}>
287
278
  <PriceTabs car={car} mode={mode} onModeChange={setMode} t={t} />
288
279
  <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8, marginTop: 10 }}>
289
- {/* every tab's hero stacked in one grid cell (.cc-hero-stack), only the active one
290
- visible, bottom-aligned — Kaufen's struck list price sits on its own line above
291
- the price, so without this the row (and the card) grew/shrank by that line on
292
- every tab switch. Same trick as .cc-terms-stack below. */}
293
- <div className="cc-hero-stack">
294
- {paymentModes.map((m) => (
295
- <div
296
- key={m}
297
- className={'cc-hero-slot' + (m === mode ? '' : ' cc-hero-slot--hidden')}
298
- aria-hidden={m === mode ? undefined : true}
299
- >
300
- <PriceHero car={car} mode={m} t={t} alwaysShowUnit />
301
- </div>
302
- ))}
303
- </div>
280
+ <PriceHero car={car} mode={mode} t={t} alwaysShowUnit />
304
281
  <PriceEvalCol car={car} t={t} />
305
282
  </div>
306
283
  {/* same fallback CardCtaRow already uses below: pages that haven't wired a real
307
- "Rate anpassen" sheet yet still get a working "Details" link (opens the car).
308
- Every tab's terms line is rendered into the same grid cell (.cc-terms-stack) and
309
- only the active one is visible — the cell is as tall as the tallest line, so the
310
- card keeps one height across Finanzierung/Leasing/Kaufen (Leasing's longer line
311
- wraps to 2 lines on narrow phones). No change to the visible line itself. */}
312
- <div className="cc-terms-stack">
313
- {paymentModes.map((m) => (
314
- <div
315
- key={m}
316
- className={'cc-terms-slot' + (m === mode ? '' : ' cc-terms-slot--hidden')}
317
- aria-hidden={m === mode ? undefined : true}
318
- >
319
- <PriceTerms
320
- car={car}
321
- mode={m}
322
- onOpenRateAdjust={onOpenRateAdjust || (() => onOpen(car))}
323
- onShowDetails={onShowFinancingDetails ? () => onShowFinancingDetails(car, m) : undefined}
324
- t={t}
325
- />
326
- </div>
327
- ))}
328
- </div>
284
+ "Rate anpassen" sheet yet still get a working "Details" link (opens the car). */}
285
+ <PriceTerms
286
+ car={car}
287
+ mode={mode}
288
+ onOpenRateAdjust={onOpenRateAdjust || (() => onOpen(car))}
289
+ onShowDetails={onShowFinancingDetails ? () => onShowFinancingDetails(car, mode) : undefined}
290
+ t={t}
291
+ />
329
292
  </div>
330
293
  {/* Mobile-only row (CardCtaRow itself carries the show-mobile class) — always
331
294
  rendered, with real fallbacks the page can override once it wires its own
package/cards/CarRow.tsx CHANGED
@@ -41,7 +41,6 @@ import {
41
41
  ZeroDownChip,
42
42
  fmtKm,
43
43
  PaymentMode,
44
- startPaymentMode,
45
44
  ratingTone,
46
45
  } from './cardParts';
47
46
  import { AutobahnCar } from './types';
@@ -81,8 +80,6 @@ export interface CarRowProps {
81
80
  * links render as plain text (see PricePaths' own fallback).
82
81
  */
83
82
  onShowFinancingDetails?: (car: AutobahnCar, mode: PaymentMode) => void;
84
- /** Tab the mobile price tabs open on — see CarCard's identically-named prop. */
85
- initialMode?: PaymentMode;
86
83
  }
87
84
 
88
85
  const CarRow: React.FunctionComponent<CarRowProps> = ({
@@ -95,9 +92,8 @@ const CarRow: React.FunctionComponent<CarRowProps> = ({
95
92
  t,
96
93
  adminAction,
97
94
  onShowFinancingDetails,
98
- initialMode,
99
95
  }) => {
100
- const [mode, setMode] = useState<PaymentMode>(() => startPaymentMode(car, initialMode));
96
+ const [mode, setMode] = useState<PaymentMode>('financing');
101
97
  const [photoIndex, setPhotoIndex] = useState(0);
102
98
  const mediaRef = useRef<HTMLDivElement | null>(null);
103
99
  // always call the LATEST onMediaEnter without re-arming the observer on every render (the
@@ -489,11 +489,6 @@ export const PriceEvalCol: React.FunctionComponent<{ car: AutobahnCar; t: Transl
489
489
 
490
490
  export type PaymentMode = 'financing' | 'leasing' | 'buy';
491
491
 
492
- /** The tab a card opens on: the requested one (default Finanzierung), but never Leasing for a car
493
- * without a lease rate — PriceTabs has no Leasing tab for it. */
494
- export const startPaymentMode = (car: AutobahnCar, requested?: PaymentMode): PaymentMode =>
495
- requested === 'leasing' && car.lease == null ? 'financing' : requested || 'financing';
496
-
497
492
  export interface PriceTabsProps {
498
493
  car: AutobahnCar;
499
494
  mode: PaymentMode;
@@ -715,12 +710,7 @@ export const PriceTerms: React.FunctionComponent<{
715
710
  onShowDetails?: () => void;
716
711
  t: TranslationFunction;
717
712
  }> = ({ car, mode, onOpenRateAdjust, onShowDetails, t }) => {
718
- // Kaufen (buy): a cash purchase has no financing terms/details link — used to `return null`
719
- // here, which collapsed .cc-terms to 0 height on that tab while Financing/Leasing rendered a
720
- // real line, jumping the price row (and everything below it: rating pill, CTA row) up/down on
721
- // every tab switch. Render an empty, still-present .cc-terms div instead — same fix as the VDP
722
- // FinanceCalculator's .fin-cond (md3.css), which reserves its line's height the same way.
723
- if (mode === 'buy') return <div className="cc-terms" />;
713
+ if (mode === 'buy') return null;
724
714
  const finFirstInstallment =
725
715
  car.finFirstInstallment != null ? car.finFirstInstallment.toLocaleString('de-DE') : _finFirstInstallment;
726
716
  const finMonths = car.finMonths ?? _finMonths;
@@ -1,18 +1,14 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import useModal from './useModal';
3
3
  import { updateCookieList } from '../../utils/CommonUtils';
4
- import { OPEN_COOKIE_SETTINGS_EVENT } from '../../utils/cookieConsent';
5
4
  import Modal from './Modal';
6
- import { TranslationFunction } from '../../types';
7
5
 
8
6
  export interface ICookieModal {
9
7
  handleSentryInit?: () => void;
10
- /** the host's `t` with the `autobahn` namespace (`cookieModal.*`); without it the dialog is German */
11
- t?: TranslationFunction;
12
8
  }
13
9
 
14
- const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
15
- const { isVisible, toggleModal, openModal } = useModal();
10
+ const CookieModal = ({ handleSentryInit = () => {} }: ICookieModal) => {
11
+ const { isVisible, toggleModal } = useModal();
16
12
  const [modal, setModal] = useState('');
17
13
 
18
14
  useEffect(
@@ -26,19 +22,6 @@ const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
26
22
  []
27
23
  );
28
24
 
29
- // ADV-268: "Cookie-Einstellungen ändern" (account page) reopens the settings dialog
30
- useEffect(
31
- () => {
32
- const onOpenSettings = () => {
33
- setModal('MANAGE_COOKIE_MODAL');
34
- openModal();
35
- };
36
- window.addEventListener(OPEN_COOKIE_SETTINGS_EVENT, onOpenSettings);
37
- return () => window.removeEventListener(OPEN_COOKIE_SETTINGS_EVENT, onOpenSettings);
38
- },
39
- []
40
- );
41
-
42
25
  useEffect(
43
26
  () => {
44
27
  if (!isVisible) return undefined;
@@ -62,7 +45,6 @@ const CookieModal = ({ handleSentryInit = () => {}, t }: ICookieModal) => {
62
45
  ? <Modal
63
46
  isVisible={isVisible}
64
47
  handleSentryInit={handleSentryInit}
65
- t={t}
66
48
  toggleModal={toggleModal}
67
49
  name={modal}
68
50
  modalProps={modalProps}
@@ -16,7 +16,6 @@ import * as React from 'react';
16
16
  import * as ReactDOM from 'react-dom';
17
17
 
18
18
  import ModalsConfig from './ModalsConfig';
19
- import { TranslationFunction } from '../../types';
20
19
  import styles from './Modal.styl';
21
20
 
22
21
  interface IBasicModal {
@@ -25,7 +24,6 @@ interface IBasicModal {
25
24
  handleSentryInit?: () => void;
26
25
  name: string;
27
26
  modalProps?: any;
28
- t?: TranslationFunction;
29
27
  }
30
28
 
31
29
  const OVERLAY: React.CSSProperties = {
@@ -42,17 +40,16 @@ const SURFACE: React.CSSProperties = {
42
40
  maxWidth: 640, width: '100%', maxHeight: '92vh', overflowY: 'auto'
43
41
  };
44
42
 
45
- const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit, t }: IBasicModal) => {
43
+ const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit }: IBasicModal) => {
46
44
  if (!isVisible || typeof document === 'undefined') return null;
47
- const label = t ? t('autobahn:cookieModal.dialogLabel') : '';
48
45
  return ReactDOM.createPortal(
49
46
  // wrapped in .md3: autobahn.css scopes every token/utility class (incl.
50
47
  // .mbtn used by the modal buttons) under `.md3` and intentionally does
51
48
  // nothing outside it — a bare document.body portal loses the theme.
52
49
  <div className='md3'>
53
- <div className={styles.overlay} style={OVERLAY} role='dialog' aria-modal='true' aria-label={label && !label.endsWith('cookieModal.dialogLabel') ? label : 'Cookie-Einstellungen'}>
50
+ <div className={styles.overlay} style={OVERLAY} role='dialog' aria-modal='true' aria-label='Cookie-Einstellungen'>
54
51
  <div className={styles.surface} style={SURFACE}>
55
- {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit, t })}
52
+ {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
56
53
  </div>
57
54
  </div>
58
55
  </div>,
@@ -8,43 +8,19 @@ import MaterialAccordionGroup from '../../../MdAccordionGroup/MdAccordionGroup';
8
8
  import MaterialSwitch from '../../../MdSwitch/MdSwitch';
9
9
  import { COOKIE_SCHEMA, COOKIE_SCHEMA_LINKS } from '../../../../constants/common';
10
10
  import { updateCookieList } from '../../../../utils/CommonUtils';
11
- import { saveCookieConfig } from '../../../../utils/cookieConsent';
12
- import { TranslationFunction } from '../../../../types';
13
11
 
14
12
  import styles from './ManageCookieModal.styl';
15
13
 
16
14
  interface IManageCookieModal {
17
15
  toggleModal: () => void;
18
16
  handleSentryInit?: () => void;
19
- /** the host's `t` with the `autobahn` namespace loaded; without it the dialog stays German (fe-landing) */
20
- t?: TranslationFunction;
21
17
  }
22
18
 
23
19
  interface IMarketingSwitches {
24
20
  [key: string]: any;
25
21
  }
26
22
 
27
- // the German copy (locales/de/autobahn.json `cookieModal`), used as is when the host passes no `t`
28
- const DE: Record<string, string> = {
29
- title: 'Nach den Cookies geht die Fahrt weiter.',
30
- manageText: 'Für ein bestmögliches Nutzererlebnis setzen wir Cookies und andere Technologien ein. Diese können Sie hier verwalten.',
31
- 'necessary.title': 'Notwendig',
32
- 'necessary.text': 'Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert. Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen können, wenn Sie auf unsere Website zurückkehren. Sie können diese Cookies in den Einstellungen Ihres Browsers deaktivieren, aber wenn Sie dies tun, funktioniert die Website möglicherweise nicht wie vorgesehen.',
33
- 'analytics.title': 'Analytisch',
34
- 'analytics.text': 'Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen, damit wir Ihnen relevantere Informationen präsentieren können.',
35
- 'marketing.title': 'Marketing',
36
- 'marketing.text': 'Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites. Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der von Ihnen besuchten Seiten auf unserer Website anzeigen.',
37
- privacyPolicy: 'Datenschutzbestimmungen',
38
- saveSelection: 'Auswahl speichern',
39
- acceptAll: 'Alles akzeptieren'
40
- };
41
-
42
- const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieModal) => {
43
- // a key the host can't resolve (namespace not loaded) comes back as the key itself
44
- const tr = (key: string) => {
45
- const text = t ? t(`autobahn:cookieModal.${key}`) : '';
46
- return text && !text.endsWith(`cookieModal.${key}`) ? text : DE[key];
47
- };
23
+ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModal) => {
48
24
  const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(false);
49
25
  const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(false);
50
26
  const [analyticsSwitches, setAnalyticsSwitches] = useState<IMarketingSwitches>({});
@@ -68,10 +44,6 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
68
44
  .reduce((acc, item) => ({ ...acc, [item]: !!savedConfig && !savedDisabledMarketing.includes(item) }), {});
69
45
  setAnalyticsSwitches(newAnalyticsSwitches);
70
46
  setMarketingSwitches(newMarketingSwitches);
71
- // ADV-268: reopened from the account page, a category whose cookies are all allowed shows
72
- // its master switch on (it always started off)
73
- setAnalyticsMasterSwitch(Object.values(newAnalyticsSwitches).every(Boolean));
74
- setMarketingMasterSwitch(Object.values(newMarketingSwitches).every(Boolean));
75
47
  },
76
48
  []
77
49
  );
@@ -114,7 +86,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
114
86
  marketing: Object.keys(marketingSwitches).filter(i => !marketingSwitches[i]) || [],
115
87
  analytics: Object.keys(analyticsSwitches).filter(i => !analyticsSwitches[i]) || []
116
88
  };
117
- saveCookieConfig(cookieConfig);
89
+ localStorage.setItem('cookieConfig', JSON.stringify(cookieConfig));
118
90
  updateCookieList(handleSentryInit);
119
91
  toggleModal();
120
92
  };
@@ -138,34 +110,34 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
138
110
  return (
139
111
  <div className={styles.modalWrapper}>
140
112
  <IconSVG name='autodeLogo' customDimensions />
141
- <div className={styles.modalTitle}>{tr('title')}</div>
142
- <div className={styles.modalContent}>{tr('manageText')}</div>
113
+ <div className={styles.modalTitle}>Nach den Cookies geht die Fahrt weiter.</div>
114
+ <div className={styles.modalContent}>Für ein bestmögliches Nutzererlebnis setzen wir Cookies und andere Technologien ein. Diese können Sie hier verwalten.</div>
143
115
  <div className={styles.accordions}>
144
116
  <MaterialAccordionGroup
145
- title={tr('necessary.title')}
117
+ title='Notwendig'
146
118
  // tooltipText='Notwendig'
147
119
  withSwitch
148
120
  switchProps={necessarySwitchProps}
149
121
  >
150
- <span className={styles.accordionDescription}>{tr('necessary.text')}</span>
122
+ <span className={styles.accordionDescription}>Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert. Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen können, wenn Sie auf unsere Website zurückkehren. Sie können diese Cookies in den Einstellungen Ihres Browsers deaktivieren, aber wenn Sie dies tun, funktioniert die Website möglicherweise nicht wie vorgesehen.</span>
151
123
  {Object.keys(COOKIE_SCHEMA.necessary).map(cookie => {
152
124
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
153
125
  return (
154
126
  <div className={styles.switchBlock} key={cookie} >
155
127
  <span className={styles.switchBlockTitle}>{cookie}</span>
156
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
128
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
157
129
  <MaterialSwitch sx={{ marginLeft: 'auto' }} disabled={true} value={true} onChange={() => {}} />
158
130
  </div>
159
131
  );
160
132
  })}
161
133
  </MaterialAccordionGroup>
162
134
  <MaterialAccordionGroup
163
- title={tr('analytics.title')}
135
+ title='Analytisch'
164
136
  withSwitch
165
137
  // tooltipText='Analytisch'
166
138
  switchProps={analyticsSwitchProps}
167
139
  >
168
- <span className={styles.accordionDescription}>{tr('analytics.text')}</span>
140
+ <span className={styles.accordionDescription}>Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen, damit wir Ihnen relevantere Informationen präsentieren können.</span>
169
141
  {Object.keys(COOKIE_SCHEMA.analytics).map(cookie => {
170
142
  const getItemsFromCategory = _get(COOKIE_SCHEMA, `analytics['${cookie}']`, null);
171
143
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
@@ -173,7 +145,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
173
145
  return (
174
146
  <div className={styles.switchBlock} key={cookie} >
175
147
  <span className={styles.switchBlockTitle}>{cookie}</span>
176
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
148
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
177
149
  <MaterialSwitch
178
150
  sx={{ marginLeft: 'auto' }}
179
151
  value={isChecked}
@@ -184,12 +156,12 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
184
156
  })}
185
157
  </MaterialAccordionGroup>
186
158
  <MaterialAccordionGroup
187
- title={tr('marketing.title')}
159
+ title='Marketing'
188
160
  withSwitch
189
161
  // tooltipText='Marketing'
190
162
  switchProps={marketingSwitchProps}
191
163
  >
192
- <span className={styles.accordionDescription}>{tr('marketing.text')}</span>
164
+ <span className={styles.accordionDescription}>Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites. Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der von Ihnen besuchten Seiten auf unserer Website anzeigen.</span>
193
165
  {Object.keys(COOKIE_SCHEMA.marketing).map(cookie => {
194
166
  const getItemsFromCategory = _get(COOKIE_SCHEMA, `marketing['${cookie}']`, null);
195
167
  const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
@@ -197,7 +169,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
197
169
  return (
198
170
  <div className={styles.switchBlock} key={cookie} >
199
171
  <span className={styles.switchBlockTitle}>{cookie}</span>
200
- <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>{tr('privacyPolicy')}</a>
172
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
201
173
  <MaterialSwitch
202
174
  sx={{ marginLeft: 'auto' }}
203
175
  value={isChecked}
@@ -209,8 +181,8 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit, t } : IManageCookieM
209
181
  </MaterialAccordionGroup>
210
182
  </div>
211
183
  <div className={styles.buttonsContainer}>
212
- <Button onClick={() => onAccept()} className={classNames(styles.modalBtn, styles.outlinedBtn, styles.zustimmenBtn)} >{tr('saveSelection')}</Button>
213
- <Button onClick={() => onAccept({ marketing: [], analytics: [] })} className={classNames(styles.modalBtn, styles.zustimmenBtn)}>{tr('acceptAll')}</Button>
184
+ <Button onClick={() => onAccept()} className={classNames(styles.modalBtn, styles.outlinedBtn, styles.zustimmenBtn)} >Auswahl speichern</Button>
185
+ <Button onClick={() => onAccept({ marketing: [], analytics: [] })} className={classNames(styles.modalBtn, styles.zustimmenBtn)}>Alles akzeptieren</Button>
214
186
  </div>
215
187
  </div>
216
188
  );
@@ -3,7 +3,6 @@ import IconSVG from '../../../../iconsvg/IconSVG';
3
3
  import Button from '../../../Button/Button';
4
4
  import styles from './PreviewCookieModal.styl';
5
5
  import { updateCookieList } from '../../../../utils/CommonUtils';
6
- import { saveCookieConfig } from '../../../../utils/cookieConsent';
7
6
  import { COOKIE_SCHEMA } from '../../../../constants/common';
8
7
 
9
8
  interface IPreviewCookieModal {
@@ -15,16 +14,16 @@ interface IPreviewCookieModal {
15
14
  const PreviewCookieModal = ({ toggleModal, setModal, handleSentryInit } : IPreviewCookieModal) => {
16
15
  const environment = window.location.origin;
17
16
  const onAcceptAll = () => {
18
- saveCookieConfig({ marketing: [], analytics: [] });
17
+ localStorage.setItem('cookieConfig', JSON.stringify({ marketing: [], analytics: [] }));
19
18
  updateCookieList(handleSentryInit);
20
19
  toggleModal();
21
20
  };
22
21
 
23
22
  const onDisableAll = () => {
24
- saveCookieConfig({
23
+ localStorage.setItem('cookieConfig', JSON.stringify({
25
24
  marketing: Object.values(COOKIE_SCHEMA.marketing).reduce((acc: string[], val: string[]) => acc.concat(val), []),
26
25
  analytics: Object.values(COOKIE_SCHEMA.analytics).reduce((acc: string[], val: string[]) => acc.concat(val), [])
27
- });
26
+ }));
28
27
  updateCookieList(handleSentryInit);
29
28
  toggleModal();
30
29
  };
@@ -7,11 +7,7 @@ const useModal = () => {
7
7
  setIsVisible(!isVisible);
8
8
  };
9
9
 
10
- const openModal = () => {
11
- setIsVisible(true);
12
- };
13
-
14
- return { isVisible, toggleModal, openModal };
10
+ return { isVisible, toggleModal };
15
11
  };
16
12
 
17
13
  export default useModal;
package/constants/app.ts CHANGED
@@ -40,17 +40,7 @@ export const LOCAL_STORAGE_KEY = {
40
40
  i18n_KEY: 'i18nLanguage'
41
41
  };
42
42
 
43
- // ADV-284: evaluated at import time — with site storage blocked, reading localStorage throws a
44
- // SecurityError that took down the whole bundle. Blocked storage behaves like "nothing saved".
45
- const readStoredLang = (): string | null => {
46
- try {
47
- return localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY);
48
- } catch (e) {
49
- return null;
50
- }
51
- };
52
-
53
- export const DEFAULT_LANG: string = typeof window !== 'undefined' ? readStoredLang() : 'de';
43
+ export const DEFAULT_LANG: string = typeof window !== 'undefined' ? localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : 'de';
54
44
 
55
45
  // Default support contact phone
56
46
  export const CONTACT_PHONE: string = '+498004030182';
package/constants/core.ts CHANGED
@@ -35,18 +35,7 @@ export const LOCAL_STORAGE_KEY = {
35
35
  i18n_KEY: 'i18nLanguage'
36
36
  };
37
37
 
38
- // ADV-284: evaluated at import time — with site storage blocked, merely reading
39
- // window.localStorage throws a SecurityError, which took down the whole bundle (landing
40
- // page never rendered). Treat blocked storage like "no language saved".
41
- const readStoredLang = (): string | null => {
42
- try {
43
- return typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : null;
44
- } catch (e) {
45
- return null;
46
- }
47
- };
48
-
49
- export const DEFAULT_LANG: string = readStoredLang() ?? 'de';
38
+ export const DEFAULT_LANG: string = (typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : null) ?? 'de';
50
39
 
51
40
  export const ROW_STYLES = {
52
41
  marginBottom: 10