Skip to content

Commit 689b969

Browse files
committed
support passing aspectRatio for the image component
1 parent 03d98aa commit 689b969

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/image/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class Image extends PureBaseComponent {
4444
*/
4545
cover: PropTypes.bool,
4646
/**
47-
* the type of overly to place on top of the image
47+
* The aspect ratio for the image
48+
*/
49+
aspectRatio: PropTypes.number,
50+
/**
51+
* The type of overly to place on top of the image
4852
*/
4953
overlayType: Overlay.propTypes.type
5054
};
@@ -90,6 +94,7 @@ class Image extends PureBaseComponent {
9094
{tintColor},
9195
shouldFlipRTL && styles.rtlFlipped,
9296
cover && styles.coverImage,
97+
aspectRatio && {aspectRatio},
9398
style
9499
]}
95100
{...others}

0 commit comments

Comments
 (0)