Skip to content

Commit

Permalink
Merge pull request #26452 from shubham1206agra/fix-26092
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam authored Sep 12, 2023
2 parents 52c54f4 + 88d1dd8 commit 1923d2e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/components/Image/imagePropTypes.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import PropTypes from 'prop-types';
import stylePropTypes from '../../styles/stylePropTypes';
import sourcePropTypes from './sourcePropTypes';
import RESIZE_MODES from './resizeModes';

const imagePropTypes = {
/** Styles for the Image */
style: stylePropTypes,

/** The static asset or URI source of the image */
source: PropTypes.oneOfType([
PropTypes.number,
PropTypes.shape({
uri: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
// eslint-disable-next-line react/forbid-prop-types
headers: PropTypes.object,
}),
]).isRequired,
source: sourcePropTypes.isRequired,

/** Should an auth token be included in the image request */
isAuthTokenRequired: PropTypes.bool,
Expand Down
11 changes: 11 additions & 0 deletions src/components/Image/sourcePropTypes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import PropTypes from 'prop-types';

export default PropTypes.oneOfType([
PropTypes.number,
PropTypes.shape({
uri: PropTypes.string.isRequired,
// eslint-disable-next-line react/forbid-prop-types
headers: PropTypes.object,
}),
PropTypes.string,
]);
10 changes: 10 additions & 0 deletions src/components/Image/sourcePropTypes/index.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import PropTypes from 'prop-types';

export default PropTypes.oneOfType([
PropTypes.number,
PropTypes.shape({
uri: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
// eslint-disable-next-line react/forbid-prop-types
headers: PropTypes.object,
}),
]);
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/ReportActionItemImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const propTypes = {
images: PropTypes.arrayOf(
PropTypes.shape({
thumbnail: PropTypes.string,
image: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
image: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
}),
).isRequired,

Expand Down

0 comments on commit 1923d2e

Please sign in to comment.