Skip to content

Commit

Permalink
feat: add image loading indicator styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mdneyazahmad committed Mar 30, 2022
1 parent cc3c5b5 commit 773b93f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/components/ImageView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ class ImageView extends PureComponent {
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
{this.state.isLoading && <FullscreenLoadingIndicator />}
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down Expand Up @@ -294,7 +298,11 @@ class ImageView extends PureComponent {
/>
</Pressable>

{this.state.isLoading && <FullscreenLoadingIndicator />}
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down
10 changes: 8 additions & 2 deletions src/components/ImageView/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ class ImageView extends PureComponent {
style={StyleUtils.getWidthAndHeightStyle(this.state.thumbnailWidth, this.state.thumbnailHeight)}
resizeMode="contain"
/>
<FullscreenLoadingIndicator />
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
</View>
);
}
Expand Down Expand Up @@ -212,7 +214,11 @@ class ImageView extends PureComponent {
]}
/>
</ImageZoom>
{this.state.isLoading && <FullscreenLoadingIndicator />}
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/ImageWithSizeCalculation.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ class ImageWithSizeCalculation extends PureComponent {
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
{this.state.isLoading && <FullscreenLoadingIndicator />}
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ const styles = {
backgroundColor: 'transparent',
},

opacity1: {
opacity: 1,
},

textDanger: {
color: colors.red,
},
Expand Down

0 comments on commit 773b93f

Please sign in to comment.