Merge pull request #354 from sevonj/post-component-doc
docs: Post component comments
This commit is contained in:
6 files changed
+27
No files matched your search
@@ -55,6 +55,11 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
This is the sole component for displaying posts.
|
||||
It adapts to all kinds of form factors for different contexts, such as feeds, full post view, and crosspost list.
|
||||
-->
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<Material
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
$: richURL = parseURL(url)
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
For embed-type posts. Displays embed card or a compact link.
|
||||
-->
|
||||
{#if embed_title && !compact}
|
||||
<Material color="distinct" class="flex flex-row gap-4">
|
||||
<div class="flex flex-col gap-2">
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
This component will build two different things: a post's meta block and the title.
|
||||
-->
|
||||
<div
|
||||
class="grid w-full meta {community
|
||||
? 'grid-rows-2'
|
||||
|
||||
@@ -92,6 +92,10 @@
|
||||
$: embedUrl = urlToEmbed(url)
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
Displays a video file or embedded video iframe.
|
||||
-->
|
||||
{#if opened}
|
||||
{#if type == 'video'}
|
||||
<!-- svelte-ignore a11y-media-has-caption -->
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
let showAltText = false
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
This component will show either
|
||||
- A media item (pictures, videos) (large form factor posts only)
|
||||
- Embed link/card.
|
||||
-->
|
||||
{#if type == 'image'}
|
||||
{#if view == 'card' || view == 'cozy'}
|
||||
<!--disabled preloads here since most people will hover over every image while scrolling-->
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
export let type: MediaType = 'none'
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@component
|
||||
Thumbnails for compact and list view posts.
|
||||
-->
|
||||
{#if view == 'compact' || (view == 'list' && type != 'none')}
|
||||
<div
|
||||
class="w-24 sm:w-32 h-24 relative group/media {$$props.class ?? ''}"
|
||||
|
||||
Reference in new issue
Block a user