fix: styling of entity and images page

This commit is contained in:
2025-07-21 16:55:51 +01:00
parent 018f0e96d4
commit 2b1eb2b948
3 changed files with 17 additions and 20 deletions

View File

@ -4,7 +4,7 @@ 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"> <A href={`/image/${props.ID}`} class="w-full h-full flex justify-center">
<img <img
class="w-full object-contain rounded-xl max-w-[700px] max-h-[400px]" class="w-full object-contain rounded-xl max-w-[700px] max-h-[400px]"
src={`${base}/image/${props.ID}`} src={`${base}/image/${props.ID}`}

View File

@ -12,22 +12,17 @@ export const Entity: Component = () => {
const entity = () => images().find((i) => i.data.ID === params.entityId); const entity = () => images().find((i) => i.data.ID === params.entityId);
return ( return (
<div> <Show when={entity()} fallback={<>Sorry, this entity could not be found</>}>
<Show {(e) => (
when={entity()} <div>
fallback={<>Sorry, this entity could not be found</>} <ItemModal item={e()} />
> <div class="w-full grid grid-cols-4 auto-rows-[minmax(100px,1fr)] gap-4 bg-white p-4 rounded-xl border border-neutral-200">
{(e) => ( <For each={e().data.Images}>
<div> {(imageId) => <ImageComponent ID={imageId} />}
<ItemModal item={e()} /> </For>
<div class="w-full grid grid-cols-4 auto-rows-[minmax(100px,1fr)] gap-4">
<For each={e().data.Images}>
{(imageId) => <ImageComponent ID={imageId} />}
</For>
</div>
</div> </div>
)} </div>
</Show> )}
</div> </Show>
); );
}; };

View File

@ -14,9 +14,11 @@ export const ImagePage: Component = () => {
Object.entries(imagesWithProperties()).find(([id]) => id === imageId)?.[1]; Object.entries(imagesWithProperties()).find(([id]) => id === imageId)?.[1];
return ( return (
<main class="flex flex-col items-center"> <main class="flex flex-col items-center gap-4">
<ImageComponent ID={imageId} /> <div class="w-full bg-white rounded-xl p-4">
<div class="w-3/4 grid grid-cols-9 gap-2 grid-flow-row-dense py-4"> <ImageComponent ID={imageId} />
</div>
<div class="w-full grid grid-cols-3 gap-2 grid-flow-row-dense p-4 bg-white rounded-xl">
<Show when={imageProperties()}> <Show when={imageProperties()}>
{(image) => ( {(image) => (
<For each={image()}> <For each={image()}>