fix: remove styled-jsx from not-found.tsx to fix Server Component error
- Remove styled-jsx global styles that don't work in Server Components - Remove custom fadeInUp CSS animations - Simplify animation classes to use Tailwind defaults or none - Fix Server Component compatibility issues
This commit is contained in:
@@ -59,9 +59,7 @@ export default async function NotFoundPage() {
|
|||||||
{/* Hero Section */}
|
{/* Hero Section */}
|
||||||
<section className="pt-24 pb-12 px-4 sm:px-6 lg:px-8 bg-gradient-to-b from-gray-50 to-white">
|
<section className="pt-24 pb-12 px-4 sm:px-6 lg:px-8 bg-gradient-to-b from-gray-50 to-white">
|
||||||
<div className="max-w-4xl mx-auto text-center">
|
<div className="max-w-4xl mx-auto text-center">
|
||||||
<div
|
<div className="animate-fade-in">
|
||||||
className="opacity-0 translate-y-5 animate-[fadeInUp_0.6s_ease-out_forwards]"
|
|
||||||
>
|
|
||||||
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-serif italic text-[#1A1A1A] mb-4 leading-tight">
|
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-serif italic text-[#1A1A1A] mb-4 leading-tight">
|
||||||
{t("title")}
|
{t("title")}
|
||||||
</h1>
|
</h1>
|
||||||
@@ -90,8 +88,7 @@ export default async function NotFoundPage() {
|
|||||||
<section className="py-16 sm:py-20 px-4 sm:px-6 lg:px-8">
|
<section className="py-16 sm:py-20 px-4 sm:px-6 lg:px-8">
|
||||||
<div className="max-w-7xl mx-auto">
|
<div className="max-w-7xl mx-auto">
|
||||||
<div
|
<div
|
||||||
className="text-center mb-12 opacity-0 translate-y-5"
|
className="text-center mb-12"
|
||||||
style={{ animation: "fadeInUp 0.6s ease-out forwards" }}
|
|
||||||
>
|
>
|
||||||
<span className="text-xs tracking-[0.3em] uppercase text-[#6B7280] mb-4 block">
|
<span className="text-xs tracking-[0.3em] uppercase text-[#6B7280] mb-4 block">
|
||||||
Popular
|
Popular
|
||||||
@@ -111,9 +108,8 @@ export default async function NotFoundPage() {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={product.id}
|
key={product.id}
|
||||||
className="group opacity-0 translate-y-5"
|
className="group"
|
||||||
style={{
|
style={{
|
||||||
animation: `fadeInUp 0.5s ease-out ${index * 100}ms forwards`
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link href={`/${validLocale}/products/${product.slug}`} className="block">
|
<Link href={`/${validLocale}/products/${product.slug}`} className="block">
|
||||||
@@ -175,8 +171,7 @@ export default async function NotFoundPage() {
|
|||||||
<section className="py-16 sm:py-20 px-4 sm:px-6 lg:px-8 bg-[#F0F7FA]">
|
<section className="py-16 sm:py-20 px-4 sm:px-6 lg:px-8 bg-[#F0F7FA]">
|
||||||
<div className="max-w-7xl mx-auto">
|
<div className="max-w-7xl mx-auto">
|
||||||
<div
|
<div
|
||||||
className="text-center mb-12 opacity-0 translate-y-5"
|
className="text-center mb-12"
|
||||||
style={{ animation: "fadeInUp 0.6s ease-out forwards" }}
|
|
||||||
>
|
>
|
||||||
<span className="text-xs tracking-[0.3em] uppercase text-[#6B7280] mb-4 block">
|
<span className="text-xs tracking-[0.3em] uppercase text-[#6B7280] mb-4 block">
|
||||||
Testimonials
|
Testimonials
|
||||||
@@ -190,8 +185,7 @@ export default async function NotFoundPage() {
|
|||||||
{productReviews.slice(0, 6).map((review, index) => (
|
{productReviews.slice(0, 6).map((review, index) => (
|
||||||
<div
|
<div
|
||||||
key={review.id}
|
key={review.id}
|
||||||
className="bg-white rounded-lg p-6 shadow-sm opacity-0 translate-y-5"
|
className="bg-white rounded-lg p-6 shadow-sm"
|
||||||
style={{ animation: `fadeInUp 0.6s ease-out ${index * 100}ms forwards` }}
|
|
||||||
>
|
>
|
||||||
<div className="flex gap-1 mb-4">
|
<div className="flex gap-1 mb-4">
|
||||||
{[...Array(5)].map((_, i) => (
|
{[...Array(5)].map((_, i) => (
|
||||||
@@ -227,8 +221,7 @@ export default async function NotFoundPage() {
|
|||||||
<section className="py-16 sm:py-24 px-4 sm:px-6 lg:px-8">
|
<section className="py-16 sm:py-24 px-4 sm:px-6 lg:px-8">
|
||||||
<div className="max-w-4xl mx-auto text-center">
|
<div className="max-w-4xl mx-auto text-center">
|
||||||
<div
|
<div
|
||||||
className="opacity-0 translate-y-5"
|
className=""
|
||||||
style={{ animation: "fadeInUp 0.6s ease-out forwards" }}
|
|
||||||
>
|
>
|
||||||
<h2 className="font-serif italic text-3xl sm:text-4xl lg:text-5xl text-[#1A1A1A] mb-4 tracking-tight">
|
<h2 className="font-serif italic text-3xl sm:text-4xl lg:text-5xl text-[#1A1A1A] mb-4 tracking-tight">
|
||||||
{t("finalCTATitle")}
|
{t("finalCTATitle")}
|
||||||
@@ -261,19 +254,6 @@ export default async function NotFoundPage() {
|
|||||||
`,
|
`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style jsx global>{`
|
|
||||||
@keyframes fadeInUp {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(20px);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user