Skip to content

Commit

Permalink
feat(ui): remove delete image button in gallery
Browse files Browse the repository at this point in the history
it was really easy to accidentally click, just commented out, easy to add back or add a setting for it in the future
  • Loading branch information
psychedelicious committed Jul 6, 2023
1 parent 840c8cf commit d361a35
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ export const makeSelector = (image_name: string) =>
({ gallery }) => {
const isSelected = gallery.selection.includes(image_name);
const selectionCount = gallery.selection.length;
const galleryImageMinimumWidth = gallery.galleryImageMinimumWidth;

return {
isSelected,
selectionCount,
galleryImageMinimumWidth,
};
},
defaultSelectorOptions
Expand All @@ -46,8 +45,7 @@ const GalleryImage = (props: HoverableImageProps) => {

const localSelector = useMemo(() => makeSelector(image_name), [image_name]);

const { isSelected, selectionCount, galleryImageMinimumWidth } =
useAppSelector(localSelector);
const { isSelected, selectionCount } = useAppSelector(localSelector);

const dispatch = useAppDispatch();

Expand Down Expand Up @@ -116,13 +114,11 @@ const GalleryImage = (props: HoverableImageProps) => {
draggableData={draggableData}
isSelected={isSelected}
minSize={0}
onClickReset={
galleryImageMinimumWidth > 60 ? handleDelete : undefined
}
onClickReset={handleDelete}
resetIcon={<FaTrash />}
resetTooltip="Delete image"
imageSx={{ w: 'full', h: 'full' }}
withResetIcon
// withResetIcon // removed bc it's too easy to accidentally delete images
isDropDisabled={true}
isUploadDisabled={true}
/>
Expand Down

0 comments on commit d361a35

Please sign in to comment.