Skip to content

Commit

Permalink
fix missing onclick handler
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbuks committed Feb 2, 2024
1 parent 94eda72 commit 685be86
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
>
<i className='icon icon-download-outline'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class FilenameOverlay extends React.PureComponent<Props> {
compactDisplay,
fileInfo,
handleImageClick,
handleKdriveSave,
handleKDriveSave,
iconClass,
} = this.props;

Expand Down Expand Up @@ -116,7 +116,7 @@ export default class FilenameOverlay extends React.PureComponent<Props> {
>
<span className='file-kdrive__icon--wrapper'>
<KDriveIcon
onClick={() => handleKdriveSave(fileInfo.id, fileName)}
onClick={() => handleKDriveSave?.(fileInfo.id, fileName)}
className='icon file-kdrive__icon'
/>
</span>
Expand Down
64 changes: 33 additions & 31 deletions webapp/channels/src/components/widgets/icons/kdrive_icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,40 @@

import React from 'react';

const KDriveIcon = (props: React.HTMLAttributes<HTMLSpanElement>) => (
<svg
className='file-kdrive__icon--svg'
width={20}
height={20}
viewBox='0 0 80 80'
style={props.style}
>
<g
fill='none'
fillRule='evenodd'
const KDriveIcon = ({style, ...rest}: React.HTMLAttributes<HTMLSpanElement>) => (
<span {...rest}>
<svg
className='file-kdrive__icon--svg'
width={20}
height={20}
viewBox='0 0 80 80'
style={style}
>
<path
d='M37.51 17.828l3.853 1.61c.59.247 1.045.735 1.252 1.34l1.532 4.477c.247.721.844 1.267 1.584 1.448l16.032 3.921a2.235 2.235 0 011.704 2.17v18.707a2.235 2.235 0 01-2.893 2.136L35.99 46.073a2.235 2.235 0 01-1.577-2.136V19.89a2.235 2.235 0 013.097-2.062z'
fill='#A2BFFF'
opacity={0.504}
/>
<path
d='M31.922 22.298l3.854 1.61c.59.247 1.045.734 1.252 1.34l1.532 4.477c.247.721.844 1.267 1.584 1.448l16.031 3.92a2.235 2.235 0 011.704 2.172V55.97a2.235 2.235 0 01-2.892 2.136l-24.584-7.564a2.235 2.235 0 01-1.578-2.137V24.36a2.235 2.235 0 013.097-2.062z'
fill='#A0BDFF'
opacity={0.8}
/>
<path
d='M26.335 26.097l3.853 1.611c.59.247 1.046.734 1.253 1.339l1.532 4.478c.246.72.843 1.266 1.583 1.447l16.032 3.921a2.235 2.235 0 011.704 2.171V59.77a2.235 2.235 0 01-2.892 2.136l-24.584-7.564a2.235 2.235 0 01-1.578-2.136V28.159a2.235 2.235 0 013.097-2.062z'
fill='#1A47FF'
/>
<path
d='M20.667 36.008l24.831 6.897c.75.209 1.337.792 1.55 1.54l4.678 16.37a1.117 1.117 0 01-1.403 1.375l-26.01-8.003a2.235 2.235 0 01-1.45-1.392l-4.902-13.89a2.235 2.235 0 012.706-2.897z'
fill='#5287FF'
/>
</g>
</svg>
<g
fill='none'
fillRule='evenodd'
>
<path
d='M37.51 17.828l3.853 1.61c.59.247 1.045.735 1.252 1.34l1.532 4.477c.247.721.844 1.267 1.584 1.448l16.032 3.921a2.235 2.235 0 011.704 2.17v18.707a2.235 2.235 0 01-2.893 2.136L35.99 46.073a2.235 2.235 0 01-1.577-2.136V19.89a2.235 2.235 0 013.097-2.062z'
fill='#A2BFFF'
opacity={0.504}
/>
<path
d='M31.922 22.298l3.854 1.61c.59.247 1.045.734 1.252 1.34l1.532 4.477c.247.721.844 1.267 1.584 1.448l16.031 3.92a2.235 2.235 0 011.704 2.172V55.97a2.235 2.235 0 01-2.892 2.136l-24.584-7.564a2.235 2.235 0 01-1.578-2.137V24.36a2.235 2.235 0 013.097-2.062z'
fill='#A0BDFF'
opacity={0.8}
/>
<path
d='M26.335 26.097l3.853 1.611c.59.247 1.046.734 1.253 1.339l1.532 4.478c.246.72.843 1.266 1.583 1.447l16.032 3.921a2.235 2.235 0 011.704 2.171V59.77a2.235 2.235 0 01-2.892 2.136l-24.584-7.564a2.235 2.235 0 01-1.578-2.136V28.159a2.235 2.235 0 013.097-2.062z'
fill='#1A47FF'
/>
<path
d='M20.667 36.008l24.831 6.897c.75.209 1.337.792 1.55 1.54l4.678 16.37a1.117 1.117 0 01-1.403 1.375l-26.01-8.003a2.235 2.235 0 01-1.45-1.392l-4.902-13.89a2.235 2.235 0 012.706-2.897z'
fill='#5287FF'
/>
</g>
</svg>
</span>
);

export default KDriveIcon;
Expand Down

0 comments on commit 685be86

Please sign in to comment.