diff --git a/Sources/Purace/Pages/Scaffold/PuraceErrorView.swift b/Sources/Purace/Pages/Scaffold/PuraceErrorView.swift index b9e11ed..c957c23 100644 --- a/Sources/Purace/Pages/Scaffold/PuraceErrorView.swift +++ b/Sources/Purace/Pages/Scaffold/PuraceErrorView.swift @@ -12,28 +12,34 @@ struct PuraceErrorView: View { var body: some View { GeometryReader { _ in - VStack(alignment: .center) { + HStack { Spacer(minLength: 0) - Image("error", bundle: .module) - VStack(spacing: 17) { - PuraceTextView("Ups", fontSize: 22, weight: .medium) - PuraceTextView("Parece que ha ocurrido un error. No te preocupes, es nuestra culpa.", fontSize: 14, textColor: PuraceStyle.Color.N2) - .multilineTextAlignment(.center) - HStack(spacing: 3) { - PuraceTextView("Código:", textColor: PuraceStyle.Color.N4) - PuraceTextView("12", weight: .medium) + + VStack(alignment: .center) { + Spacer(minLength: 0) + Image("error", bundle: .module) + VStack(alignment: .center, spacing: 17) { + PuraceTextView("Ups", fontSize: 22, weight: .medium) + PuraceTextView("Parece que ha ocurrido un error. No te preocupes, es nuestra culpa.", fontSize: 14, textColor: PuraceStyle.Color.N2) + .multilineTextAlignment(.center) + HStack(spacing: 3) { + PuraceTextView("Código:", textColor: PuraceStyle.Color.N4) + PuraceTextView("12", weight: .medium) + } + .padding(.horizontal, 20) + .padding(.vertical, 4) + .background(Color.white) + .cornerRadius(20) } - .padding(.horizontal, 20) - .padding(.vertical, 4) - .background(Color.white) - .cornerRadius(20) - } - Spacer(minLength: 0) - if let onRetryTap { - PuraceButtonView("Reintentar") { - onRetryTap() + Spacer(minLength: 0) + if let onRetryTap { + PuraceButtonView("Reintentar") { + onRetryTap() + } } + Spacer(minLength: 0) } + Spacer(minLength: 0) } .padding(.horizontal, 50) diff --git a/Sources/Purace/Pages/Scaffold/PuraceScaffoldNavBar.swift b/Sources/Purace/Pages/Scaffold/PuraceScaffoldNavBar.swift index 6fd78fb..df3baba 100644 --- a/Sources/Purace/Pages/Scaffold/PuraceScaffoldNavBar.swift +++ b/Sources/Purace/Pages/Scaffold/PuraceScaffoldNavBar.swift @@ -10,10 +10,12 @@ import SwiftUI public struct PuraceScaffoldNavBar: View { var title: String + var showBackButton: Bool var backOnTap: () -> Void - public init(title: String, backOnTap: @escaping () -> Void) { + public init(title: String, showBackButton: Bool = true, backOnTap: @escaping () -> Void) { self.title = title + self.showBackButton = showBackButton self.backOnTap = backOnTap } @@ -22,17 +24,19 @@ public struct PuraceScaffoldNavBar: View { VStack(alignment: .center) { Spacer(minLength: 0) HStack(alignment: .center) { - Button { - backOnTap() - } label: { - Image("arrow_left", bundle: .module) - .foregroundColor(PuraceStyle.Color.N1) - }.frame(width: 20) - .buttonStyle(.plain) + if showBackButton { + Button { + backOnTap() + } label: { + Image("arrow_left", bundle: .module) + .foregroundColor(PuraceStyle.Color.N1) + }.frame(width: 20) + .buttonStyle(.plain) + } Spacer(minLength: 0) - PuraceTextView(title, fontSize: 14, weight: .medium) + PuraceTextView(title, fontSize: 16, weight: .medium) .multilineTextAlignment(.center) Spacer(minLength: 0)