From 685be866585fd30b128a20d02c5841444f8fa68c Mon Sep 17 00:00:00 2001 From: "anton.buksa" Date: Fri, 2 Feb 2024 17:01:32 +0100 Subject: [PATCH] fix missing onclick handler --- .../file_attachment/file_attachment.tsx | 2 +- .../file_attachment/filename_overlay.tsx | 6 +- .../components/widgets/icons/kdrive_icon.tsx | 64 ++++++++++--------- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/webapp/channels/src/components/file_attachment/file_attachment.tsx b/webapp/channels/src/components/file_attachment/file_attachment.tsx index 74e4d03dd6..a147c53325 100644 --- a/webapp/channels/src/components/file_attachment/file_attachment.tsx +++ b/webapp/channels/src/components/file_attachment/file_attachment.tsx @@ -341,7 +341,7 @@ export default function FileAttachment(props: Props) { compactDisplay={compactDisplay} canDownload={props.canDownloadFiles} handleImageClick={onAttachmentClick} - handleKdriveSave={props.actions.saveFileToKDrive} + handleKDriveSave={props.actions.saveFileToKDrive} iconClass={'post-image__download'} > diff --git a/webapp/channels/src/components/file_attachment/filename_overlay.tsx b/webapp/channels/src/components/file_attachment/filename_overlay.tsx index 8dc1ee34b9..9b5ad1c4bf 100644 --- a/webapp/channels/src/components/file_attachment/filename_overlay.tsx +++ b/webapp/channels/src/components/file_attachment/filename_overlay.tsx @@ -33,7 +33,7 @@ type Props = { /* * Handler for saving image to kdrive. */ - handleKdriveSave?: (fileId: string, fileName: string) => void; + handleKDriveSave?: (fileId: string, fileName: string) => void; /* * Display in compact format @@ -64,7 +64,7 @@ export default class FilenameOverlay extends React.PureComponent { compactDisplay, fileInfo, handleImageClick, - handleKdriveSave, + handleKDriveSave, iconClass, } = this.props; @@ -116,7 +116,7 @@ export default class FilenameOverlay extends React.PureComponent { > handleKdriveSave(fileInfo.id, fileName)} + onClick={() => handleKDriveSave?.(fileInfo.id, fileName)} className='icon file-kdrive__icon' /> diff --git a/webapp/channels/src/components/widgets/icons/kdrive_icon.tsx b/webapp/channels/src/components/widgets/icons/kdrive_icon.tsx index 899a597c11..97317f48d4 100644 --- a/webapp/channels/src/components/widgets/icons/kdrive_icon.tsx +++ b/webapp/channels/src/components/widgets/icons/kdrive_icon.tsx @@ -3,38 +3,40 @@ import React from 'react'; -const KDriveIcon = (props: React.HTMLAttributes) => ( - - ) => ( + + - - - - - - + + + + + + + + ); export default KDriveIcon;