remove proxy
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: پاسخهای Agent همیشه به فارسی باشد
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# زبان پاسخ
|
||||
|
||||
- همیشه به **فارسی (Farsi)** پاسخ بده.
|
||||
- مگر اینکه کاربر صریحاً زبان دیگری بخواهد.
|
||||
- کد، نام متغیرها، و کامنتهای کد را به انگلیسی نگه دار؛ فقط توضیحات و متنهای کاربرپسند را فارسی بنویس.
|
||||
@@ -20,43 +20,30 @@ function CategoryImage({
|
||||
src,
|
||||
size,
|
||||
alt,
|
||||
proxyBase,
|
||||
// proxyBase,
|
||||
}: {
|
||||
src: string;
|
||||
size: number;
|
||||
alt: string;
|
||||
proxyBase: string | null;
|
||||
// proxyBase: string | null;
|
||||
}) {
|
||||
const isSvg = src.endsWith(".svg");
|
||||
|
||||
if (isSvg) {
|
||||
const isSameOrigin =
|
||||
src.startsWith("/") ||
|
||||
(typeof window !== "undefined" &&
|
||||
new URL(src, window.location.href).origin === window.location.origin);
|
||||
|
||||
const maskUrl = isSameOrigin
|
||||
? src
|
||||
: proxyBase
|
||||
? `${proxyBase}/api/proxy-svg?url=${encodeURIComponent(src)}`
|
||||
: null;
|
||||
|
||||
if (maskUrl) {
|
||||
return (
|
||||
<div
|
||||
className="shrink-0 bg-primary"
|
||||
style={{
|
||||
width: size,
|
||||
height: size,
|
||||
maskImage: `url(${maskUrl})`,
|
||||
WebkitMaskImage: `url(${maskUrl})`,
|
||||
...SVG_MASK_STYLE,
|
||||
}}
|
||||
role="img"
|
||||
aria-label={alt}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className="shrink-0 bg-primary"
|
||||
style={{
|
||||
width: size,
|
||||
height: size,
|
||||
maskImage: `url(${src})`,
|
||||
WebkitMaskImage: `url(${src})`,
|
||||
...SVG_MASK_STYLE,
|
||||
}}
|
||||
role="img"
|
||||
aria-label={alt}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
@@ -160,7 +147,7 @@ const CategoryScroll = ({
|
||||
src={item.avatarUrl || "/assets/images/food-image.png"}
|
||||
size={imageSize}
|
||||
alt="category image"
|
||||
proxyBase={proxyBase}
|
||||
// proxyBase={proxyBase}
|
||||
/>
|
||||
<span className="text-xs text-foreground text-center">
|
||||
{item.title}
|
||||
|
||||
Reference in New Issue
Block a user