Merge pull request #206 from LukasKorba/205_validation_result_dark
Validation Failure/Success updated to handle dark mode
This commit is contained in:
commit
5625ce0908
|
@ -23,9 +23,9 @@
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.173",
|
"blue" : "251",
|
||||||
"green" : "0.047",
|
"green" : "245",
|
||||||
"red" : "0.780"
|
"red" : "238"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"idiom" : "universal"
|
"idiom" : "universal"
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0xF5",
|
"blue" : "0x5A",
|
||||||
"green" : "0xFA",
|
"green" : "0x37",
|
||||||
"red" : "0xE4"
|
"red" : "0x29"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"idiom" : "universal"
|
"idiom" : "universal"
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0xF6",
|
"blue" : "97",
|
||||||
"green" : "0xF6",
|
"green" : "172",
|
||||||
"red" : "0xEF"
|
"red" : "42"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"idiom" : "universal"
|
"idiom" : "universal"
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.694",
|
"blue" : "0x5A",
|
||||||
"green" : "0.694",
|
"green" : "0x37",
|
||||||
"red" : "0.961"
|
"red" : "0x29"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"idiom" : "universal"
|
"idiom" : "universal"
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.890",
|
"blue" : "46",
|
||||||
"green" : "0.906",
|
"green" : "42",
|
||||||
"red" : "0.976"
|
"red" : "167"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"idiom" : "universal"
|
"idiom" : "universal"
|
||||||
|
|
|
@ -76,7 +76,6 @@ struct ValidationFailedView: View {
|
||||||
.navigationBarHidden(true)
|
.navigationBarHidden(true)
|
||||||
.applyErredScreenBackground()
|
.applyErredScreenBackground()
|
||||||
}
|
}
|
||||||
.preferredColorScheme(.light)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,6 @@ struct ValidationSucceededView: View {
|
||||||
}
|
}
|
||||||
.navigationBarHidden(true)
|
.navigationBarHidden(true)
|
||||||
.applySucceededScreenBackground()
|
.applySucceededScreenBackground()
|
||||||
.preferredColorScheme(.light)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
"validationFailed.title" = "Ouch, sorry, no.";
|
"validationFailed.title" = "Ouch, sorry, no.";
|
||||||
"validationFailed.description" = "Your placed words did not match your secret recovery phrase.";
|
"validationFailed.description" = "Your placed words did not match your secret recovery phrase.";
|
||||||
"validationFailed.incorrectBackupDescription" = "Remember, you can't recover your funds if you lose (or incorrectly save) these 24 words.";
|
"validationFailed.incorrectBackupDescription" = "Remember, you can't recover your funds if you lose (or incorrectly save) these 24 words.";
|
||||||
"validationFailed.button.tryAgain" = "I'm ready to try again";
|
"validationFailed.button.tryAgain" = "Try again";
|
||||||
|
|
||||||
// MARK: - Recovery Phrase Test Preamble
|
// MARK: - Recovery Phrase Test Preamble
|
||||||
"recoveryPhraseTestPreamble.title" = "First things first";
|
"recoveryPhraseTestPreamble.title" = "First things first";
|
||||||
|
|
|
@ -10,13 +10,16 @@ import SwiftUI
|
||||||
/// A Vertical LinearGradient that takes an array of Colors and renders them vertically
|
/// A Vertical LinearGradient that takes an array of Colors and renders them vertically
|
||||||
/// in a centered fashion mostly used as a background for Screen views..
|
/// in a centered fashion mostly used as a background for Screen views..
|
||||||
struct ScreenBackground: View {
|
struct ScreenBackground: View {
|
||||||
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
|
||||||
var colors: [Color]
|
var colors: [Color]
|
||||||
|
var darkGradientEndPointY = 1.0
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
colors: colors,
|
colors: colors,
|
||||||
startPoint: UnitPoint(x: 0.5, y: 0),
|
startPoint: UnitPoint(x: 0.5, y: 0),
|
||||||
endPoint: UnitPoint(x: 0.5, y: 1)
|
endPoint: UnitPoint(x: 0.5, y: colorScheme == .dark ? darkGradientEndPointY : 1)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,11 +34,15 @@ extension ScreenBackground {
|
||||||
}
|
}
|
||||||
struct ScreenBackgroundModifier: ViewModifier {
|
struct ScreenBackgroundModifier: ViewModifier {
|
||||||
var colors: [Color]
|
var colors: [Color]
|
||||||
|
var darkGradientEndPointY = 1.0
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
ScreenBackground(colors: colors)
|
ScreenBackground(
|
||||||
.edgesIgnoringSafeArea(.all)
|
colors: colors,
|
||||||
|
darkGradientEndPointY: darkGradientEndPointY
|
||||||
|
)
|
||||||
|
.edgesIgnoringSafeArea(.all)
|
||||||
|
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
|
@ -62,7 +69,8 @@ extension View {
|
||||||
colors: [
|
colors: [
|
||||||
Asset.Colors.ScreenBackground.redGradientStart.color,
|
Asset.Colors.ScreenBackground.redGradientStart.color,
|
||||||
Asset.Colors.ScreenBackground.redGradientEnd.color
|
Asset.Colors.ScreenBackground.redGradientEnd.color
|
||||||
]
|
],
|
||||||
|
darkGradientEndPointY: 0.4
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -73,7 +81,8 @@ extension View {
|
||||||
colors: [
|
colors: [
|
||||||
Asset.Colors.ScreenBackground.greenGradientStart.color,
|
Asset.Colors.ScreenBackground.greenGradientStart.color,
|
||||||
Asset.Colors.ScreenBackground.greenGradientEnd.color
|
Asset.Colors.ScreenBackground.greenGradientEnd.color
|
||||||
]
|
],
|
||||||
|
darkGradientEndPointY: 0.6
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,12 +40,36 @@ enum Badge: Equatable {
|
||||||
|
|
||||||
struct ErrorBadge: View {
|
struct ErrorBadge: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Text("X")
|
ZStack {
|
||||||
.font(.custom(FontFamily.Rubik.bold.name, size: 36))
|
Rectangle()
|
||||||
.foregroundColor(Asset.Colors.BackgroundColors.red.color)
|
.fill(
|
||||||
.frame(width: 60, height: 60, alignment: .center)
|
LinearGradient(
|
||||||
.background(Asset.Colors.Onboarding.badgeBackground.color)
|
colors: [
|
||||||
.cornerRadius(10)
|
Asset.Colors.Onboarding.circularFrameGradientStart.color,
|
||||||
|
Asset.Colors.Onboarding.circularFrameGradientEnd.color
|
||||||
|
],
|
||||||
|
startPoint: .top,
|
||||||
|
endPoint: .bottom
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.frame(width: 60, height: 60, alignment: .center)
|
||||||
|
.cornerRadius(10)
|
||||||
|
|
||||||
|
Rectangle()
|
||||||
|
.fill(Asset.Colors.Onboarding.badgeBackground.color)
|
||||||
|
.frame(width: 55, height: 55, alignment: .center)
|
||||||
|
.cornerRadius(10)
|
||||||
|
.shadow(
|
||||||
|
color: Asset.Colors.Onboarding.badgeShadow.color,
|
||||||
|
radius: 10,
|
||||||
|
x: 0,
|
||||||
|
y: 0
|
||||||
|
)
|
||||||
|
|
||||||
|
Text("X")
|
||||||
|
.font(.custom(FontFamily.Rubik.bold.name, size: 36))
|
||||||
|
.foregroundColor(Asset.Colors.BackgroundColors.red.color)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue