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 AutoTextarea from '@/components/AutoTextarea';
import { Post, Attachment } from '@/lib/types';
import { ImageIcon } from 'lucide-react';
import { VideoEmbed } from '@/components/VideoEmbed';
interface ComposeProps {
@@ -185,8 +186,8 @@ export function Compose({ onPost, replyingTo, onCancelReply, placeholder = "What
{remaining}
</span>
<div className="compose-actions">
<label className="btn btn-ghost btn-sm compose-media-button">
{isUploading ? 'Uploading...' : 'Add media'}
<label className="btn btn-ghost btn-sm compose-media-button" title="Add media">
{isUploading ? '...' : <ImageIcon size={18} />}
<input
type="file"
accept="image/*"
+2 -2
View File
@@ -22,7 +22,7 @@ export function VideoEmbed({ url }: VideoEmbedProps) {
if (youtubeId) {
return (
<div className="video-embed-container">
<div className="video-embed-container" onClick={(e) => e.stopPropagation()}>
<iframe
src={`https://www.youtube.com/embed/${youtubeId}`}
title="YouTube video player"
@@ -36,7 +36,7 @@ export function VideoEmbed({ url }: VideoEmbedProps) {
if (vimeoId) {
return (
<div className="video-embed-container">
<div className="video-embed-container" onClick={(e) => e.stopPropagation()}>
<iframe
src={`https://player.vimeo.com/video/${vimeoId}`}
title="Vimeo video player"