This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"extends": ["next/core-web-vitals", "next/typescript"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"prefer-const": "warn",
|
||||
"react/no-unescaped-entities": "off",
|
||||
|
||||
32
app/[locale]/error.tsx
Normal file
32
app/[locale]/error.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
'use client';
|
||||
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
import { useEffect } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { Container, Button } from '@/components/ui';
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
const t = useTranslations('Error');
|
||||
|
||||
useEffect(() => {
|
||||
Sentry.captureException(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<Container className="py-24 flex flex-col items-center justify-center text-center min-h-[60vh]">
|
||||
<h2 className="text-3xl font-bold mb-4">{t('title')}</h2>
|
||||
<p className="text-white/60 mb-8 max-w-md">
|
||||
{t('description')}
|
||||
</p>
|
||||
<Button onClick={() => reset()}>
|
||||
{t('tryAgain')}
|
||||
</Button>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
24
app/global-error.tsx
Normal file
24
app/global-error.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
'use client';
|
||||
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
import Error from 'next/error';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
}) {
|
||||
useEffect(() => {
|
||||
Sentry.captureException(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<html>
|
||||
<body>
|
||||
{/* This is the default Next.js error component but it doesn't allow omitting the statusCode */}
|
||||
<Error statusCode={0} />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import Image from 'next/image';
|
||||
import { useTranslations, useLocale } from 'next-intl';
|
||||
import { Container, Heading } from './ui';
|
||||
import { Container } from './ui';
|
||||
|
||||
export default function Footer() {
|
||||
const t = useTranslations('Footer');
|
||||
|
||||
@@ -25,13 +25,14 @@ export default function Reveal({ children, className, threshold = 0.1, delay = 0
|
||||
{ threshold }
|
||||
);
|
||||
|
||||
if (ref.current) {
|
||||
observer.observe(ref.current);
|
||||
const currentRef = ref.current;
|
||||
if (currentRef) {
|
||||
observer.observe(currentRef);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (ref.current) {
|
||||
observer.unobserve(ref.current);
|
||||
if (currentRef) {
|
||||
observer.unobserve(currentRef);
|
||||
}
|
||||
};
|
||||
}, [threshold]);
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import Image from 'next/image';
|
||||
import { useTranslations, useLocale } from 'next-intl';
|
||||
import { Section, Heading } from '../../components/ui';
|
||||
import { Section } from '../../components/ui';
|
||||
|
||||
export default function ProductCategories() {
|
||||
const t = useTranslations('Products');
|
||||
@@ -56,7 +56,7 @@ export default function ProductCategories() {
|
||||
<div className="absolute inset-0 p-8 md:p-10 flex flex-col justify-end text-white">
|
||||
<div className="mb-4 md:mb-6 transform transition-all duration-500 group-hover:-translate-y-4">
|
||||
<div className="w-12 h-12 md:w-16 md:h-16 bg-white/10 backdrop-blur-md rounded-xl flex items-center justify-center mb-4 md:mb-6 border border-white/20">
|
||||
<img src={category.icon} alt="" className="w-8 h-8 md:w-10 md:h-10 brightness-0 invert" />
|
||||
<Image src={category.icon} alt="" width={40} height={40} className="w-8 h-8 md:w-10 md:h-10 brightness-0 invert" unoptimized />
|
||||
</div>
|
||||
<h3 className="text-2xl md:text-3xl font-bold mb-2 md:mb-4 leading-tight">{category.title}</h3>
|
||||
<p className="text-white/80 text-base md:text-lg line-clamp-3 opacity-100 md:opacity-0 group-hover:opacity-100 transition-all duration-500 max-h-24 md:max-h-0 group-hover:max-h-32">
|
||||
|
||||
@@ -423,6 +423,7 @@ export const PDFDatasheet: React.FC<PDFDatasheetProps> = ({
|
||||
<View style={styles.logoArea}>
|
||||
<View style={styles.logoContainer}>
|
||||
{logoUrl ? (
|
||||
/* eslint-disable-next-line jsx-a11y/alt-text */
|
||||
<Image src={logoUrl} style={styles.logo} />
|
||||
) : (
|
||||
<View>
|
||||
|
||||
@@ -314,5 +314,10 @@
|
||||
"needHelp": "Brauchen Sie Hilfe?",
|
||||
"supportTeamAvailable": "Unser Support-Team steht Ihnen bei Fragen zu diesem Thema gerne zur Verfügung.",
|
||||
"contactUs": "Kontaktieren Sie uns"
|
||||
},
|
||||
"Error": {
|
||||
"title": "Etwas ist schief gelaufen!",
|
||||
"description": "Wir sind auf einen unerwarteten Fehler gestoßen. Unser Team wurde benachrichtigt und arbeitet an einer Lösung.",
|
||||
"tryAgain": "Erneut versuchen"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,5 +314,10 @@
|
||||
"needHelp": "Need Help?",
|
||||
"supportTeamAvailable": "Our support team is available for any questions regarding this topic.",
|
||||
"contactUs": "Contact Us"
|
||||
},
|
||||
"Error": {
|
||||
"title": "Something went wrong!",
|
||||
"description": "We encountered an unexpected error. Our team has been notified and is working on a fix.",
|
||||
"tryAgain": "Try again"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user