feat(ui): remove delete image button in gallery

it was really easy to accidentally click, just commented out, easy to add back or add a setting for it in the future
This commit is contained in:
psychedelicious 2023-07-06 22:34:11 +10:00
parent 984121d682
commit 94e38e9769

View File

@ -23,11 +23,10 @@ export const makeSelector = (image_name: string) =>
({ gallery }) => { ({ gallery }) => {
const isSelected = gallery.selection.includes(image_name); const isSelected = gallery.selection.includes(image_name);
const selectionCount = gallery.selection.length; const selectionCount = gallery.selection.length;
const galleryImageMinimumWidth = gallery.galleryImageMinimumWidth;
return { return {
isSelected, isSelected,
selectionCount, selectionCount,
galleryImageMinimumWidth,
}; };
}, },
defaultSelectorOptions defaultSelectorOptions
@ -46,8 +45,7 @@ const GalleryImage = (props: HoverableImageProps) => {
const localSelector = useMemo(() => makeSelector(image_name), [image_name]); const localSelector = useMemo(() => makeSelector(image_name), [image_name]);
const { isSelected, selectionCount, galleryImageMinimumWidth } = const { isSelected, selectionCount } = useAppSelector(localSelector);
useAppSelector(localSelector);
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
@ -116,13 +114,11 @@ const GalleryImage = (props: HoverableImageProps) => {
draggableData={draggableData} draggableData={draggableData}
isSelected={isSelected} isSelected={isSelected}
minSize={0} minSize={0}
onClickReset={ onClickReset={handleDelete}
galleryImageMinimumWidth > 60 ? handleDelete : undefined
}
resetIcon={<FaTrash />} resetIcon={<FaTrash />}
resetTooltip="Delete image" resetTooltip="Delete image"
imageSx={{ w: 'full', h: 'full' }} imageSx={{ w: 'full', h: 'full' }}
withResetIcon // withResetIcon // removed bc it's too easy to accidentally delete images
isDropDisabled={true} isDropDisabled={true}
isUploadDisabled={true} isUploadDisabled={true}
/> />