feat: replace tv show icon
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { asset } from "$fresh/runtime.ts";
|
||||
import * as CSS from "https://esm.sh/csstype@3.1.2";
|
||||
|
||||
const Image = (
|
||||
@ -14,7 +15,7 @@ const Image = (
|
||||
<img
|
||||
alt={props.alt}
|
||||
style={props.style}
|
||||
src={props.src}
|
||||
src={asset(props.src)}
|
||||
width={props.width}
|
||||
height={props.height}
|
||||
class={props.class}
|
||||
|
@ -3,36 +3,20 @@ import { Movie } from "@lib/resource/movies.ts";
|
||||
import { Series } from "@lib/resource/series.ts";
|
||||
import { isLocalImage } from "@lib/string.ts";
|
||||
|
||||
export function MovieCard({ movie }: { movie: Movie }) {
|
||||
export function MovieCard(
|
||||
{ movie, sublink = "movies" }: { sublink?: string; movie: Movie | Series },
|
||||
) {
|
||||
const { meta: { image = "/placeholder.svg" } = {} } = movie;
|
||||
|
||||
const imageUrl = isLocalImage(image)
|
||||
? `/api/images?image=${image}&width=200&height=200`
|
||||
: image;
|
||||
|
||||
console.log({ imageUrl, image });
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={movie.name}
|
||||
image={imageUrl}
|
||||
link={`/movies/${movie.id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function SeriesCard({ series }: { series: Series }) {
|
||||
const { meta: { image = "/placeholder.svg" } = {} } = series;
|
||||
|
||||
const imageUrl = image?.startsWith("Media/series/")
|
||||
? `/api/images?image=${image}&width=200&height=200`
|
||||
: image;
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={series.name}
|
||||
image={imageUrl}
|
||||
link={`/series/${series.id}`}
|
||||
link={`/${sublink}/${movie.id}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ export const MainLayout = ({ children, url, title, context }: Props) => {
|
||||
m.link === url.pathname ? "bg-white text-black" : "text-white"
|
||||
} p-3 text-xl w-full rounded-2xl`}
|
||||
>
|
||||
{m.emoji} {m.name}
|
||||
{m.emoji} {m.name}
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
|
Reference in New Issue
Block a user