Use the CTA button color for email login

This commit is contained in:
Jackson Harper
2022-08-08 11:32:21 +08:00
parent f6df97c85d
commit 814b766b72
5 changed files with 50 additions and 5 deletions

View File

@ -85,7 +85,7 @@ struct EmailLoginFormView: View {
},
label: { Text("Submit") }
)
.buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300))
.buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300))
if let loginError = viewModel.loginError {
LoginErrorMessageView(loginError: loginError)

View File

@ -176,7 +176,7 @@ struct EmailSignupFormView: View {
},
label: { Text("Submit") }
)
.buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300))
.buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300))
if let loginError = viewModel.loginError {
LoginErrorMessageView(loginError: loginError)

View File

@ -13,12 +13,17 @@ public struct SolidCapsuleButtonStyle: ButtonStyle {
public func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.appBody)
.font(.appHeadline)
.foregroundColor(textColor)
.padding(10)
.padding(12)
.frame(width: width)
.background(Capsule().foregroundColor(backgroundColor))
.background(backgroundColor)
.opacity(configuration.isPressed ? 0.7 : 1.0)
.cornerRadius(8)
.overlay(
RoundedRectangle(cornerRadius: 8)
.stroke(backgroundColor, lineWidth: 1)
)
}
}

View File

@ -8,11 +8,13 @@ public extension Color {
static var appGrayBorder: Color { Color("_grayBorder", bundle: .module) }
static var appGraySolid: Color { Color("_graySolid", bundle: .module) }
static var appGrayText: Color { Color("_grayText", bundle: .module) }
static var appCtaYellow: Color { Color("_ctaYellow", bundle: .module) }
static var appGrayTextContrast: Color { Color("_grayTextContrast", bundle: .module) }
// Catalog Colors
static var appYellow48: Color { Color("_yellow48", bundle: .module) }
static var appYellow96: Color { Color("_yellow96", bundle: .module) }
static var appButtonBackground: Color { Color("_buttonBackground", bundle: .module) }
static var appTextDefault: Color { Color("_utilityTextDefault", bundle: .module) }
static var appPrimaryBackground: Color { Color("_appPrimaryBackground", bundle: .module) }

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x34",
"green" : "0xD2",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x34",
"green" : "0xD2",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}