mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
Hotfix: Add onDownloadClicked to lightbox and gallery modals.
This commit is contained in:
1 parent
a09f52330f
commit
ba5caa10c4
2 files changed
+8
-1
No files matched your search
@@ -39,6 +39,7 @@ interface GalleryModalProps {
|
||||
tabs: { id: string; label: string }[];
|
||||
activeTab: string;
|
||||
onTabChange: (tabId: string) => void;
|
||||
onDownloadClicked?: () => void;
|
||||
}
|
||||
|
||||
export const GalleryModal = React.memo(
|
||||
@@ -53,6 +54,7 @@ export const GalleryModal = React.memo(
|
||||
tabs,
|
||||
activeTab,
|
||||
onTabChange,
|
||||
onDownloadClicked,
|
||||
}: GalleryModalProps) => {
|
||||
const [groupedItems, setGroupedItems] = useState<GroupedItems>({});
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -15,6 +15,7 @@ interface LightboxModalProps {
|
||||
createdAt?: string;
|
||||
additionalInfo?: React.ReactNode;
|
||||
downloadUrl?: string;
|
||||
onDownloadClicked?: () => void;
|
||||
}
|
||||
|
||||
export function LightboxModal({
|
||||
@@ -27,6 +28,7 @@ export function LightboxModal({
|
||||
createdAt,
|
||||
additionalInfo,
|
||||
downloadUrl,
|
||||
onDownloadClicked,
|
||||
}: LightboxModalProps) {
|
||||
return createPortal(
|
||||
<Transition appear show={isOpen}>
|
||||
@@ -104,7 +106,10 @@ export function LightboxModal({
|
||||
>
|
||||
<Button
|
||||
icon={faDownToLine}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onDownloadClicked?.();
|
||||
}}
|
||||
>
|
||||
Download
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user