mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Updated cursor on hovering image widget (#3080)
This commit is contained in:
parent
4b68627431
commit
d6b941227e
1 changed files with 7 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
@ -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')}
|
||||
|
|
|
|||
Loading…
Reference in a new issue