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:
@@ -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/*"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user