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