fix: linting cleanup, TS errors, mobile cookie banner and hero max-width

This commit is contained in:
MichalC
2026-08-01 12:27:14 +02:00
parent 02cb49e180
commit 88cb4c516d
49 changed files with 167 additions and 125 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ export const useConsentStore = create<ConsentState>((set) => ({
stored = JSON.stringify(newData);
localStorage.setItem(CONSENT_KEY, stored);
localStorage.removeItem(OLD_CONSENT_KEY);
} catch (e) {
} catch {
// Ignore if parse fails
}
}
@@ -63,7 +63,7 @@ export const useConsentStore = create<ConsentState>((set) => ({
marketing: !!parsed.marketing,
advertising: !!parsed.advertising,
});
} catch (e) {
} catch {
// If parsing fails, show banner
set({ isInitialized: true, isOpen: true });
}
+12 -3
View File
@@ -1,15 +1,24 @@
'use client';
declare global {
interface Window {
grecaptcha: {
ready: (cb: () => void) => void;
execute: (siteKey: string, options: { action: string }) => Promise<string>;
};
}
}
export function getRecaptchaToken(action: string = 'submit'): Promise<string | null> {
return new Promise((resolve) => {
const siteKey = process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY;
if (typeof window === 'undefined' || !siteKey || !(window as any).grecaptcha) {
if (typeof window === 'undefined' || !siteKey || !window.grecaptcha) {
resolve(null);
return;
}
try {
(window as any).grecaptcha.ready(() => {
(window as any).grecaptcha
window.grecaptcha.ready(() => {
window.grecaptcha
.execute(siteKey, { action })
.then((token: string) => resolve(token))
.catch(() => resolve(null));