Add link to photo on Homepage collage
This commit is contained in:
@@ -3,17 +3,31 @@
|
||||
|
||||
export let id: string
|
||||
export let alt: string
|
||||
export let url: string = undefined
|
||||
|
||||
const sizes = {
|
||||
small: { width: 224 },
|
||||
medium: { width: 464 },
|
||||
large: { width: 864 },
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="photo-card">
|
||||
<Image
|
||||
id={id}
|
||||
sizes={{
|
||||
small: { width: 224 },
|
||||
medium: { width: 464 },
|
||||
large: { width: 864 },
|
||||
}}
|
||||
ratio={1.5}
|
||||
alt={alt}
|
||||
/>
|
||||
{#if url}
|
||||
<a href={url}>
|
||||
<Image
|
||||
id={id}
|
||||
{sizes}
|
||||
ratio={1.5}
|
||||
alt={alt}
|
||||
/>
|
||||
</a>
|
||||
{:else}
|
||||
<Image
|
||||
id={id}
|
||||
{sizes}
|
||||
ratio={1.5}
|
||||
alt={alt}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user