Skip to content

Commit

Permalink
fix: disable drag-and-drop when disabled and add missing condition fo…
Browse files Browse the repository at this point in the history
…r download link
  • Loading branch information
musama619 committed Jun 9, 2024
1 parent 2308512 commit e44c94f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/ImageSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const ImageSlider = () => {
<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z" />
</svg>
</button>
{file.fileSrc && (
{file.fileSrc && componentState.downloadFile && (
<a
href={file.fileSrc}
target="_blank"
Expand Down
6 changes: 3 additions & 3 deletions src/components/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ export const Main: React.FC<Props> = ({
className={`${height && `overflow-auto ${height}`} ${fileData.length == 0 &&
`border-2 border-dashed border-gray-300 ${disabled ? "" : `hover:bg-stone-200`} `
} flex flex-row flex-wrap gap-4 p-6 bg-stone-100 shadow dark:bg-gray-800 `}
onDragOver={handleDragOver}
onDragLeave={handleDragLeave}
onDrop={handleDrop}
onDragOver={disabled ? undefined : handleDragOver}
onDragLeave={disabled ? undefined : handleDragLeave}
onDrop={disabled ? undefined : handleDrop}
data-testid="dropzone"
>
{fileData.length > 0 ? (
Expand Down

0 comments on commit e44c94f

Please sign in to comment.