Skip to content

Commit 397c63e

Browse files
committed
Merge pull request #110 from yamanoku/add-details-img-alt-text
feat: expand alt text within details element
2 parents f985afe + 098b01e commit 397c63e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/components/Post.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,20 @@ function PostContent({ post }: PostContentProps) {
213213
/>
214214
)}
215215
{post.poll != null && <Poll poll={post.poll} />}
216-
{post.media.length > 0 && (
216+
{post.media.map((medium) => (
217217
<div>
218-
{post.media.map((medium) => (
219-
<Medium medium={medium} />
220-
))}
218+
<Medium medium={medium} />
219+
{medium.description && medium.description.trim() !== "" && (
220+
<>
221+
<hr />
222+
<details>
223+
<summary>ALT text details</summary>
224+
{medium.description}
225+
</details>
226+
</>
227+
)}
221228
</div>
222-
)}
229+
))}
223230
{post.quoteTarget != null && (
224231
<Post
225232
post={{ ...post.quoteTarget, sharing: null, quoteTarget: null }}

0 commit comments

Comments
 (0)