From 6b7b8004ad7647029181a6fa1c5f1eff0441dd0a Mon Sep 17 00:00:00 2001 From: StephenHeaps <5314553+StephenHeaps@users.noreply.github.com> Date: Fri, 8 Dec 2023 10:45:59 -0500 Subject: [PATCH] No Bug: Fix for console warning about `leo.nft` symbol size (brave/brave-ios#8537) Fix for console warning about leo.nft size. --- Sources/BraveWallet/Crypto/NFTImageView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/BraveWallet/Crypto/NFTImageView.swift b/Sources/BraveWallet/Crypto/NFTImageView.swift index de36b8215fce..30fd85304f77 100644 --- a/Sources/BraveWallet/Crypto/NFTImageView.swift +++ b/Sources/BraveWallet/Crypto/NFTImageView.swift @@ -67,6 +67,12 @@ struct NFTImageView: 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) @@ -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(