feat(core): polish codebase, enhance error handling, security hardening, rate limiting, and a11y compliance
Deploy Canina / deploy (push) Successful in 1m43s
Deploy Canina / deploy (push) Successful in 1m43s
This commit is contained in:
1 parent
70c2627d93
commit
7b89e141c5
17 files changed
+237
-17
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"use client";
|
||||
import React, { useEffect } from "react";
|
||||
import { ServerErrorPage } from "../../components/ErrorPages";
|
||||
|
||||
export default function B2BErrorBoundary({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error("B2B Route Error:", error);
|
||||
}, [error]);
|
||||
|
||||
return <ServerErrorPage onRetry={reset} />;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
"use client";
|
||||
import React, { useEffect } from "react";
|
||||
import { ServerErrorPage } from "../../components/ErrorPages";
|
||||
|
||||
export default function BlogErrorBoundary({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error("Blog Route Error:", error);
|
||||
}, [error]);
|
||||
|
||||
return <ServerErrorPage onRetry={reset} />;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import React from "react";
|
||||
import { Skeleton } from "../../components/Skeleton";
|
||||
|
||||
export default function BlogLoading() {
|
||||
return (
|
||||
<div className="min-h-screen bg-slate-50/50 py-10 px-4 font-vazir" dir="rtl">
|
||||
<div className="max-w-7xl mx-auto space-y-8">
|
||||
<div className="text-center space-y-3 max-w-xl mx-auto">
|
||||
<Skeleton className="w-48 h-8 rounded-full mx-auto" />
|
||||
<Skeleton className="w-72 h-10 rounded-2xl mx-auto" />
|
||||
<Skeleton className="w-96 h-5 rounded-xl mx-auto" />
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="bg-white rounded-3xl p-5 border border-slate-100 space-y-4 shadow-sm">
|
||||
<Skeleton className="w-full h-48 rounded-2xl" />
|
||||
<div className="flex gap-2">
|
||||
<Skeleton className="w-16 h-6 rounded-full" />
|
||||
<Skeleton className="w-20 h-6 rounded-full" />
|
||||
</div>
|
||||
<Skeleton className="w-3/4 h-6 rounded-lg" />
|
||||
<Skeleton className="w-full h-4 rounded-lg" />
|
||||
<Skeleton className="w-2/3 h-4 rounded-lg" />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
"use client";
|
||||
import React, { useEffect } from "react";
|
||||
import { ServerErrorPage } from "../../components/ErrorPages";
|
||||
|
||||
export default function ShopErrorBoundary({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error("Shop Route Error:", error);
|
||||
}, [error]);
|
||||
|
||||
return <ServerErrorPage onRetry={reset} />;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import React from "react";
|
||||
import { Skeleton } from "../../components/Skeleton";
|
||||
|
||||
export default function ShopLoading() {
|
||||
return (
|
||||
<div className="min-h-screen bg-slate-50/50 py-10 px-4 font-vazir" dir="rtl">
|
||||
<div className="max-w-7xl mx-auto space-y-8">
|
||||
{/* Banner Skeleton */}
|
||||
<div className="w-full h-44 rounded-3xl bg-slate-200 animate-pulse" />
|
||||
|
||||
{/* Filters & Search Row */}
|
||||
<div className="flex flex-wrap gap-4 items-center justify-between">
|
||||
<Skeleton className="w-48 h-12 rounded-2xl" />
|
||||
<div className="flex gap-2">
|
||||
<Skeleton className="w-24 h-10 rounded-xl" />
|
||||
<Skeleton className="w-24 h-10 rounded-xl" />
|
||||
<Skeleton className="w-24 h-10 rounded-xl" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Product Cards Grid */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
<div key={i} className="bg-white rounded-3xl p-5 border border-slate-100 space-y-4 shadow-sm">
|
||||
<Skeleton className="w-full aspect-square rounded-2xl" />
|
||||
<Skeleton className="w-3/4 h-5 rounded-lg" />
|
||||
<Skeleton className="w-1/2 h-4 rounded-lg" />
|
||||
<div className="flex items-center justify-between pt-4 border-t border-slate-100">
|
||||
<Skeleton className="w-24 h-6 rounded-lg" />
|
||||
<Skeleton className="w-10 h-10 rounded-xl" />
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user