fix: using image component on image page

This commit is contained in:
2025-07-21 14:04:22 +01:00
parent eb0914c9ca
commit ad4967a97d
2 changed files with 4 additions and 3 deletions

View File

@ -4,9 +4,9 @@ import { A } from "@solidjs/router";
export const ImageComponent: Component<{ ID: string }> = (props) => { export const ImageComponent: Component<{ ID: string }> = (props) => {
return ( return (
<A href={`/image/${props.ID}`} class="w-full h-full max-h-[400px]"> <A href={`/image/${props.ID}`} class="w-full h-full">
<img <img
class="w-full object-contain rounded-xl max-h-full" class="w-full object-contain rounded-xl max-h-[400px]"
src={`${base}/image/${props.ID}`} src={`${base}/image/${props.ID}`}
/> />
</A> </A>

View File

@ -1,3 +1,4 @@
import { ImageComponent } from "@components/image";
import { SearchCard } from "@components/search-card/SearchCard"; import { SearchCard } from "@components/search-card/SearchCard";
import { useSearchImageContext } from "@contexts/SearchImageContext"; import { useSearchImageContext } from "@contexts/SearchImageContext";
import { base, UserImage } from "@network/index"; import { base, UserImage } from "@network/index";
@ -14,7 +15,7 @@ export const ImagePage: Component = () => {
return ( return (
<main class="flex flex-col items-center"> <main class="flex flex-col items-center">
<img class="h-1/2" alt="users" src={`${base}/image/${imageId}`} /> <ImageComponent ID={imageId} />
<div class="w-3/4 grid grid-cols-9 gap-2 grid-flow-row-dense py-4"> <div class="w-3/4 grid grid-cols-9 gap-2 grid-flow-row-dense py-4">
<Show when={imageProperties()}> <Show when={imageProperties()}>
{(image) => ( {(image) => (