Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8518: NFT grid placeholder height is not the same with other gri…
Browse files Browse the repository at this point in the history
…ds height (#8524)
  • Loading branch information
nuo-xu committed Dec 7, 2023
1 parent 819f42e commit abd203e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/BraveWallet/Crypto/NFT/NFTView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ struct SkeletonLoadingNFTView: View {

var body: some View {
LazyVGrid(columns: nftGrids) {
ForEach(0..<6) { _ in
ForEach(0..<8) { _ in
VStack(alignment: .leading, spacing: 6) {
LoadingNFTView()
.frame(height: 176)
Expand Down
4 changes: 2 additions & 2 deletions Sources/BraveWallet/Crypto/NFTImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct NFTImageView<Placeholder: View>: View {
WebImage(url: url)
.resizable()
.placeholder { placeholder() }
.indicator(.activity)
.aspectRatio(contentMode: .fit)
} else {
WebImageReader(url: url) { image in
Expand Down Expand Up @@ -77,14 +76,15 @@ struct LoadingNFTView: View {
Image(braveSystemName: "leo.nft")
.foregroundColor(Color(braveSystemName: .containerBackground))
.font(.system(size: floor(viewSize.width / 3)))
.aspectRatio(contentMode: .fit)
}
.background(
GeometryReader { geometryProxy in
Color.clear
.preference(key: SizePreferenceKey.self, value: geometryProxy.size)
}
)
.frame(minHeight: viewSize.width, maxHeight: 172)
.frame(height: viewSize.width)
.onPreferenceChange(SizePreferenceKey.self) { newSize in
viewSize = newSize
}
Expand Down

0 comments on commit abd203e

Please sign in to comment.