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

Commit

Permalink
No Bug: Fix for console warning about leo.nft symbol size (#8537)
Browse files Browse the repository at this point in the history
Fix for console warning about leo.nft size.
  • Loading branch information
StephenHeaps committed Dec 8, 2023
1 parent f766540 commit 173c22c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/BraveWallet/Crypto/NFTImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ struct NFTImageView<Placeholder: View>: View {
struct LoadingNFTView: View {
var shimmer: Bool = true
@State var viewSize: CGSize = .zero

private var fontSizeForNFTImage: CGFloat {
guard viewSize.width > 0 else { return 12 }
return floor(viewSize.width / 3)
}

var body: some View {
Color(braveSystemName: .containerHighlight)
.cornerRadius(4)
Expand All @@ -75,7 +81,7 @@ struct LoadingNFTView: View {
.overlay {
Image(braveSystemName: "leo.nft")
.foregroundColor(Color(braveSystemName: .containerBackground))
.font(.system(size: floor(viewSize.width / 3)))
.font(.system(size: fontSizeForNFTImage))
.aspectRatio(contentMode: .fit)
}
.background(
Expand Down

0 comments on commit 173c22c

Please sign in to comment.