Skip to content

Commit

Permalink
Allow styling of the image component
Browse files Browse the repository at this point in the history
  • Loading branch information
datobs committed Apr 25, 2022
1 parent 2e30cc9 commit 0a48734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Magnifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Magnifier = forwardRef((props, ref) => {
dragToMove,
className,
style,
imageStyle,
mouseActivation,
touchActivation,
interactionSettings,
Expand Down Expand Up @@ -53,6 +54,7 @@ const Magnifier = forwardRef((props, ref) => {
renderOverlay={renderOverlay}
cursorStyle={cursorStyle}
cursorStyleActive={finalActiveCursorStyle}
imageStyle={imageStyle}
onImageLoad={onImageLoad}
onLargeImageLoad={onLargeImageLoad}
onImageError={onImageError}
Expand All @@ -79,6 +81,7 @@ Magnifier.propTypes = {
dragToMove: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object,
imageStyle: PropTypes.object,
mouseActivation: PropTypes.string,
touchActivation: PropTypes.string,
interactionSettings: PropTypes.shape({
Expand Down
4 changes: 3 additions & 1 deletion src/MagnifierRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const MagnifierRenderer = forwardRef((props, ref) => {
renderOverlay,
cursorStyle,
cursorStyleActive,
imageStyle,
onImageLoad,
onLargeImageLoad,
onLoadRefresh
Expand All @@ -34,7 +35,8 @@ const MagnifierRenderer = forwardRef((props, ref) => {
style={{
display: "block",
visibility: isActive ? "hidden" : "visible",
width: "100%"
width: "100%",
...imageStyle,
}}
src={imageSrc}
alt={imageAlt}
Expand Down

0 comments on commit 0a48734

Please sign in to comment.