-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script lang="ts"> | ||
import Img from './Img.svelte'; | ||
export let tag: string[]; | ||
$: url = tag.at(1)?.split(' ').at(1) ?? ''; | ||
</script> | ||
|
||
{#if URL.canParse(url)} | ||
<Img url={new URL(url)} /> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { getTitle } from '$lib/EventHelper'; | ||
import type { EventItem, Item } from '$lib/Items'; | ||
import ActionMenu from '../actions/ActionMenu.svelte'; | ||
import Content from '../Content.svelte'; | ||
import Imeta from '../content/Imeta.svelte'; | ||
import EventMetadata from '../EventMetadata.svelte'; | ||
export let item: Item; | ||
export let readonly: boolean; | ||
export let createdAtFormat: 'auto' | 'time' = 'auto'; | ||
$: eventItem = item as EventItem; | ||
$: title = getTitle(item.event.tags); | ||
$: pictures = item.event.tags.filter(([tagName]) => tagName === 'imeta'); | ||
</script> | ||
|
||
<EventMetadata {item} {createdAtFormat}> | ||
<section slot="content"> | ||
{#if title} | ||
<h3>{title}</h3> | ||
{/if} | ||
<Content content={item.event.content} tags={item.event.tags} /> | ||
{#each pictures as picture} | ||
<Imeta tag={picture} /> | ||
{/each} | ||
{#if !readonly} | ||
<ActionMenu item={eventItem} /> | ||
{/if} | ||
</section> | ||
</EventMetadata> |