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