Compare commits

...

2 Commits

Author SHA1 Message Date
hamid zarghami e89b71b416 render mode
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled
2026-06-14 09:09:52 +03:30
hamid zarghami 29f7b9db58 update delivery 2026-06-14 09:06:23 +03:30
2 changed files with 15 additions and 21 deletions
@@ -7,6 +7,9 @@ import HorizontalScrollView from "@/components/listview/HorizontalScrollView";
import clsx from "clsx";
import { usePathname } from "next/navigation";
/** TODO: remove when backend sends avatarRenderMode */
const COLORED_SVG_RESTAURANT_SLUGS = new Set(["havasone"]);
const SVG_MASK_STYLE = {
maskSize: "contain",
maskRepeat: "no-repeat",
@@ -20,16 +23,17 @@ function CategoryImage({
src,
size,
alt,
// proxyBase,
tintWithPrimary = true,
}: {
src: string;
size: number;
alt: string;
// proxyBase: string | null;
tintWithPrimary?: boolean;
}) {
const isSvg = src.endsWith(".svg");
const shouldUseSvgMask = isSvg && tintWithPrimary;
if (isSvg) {
if (shouldUseSvgMask) {
return (
<div
className="shrink-0 bg-primary"
@@ -44,17 +48,6 @@ function CategoryImage({
aria-label={alt}
/>
);
return (
// eslint-disable-next-line @next/next/no-img-element
<img
src={src}
width={size}
height={size}
alt={alt}
className="shrink-0 object-contain"
/>
);
}
return (
@@ -65,6 +58,7 @@ function CategoryImage({
height={size}
alt={alt}
loading="lazy"
className="shrink-0 object-contain"
onError={(event) => {
event.currentTarget.src = "/assets/images/food-image.png";
}}
@@ -107,7 +101,9 @@ const CategoryScroll = ({
className,
}: Props) => {
const segment = usePathname()?.split("/").filter(Boolean)[0];
const proxyBase = segment != null ? `/${segment}` : null;
const usesColoredSvg =
segment != null &&
COLORED_SVG_RESTAURANT_SLUGS.has(segment.toLowerCase());
const { renderer: Renderer, imageSize } = variantConfig[variant];
const handleSelect = (categoryId: string) => () => onSelect(categoryId);
@@ -147,7 +143,7 @@ const CategoryScroll = ({
src={item.avatarUrl || "/assets/images/food-image.png"}
size={imageSize}
alt="category image"
// proxyBase={proxyBase}
tintWithPrimary={!usesColoredSvg}
/>
<span className="text-xs text-foreground text-center">
{item.title}
+3 -5
View File
@@ -7,6 +7,8 @@ const HOST_MAP: Record<string, string> = {
"thesun.tahavol-mr.ir": "/suncafe",
"passataplus.ir": "/passata",
"cookieca.ir": "/cookieca",
"felamingofood.ir": "/felamingo",
"nanakbakery.ir": "/nanakbakery",
// دامنه‌های جدید اینجا اضافه می‌شوند
};
@@ -21,11 +23,7 @@ export function middleware(req: NextRequest) {
const pathname = req.nextUrl.pathname;
// مسیرهای api و استاتیک را rewrite نکن
if (
pathname.startsWith("/api") ||
pathname.startsWith("/_next") ||
pathname.includes(".")
) {
if (pathname.startsWith("/api") || pathname.startsWith("/_next") || pathname.includes(".")) {
return NextResponse.next();
}