Fixed lightbox modal.

This commit is contained in:
Michael Chung committed 2025-05-19 02:16:52 -04:00
1 parent 8fd75a1cac
commit 37c01bc0a1
1 file changed
+14 -38
@@ -26,7 +26,6 @@ interface LightboxModalProps {
url: string,
media_id: string | undefined
) => Promise<void>;
activeTab?: string;
}
export function LightboxModal({
@@ -43,7 +42,6 @@ export function LightboxModal({
mediaId, // media id of the image
onDownloadClicked,
onAddToSceneClicked,
activeTab,
}: LightboxModalProps) {
return createPortal(
<Transition appear show={isOpen}>
@@ -94,11 +92,6 @@ export function LightboxModal({
<div className="flex h-full w-full items-center justify-center bg-gray-800">
<span className="text-white/60">Image not available</span>
</div>
) : activeTab === "videos" ? (
<video controls className="h-full w-full object-contain">
<source src={imageUrl} type="video/mp4" />
Your browser does not support the video tag.
</video>
) : (
<img
src={imageUrl}
@@ -113,7 +106,7 @@ export function LightboxModal({
<div className="flex h-full flex-col py-5 pe-5">
<div className="flex-1 space-y-4">
<div className="text-xl font-medium">
{title || (activeTab === "videos" ? "Video" : "Image")}
{title || "Image Generation"}
</div>
{createdAt && (
<div className="text-sm text-white/60">
@@ -127,23 +120,6 @@ export function LightboxModal({
{/* buttons with spacing */}
{(onAddToSceneClicked && downloadUrl) || downloadUrl ? (
<div className="mt-15 mb-15 flex justify-end gap-2">
<Button
onClick={async (e) => {
if (onAddToSceneClicked) {
onAddToSceneClicked(downloadUrl, mediaId);
}
// let _result = await FalKlingImageToVideo({
// image_media_token: mediaId,
// //base64_image: downloadUrl,
// });
//e.stopPropagation();
//await onAddToSceneClicked(downloadUrl, mediaId);
//onClose(); // close the lightbox
//onCloseGallery(); // close the gallery
}}
>
Video
</Button>
<Button
onClick={async (e) => {
let _result = await FalHunyuanImageTo3d({
@@ -158,20 +134,20 @@ export function LightboxModal({
>
3D
</Button>
{onAddToSceneClicked && downloadUrl && (
<Button
onClick={async (e) => {
e.stopPropagation();
await onAddToSceneClicked(downloadUrl, mediaId);
onClose(); // close the lightbox
onCloseGallery(); // close the gallery
}}
>
Add to Current Scene
</Button>
)}
</>
{onAddToSceneClicked && downloadUrl && (
<Button
onClick={async (e) => {
e.stopPropagation();
await onAddToSceneClicked(downloadUrl, mediaId);
onClose(); // close the lightbox
onCloseGallery(); // close the gallery
}}
>
Add to Current Scene
</Button>
)}
{downloadUrl &&
(onDownloadClicked ? (
<Button