refactor: change Image Optimization to custom url

This commit is contained in:
Kentai Radiquum 2024-08-23 04:51:47 +05:00
parent 61e8b74d11
commit ff11a90a5e
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
11 changed files with 100 additions and 28 deletions

View file

@ -1,5 +1,6 @@
import { numberDeclension } from "#/api/utils";
import Link from "next/link";
import Image from "next/image";
export const RelatedSection = (props: any) => {
const declension = numberDeclension(
@ -14,12 +15,18 @@ export const RelatedSection = (props: any) => {
<div className="flex items-center justify-center p-4">
{props.images.map((item) => {
return (
<img
key={item}
src={item}
alt=""
className="w-[100px] lg:w-[300px] object-cover aspect-[9/12] even:scale-110 shadow-md even:shadow-lg even:z-30 origin-center first:[transform:translateX(25%)] last:[transform:translateX(-25%)]"
/>
<div className="w-[100px] lg:w-[300px] aspect-[9/12] even:scale-110 shadow-md even:shadow-lg even:z-30 origin-center first:[transform:translateX(25%)] last:[transform:translateX(-25%)]">
<Image
fill={true}
key={item}
src={item}
alt=""
sizes="
(max-width: 1024px) 100px,
300px
"
/>
</div>
);
})}
</div>
@ -29,11 +36,11 @@ export const RelatedSection = (props: any) => {
{props.release_count} {declension} во франшизе
</p>
<Link href={`/related/${props.id}`}>
<div className="flex items-center px-8 py-2 transition border border-black rounded-full hover:text-white hover:bg-black dark:border-white hover:dark:text-black hover:dark:bg-white">
<p className="text-xl font-bold">Перейти</p>
<span className="w-6 h-6 iconify mdi--arrow-right"></span>
</div>
</Link>
<div className="flex items-center px-8 py-2 transition border border-black rounded-full hover:text-white hover:bg-black dark:border-white hover:dark:text-black hover:dark:bg-white">
<p className="text-xl font-bold">Перейти</p>
<span className="w-6 h-6 iconify mdi--arrow-right"></span>
</div>
</Link>
</div>
</div>
</section>