Commit 40d4b3f5 authored by Lê Bảo Hồng Đức's avatar Lê Bảo Hồng Đức

fix

parent 15b1aaea
......@@ -13,7 +13,6 @@ const FALLBACK_HREF = "https://vccihcm.vn";
function AdItem({ item }: { item: Advertisement }) {
const initialSrc = item.file?.path ? resolveUploadUrl(item.file.path) : FALLBACK_SRC;
const [src, setSrc] = useState(initialSrc);
const isGif = src.toLowerCase().endsWith(".gif");
return (
<Link
......@@ -30,7 +29,7 @@ function AdItem({ item }: { item: Advertisement }) {
width={2048}
height={1365}
className="h-full w-full object-cover object-[center_80%]"
unoptimized={isGif}
unoptimized
onError={() => {
if (src !== FALLBACK_SRC) setSrc(FALLBACK_SRC);
}}
......
......@@ -16,7 +16,7 @@ export function useAdvertisements(
type: "square" | "horizontal",
limit?: number,
): Advertisement[] {
const effectiveLimit = limit ?? (type === "horizontal" ? 1 : 20);
const effectiveLimit = limit ?? (type === "horizontal" ? 1 : 5);
const { data } = useGetApiV10AdvertisementPublic({
type: type as GetApiV10AdvertisementPublicType,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment