feat: Add click event stop propagation to video embed containers and replace the "Add media" button text with an icon in the compose component.

This commit is contained in:
Christopher
2026-01-22 18:53:02 -08:00
parent 590bd8647e
commit 3f097268bf
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import AutoTextarea from '@/components/AutoTextarea'; import AutoTextarea from '@/components/AutoTextarea';
import { Post, Attachment } from '@/lib/types'; import { Post, Attachment } from '@/lib/types';
import { ImageIcon } from 'lucide-react';
import { VideoEmbed } from '@/components/VideoEmbed'; import { VideoEmbed } from '@/components/VideoEmbed';
interface ComposeProps { interface ComposeProps {
@@ -185,8 +186,8 @@ export function Compose({ onPost, replyingTo, onCancelReply, placeholder = "What
{remaining} {remaining}
</span> </span>
<div className="compose-actions"> <div className="compose-actions">
<label className="btn btn-ghost btn-sm compose-media-button"> <label className="btn btn-ghost btn-sm compose-media-button" title="Add media">
{isUploading ? 'Uploading...' : 'Add media'} {isUploading ? '...' : <ImageIcon size={18} />}
<input <input
type="file" type="file"
accept="image/*" accept="image/*"
+2 -2
View File
@@ -22,7 +22,7 @@ export function VideoEmbed({ url }: VideoEmbedProps) {
if (youtubeId) { if (youtubeId) {
return ( return (
<div className="video-embed-container"> <div className="video-embed-container" onClick={(e) => e.stopPropagation()}>
<iframe <iframe
src={`https://www.youtube.com/embed/${youtubeId}`} src={`https://www.youtube.com/embed/${youtubeId}`}
title="YouTube video player" title="YouTube video player"
@@ -36,7 +36,7 @@ export function VideoEmbed({ url }: VideoEmbedProps) {
if (vimeoId) { if (vimeoId) {
return ( return (
<div className="video-embed-container"> <div className="video-embed-container" onClick={(e) => e.stopPropagation()}>
<iframe <iframe
src={`https://player.vimeo.com/video/${vimeoId}`} src={`https://player.vimeo.com/video/${vimeoId}`}
title="Vimeo video player" title="Vimeo video player"