Merge pull request #1048 from omnivore-app/fix/login-button-colors

This commit is contained in:
Jackson Harper
2022-08-08 13:18:02 +08:00
committed by GitHub
5 changed files with 57 additions and 6 deletions

View File

@ -29,6 +29,7 @@ struct EmailLoginFormView: View {
case email, password
}
@EnvironmentObject var dataService: DataService
@Environment(\.horizontalSizeClass) var horizontalSizeClass
@Environment(\.openURL) var openURL
@EnvironmentObject var authenticator: Authenticator
@ -85,7 +86,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)
@ -108,7 +109,12 @@ struct EmailLoginFormView: View {
HStack {
Button(
action: {
openURL(URL(string: "https://omnivore.app/auth/forgot-password")!)
let url: URL = {
var urlComponents = URLComponents()
urlComponents.path = "/auth/forgot-password"
return urlComponents.url(relativeTo: dataService.appEnvironment.webAppBaseURL)!
}()
openURL(url)
},
label: {
Text("Forgot your password?")

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
}
}