docs: Post component comments

This commit is contained in:
sevonj committed 2024-07-06 18:02:50 +03:00
1 parent 80fff16671
commit 45f73ff3dc
6 files changed
+27

No files matched your search

@@ -55,6 +55,11 @@
} }
</script> </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-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<Material <Material
@@ -14,6 +14,10 @@
$: richURL = parseURL(url) $: richURL = parseURL(url)
</script> </script>
<!--
@component
For embed-type posts. Displays embed card or a compact link.
-->
{#if embed_title && !compact} {#if embed_title && !compact}
<Material color="distinct" class="flex flex-row gap-4"> <Material color="distinct" class="flex flex-row gap-4">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
@@ -45,6 +45,10 @@
} }
</script> </script>
<!--
@component
This component will build two different things: a post's meta block and the title.
-->
<div <div
class="grid w-full meta {community class="grid w-full meta {community
? 'grid-rows-2' ? 'grid-rows-2'
@@ -92,6 +92,10 @@
$: embedUrl = urlToEmbed(url) $: embedUrl = urlToEmbed(url)
</script> </script>
<!--
@component
Displays a video file or embedded video iframe.
-->
{#if opened} {#if opened}
{#if type == 'video'} {#if type == 'video'}
<!-- svelte-ignore a11y-media-has-caption --> <!-- svelte-ignore a11y-media-has-caption -->
@@ -23,6 +23,12 @@
let showAltText = false let showAltText = false
</script> </script>
<!--
@component
This component will show either
- A media item (pictures, videos) (large form factor posts only)
- Embed link/card.
-->
{#if type == 'image'} {#if type == 'image'}
{#if view == 'card' || view == 'cozy'} {#if view == 'card' || view == 'cozy'}
<!--disabled preloads here since most people will hover over every image while scrolling--> <!--disabled preloads here since most people will hover over every image while scrolling-->
@@ -17,6 +17,10 @@
export let type: MediaType = 'none' export let type: MediaType = 'none'
</script> </script>
<!--
@component
Thumbnails for compact and list view posts.
-->
{#if view == 'compact' || (view == 'list' && type != 'none')} {#if view == 'compact' || (view == 'list' && type != 'none')}
<div <div
class="w-24 sm:w-32 h-24 relative group/media {$$props.class ?? ''}" class="w-24 sm:w-32 h-24 relative group/media {$$props.class ?? ''}"