Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/ImageWithLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function ImageWithLoading({
resizeMode,
onLoad,
onLayout,
style,
...rest
}: ImageWithSizeLoadingProps) {
const styles = useThemeStyles();
Expand Down Expand Up @@ -85,7 +86,7 @@ function ImageWithLoading({
<Image
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
style={[styles.w100, styles.h100]}
style={[styles.w100, styles.h100, style]}
onLoadStart={() => {
if (isLoadedRef.current ?? isLoading) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReceiptImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function ReceiptImage({
lastUpdateWidthTimestampRef.current = e.timeStamp;
}}
source={typeof source === 'string' ? {uri: source} : source}
style={[style ?? [styles.w100, styles.h100], styles.overflowHidden]}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing a style being passed, ? Some component could be passing this as a param for custom style? @nabi-ebrahimi Have we checked this usages?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And Receipt image is not just being used in a single place of RHP

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abdulrahuman5196, if you check carefully, this style was being ignored in the child component. It wasn’t applied at all, so I removed it.

{...rest}
style={[styles.w100, styles.h100]}

And i checked no parent component have passed the style prop to Receipt image component for cases we return ImageWithLoading.

So my changes are safe.

style={styles.flex1}
isAuthTokenRequired={!!isAuthTokenRequired}
loadingIconSize={loadingIconSize}
loadingIndicatorStyles={loadingIndicatorStyles}
Expand Down
1 change: 1 addition & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5396,6 +5396,7 @@ const staticStyles = (theme: ThemeColors) =>
flexibleHeight: {
height: 'auto',
minHeight: 200,
flex: 1,
},

receiptCellLoadingContainer: {
Expand Down
Loading