mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Require acknowledgement to send to verified users who have unsigned devices or have changed their identity. (#3215)
* Refactor HeroImage style. * Add a screen to resolve (crypto-related) timeline item send failures. * Refactor send failures. * Update the SDK.
This commit is contained in:
@@ -14,33 +14,36 @@ import SwiftUI
|
||||
struct HeroImage: View {
|
||||
enum Style {
|
||||
case normal
|
||||
case positive
|
||||
case subtle
|
||||
case success
|
||||
case critical
|
||||
case criticalOnSecondary
|
||||
|
||||
var foregroundColor: Color {
|
||||
switch self {
|
||||
case .normal:
|
||||
return .compound.iconPrimary
|
||||
case .positive:
|
||||
return .compound.iconSuccessPrimary
|
||||
.compound.iconPrimary
|
||||
case .subtle:
|
||||
return .compound.iconSecondary
|
||||
case .critical:
|
||||
return .compound.iconCriticalPrimary
|
||||
.compound.iconSecondary
|
||||
case .success:
|
||||
.compound.iconSuccessPrimary
|
||||
case .critical, .criticalOnSecondary:
|
||||
.compound.iconCriticalPrimary
|
||||
}
|
||||
}
|
||||
|
||||
var backgroundFillColor: Color {
|
||||
switch self {
|
||||
case .normal:
|
||||
return .compound.bgSubtleSecondary
|
||||
case .positive:
|
||||
return .compound.bgSuccessSubtle
|
||||
.compound.bgSubtleSecondary
|
||||
case .subtle:
|
||||
return .compound.bgSubtlePrimary
|
||||
.compound.bgSubtlePrimary
|
||||
case .success:
|
||||
.compound.bgSuccessSubtle
|
||||
case .critical:
|
||||
return .compound.bgCanvasDefault
|
||||
.compound.bgCriticalSubtle
|
||||
case .criticalOnSecondary:
|
||||
.compound.bgCanvasDefault
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,12 +89,21 @@ private struct HeroImageModifier: ViewModifier {
|
||||
|
||||
struct HeroImage_Previews: PreviewProvider, TestablePreview {
|
||||
static var previews: some View {
|
||||
HStack(spacing: 20) {
|
||||
HeroImage(icon: \.lockSolid)
|
||||
Image(systemName: "hourglass")
|
||||
.heroImage()
|
||||
Image(asset: Asset.Images.serverSelectionIcon)
|
||||
.heroImage(insets: 19)
|
||||
VStack(spacing: 20) {
|
||||
HStack(spacing: 20) {
|
||||
HeroImage(icon: \.lockSolid)
|
||||
Image(systemName: "hourglass")
|
||||
.heroImage()
|
||||
Image(asset: Asset.Images.serverSelectionIcon)
|
||||
.heroImage(insets: 19)
|
||||
}
|
||||
|
||||
HStack(spacing: 20) {
|
||||
HeroImage(icon: \.helpSolid, style: .subtle)
|
||||
HeroImage(icon: \.checkCircleSolid, style: .success)
|
||||
HeroImage(icon: \.error, style: .critical)
|
||||
HeroImage(icon: \.error, style: .criticalOnSecondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user