Skip to content

Commit

Permalink
Updated cursor on hovering image widget (ToolJet#3080)
Browse files Browse the repository at this point in the history
  • Loading branch information
kavinvenkatachalam authored May 23, 2022
1 parent 4b68627 commit d6b9412
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/Editor/Components/Image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import React, { useRef, useEffect, useState } from 'react';
import LazyLoad from 'react-lazyload';
import { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch';

export const Image = function Image({ height, properties, styles, fireEvent, width }) {
export const Image = function Image({ component, height, properties, styles, fireEvent, width }) {
const { source, loadingState, alternativeText, zoomButtons } = properties;
const { visibility, disabledState, borderType, backgroundColor, padding, imageFit } = styles;
const {
definition: { events },
} = component;
const hasOnClickEvent = events.some((event) => event.eventId === 'onClick');
const widgetVisibility = visibility ?? true;
const imageRef = useRef(null);
const [imageOffset, setImageOffset] = useState(0);
Expand Down Expand Up @@ -60,6 +64,8 @@ export const Image = function Image({ height, properties, styles, fireEvent, wid
backgroundColor,
padding: Number.parseInt(padding),
objectFit: imageFit ? imageFit : 'contain',
cursor: hasOnClickEvent ? 'pointer' : 'inherit',
pointerEvents: 'auto',
}}
height={height}
onClick={() => fireEvent('onClick')}
Expand Down

0 comments on commit d6b9412

Please sign in to comment.