mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
Added background color property for image widget(#2022)
This commit is contained in:
parent
1ab0e36ec9
commit
8f2ab3f269
2 changed files with 3 additions and 1 deletions
|
|
@ -3,7 +3,7 @@ import LazyLoad from 'react-lazyload';
|
|||
|
||||
export const Image = function Image({ height, properties, styles, fireEvent }) {
|
||||
const { source } = properties;
|
||||
const { visibility, disabledState, borderType } = styles;
|
||||
const { visibility, disabledState, borderType, backgroundColor } = styles;
|
||||
const widgetVisibility = visibility ?? true;
|
||||
const imageRef = useRef(null);
|
||||
const [imageOffset, setImageOffset] = useState(0);
|
||||
|
|
@ -37,6 +37,7 @@ export const Image = function Image({ height, properties, styles, fireEvent }) {
|
|||
<img
|
||||
src={source}
|
||||
className={`${borderType !== 'none' ? borderType : ''}`}
|
||||
style={{ backgroundColor }}
|
||||
height={height}
|
||||
onClick={() => fireEvent('onClick')}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -797,6 +797,7 @@ export const componentTypes = [
|
|||
{ name: 'Thumbnail', value: 'img-thumbnail' },
|
||||
],
|
||||
},
|
||||
backgroundColor: { type: 'color', displayName: 'Background color' },
|
||||
visibility: { type: 'code', displayName: 'Visibility' },
|
||||
disabledState: { type: 'code', displayName: 'Disable' },
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue