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

No Bug: Fix for console warning about leo.nft symbol size #8537

Merged
merged 1 commit into from
Dec 8, 2023
Merged
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
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