This commit is contained in:
Shusui MOYATANI
2023-03-22 12:45:32 +09:00
parent 4e165bc879
commit 3348bba012
8 changed files with 109 additions and 74 deletions

View File

@@ -1,5 +1,6 @@
import { Component, createEffect, createSignal, Show } from 'solid-js';
import { fixUrl } from '@/utils/imageUrl';
import SafeLink from '../utils/SafeLink';
type ImageDisplayProps = {
url: string;
@@ -21,13 +22,13 @@ const ImageDisplay: Component<ImageDisplayProps> = (props) => {
</button>
}
>
<a class="my-2 block" href={props.url} target="_blank" rel="noopener noreferrer">
<SafeLink class="my-2 block" href={props.url}>
<img
class="inline-block max-h-64 max-w-full rounded object-contain shadow hover:shadow-md"
src={fixUrl(new URL(props.url)).toString()}
src={fixUrl(props.url)}
alt={props.url}
/>
</a>
</SafeLink>
</Show>
);
};