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

Commit

Permalink
Address PR comments. Add opticID biometry type. Maintain error space.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHeaps committed Nov 10, 2023
1 parent 564d150 commit 38253b6
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions Sources/BraveWallet/Crypto/UnlockWalletView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ struct UnlockWalletView: View {
return Image(systemName: "faceid")
case .touchID:
return Image(systemName: "touchid")
#if swift(>=5.9)
case .opticID:
return Image(systemName: "opticid")
#endif
case .none:
return nil
@unknown default:
Expand Down Expand Up @@ -192,24 +196,23 @@ private struct WalletUnlockStyleModifier<Failure: LocalizedError & Equatable>: V
.fill(Color(braveSystemName: .containerBackground))
)
)
if let error = error {
HStack(alignment: .firstTextBaseline, spacing: 4) {
Image(braveSystemName: "leo.warning.triangle-outline")
Text(error.localizedDescription)
.fixedSize(horizontal: false, vertical: true)
.animation(nil, value: error.localizedDescription) // Dont animate the text change, just alpha
}
.frame(maxWidth: .infinity, alignment: .leading)
.transition(
.asymmetric(
insertion: .opacity.animation(.default),
removal: .identity
)
)
.font(.footnote)
.foregroundColor(Color(.braveErrorLabel))
.padding(.leading, 8)
HStack(alignment: .firstTextBaseline, spacing: 4) {
Image(braveSystemName: "leo.warning.triangle-outline")
Text(error?.localizedDescription ?? " ") // maintain space when not showing an error, `hidden()` below
.fixedSize(horizontal: false, vertical: true)
.animation(nil, value: error?.localizedDescription) // Dont animate the text change, just alpha
}
.frame(maxWidth: .infinity, alignment: .leading)
.transition(
.asymmetric(
insertion: .opacity.animation(.default),
removal: .identity
)
)
.font(.footnote)
.foregroundColor(Color(.braveErrorLabel))
.padding(.leading, 8)
.hidden(isHidden: error == nil)
}
}
}

0 comments on commit 38253b6

Please sign in to comment.