refactor on paddings

pull/891/head
Ryan Zhao 2 years ago
parent b39d37a9c5
commit 9178133d14

@ -37,21 +37,27 @@ struct DisplayNameView: View {
.bold() .bold()
.font(.system(size: Values.veryLargeFontSize)) .font(.system(size: Values.veryLargeFontSize))
.foregroundColor(themeColor: .textPrimary) .foregroundColor(themeColor: .textPrimary)
.padding(.bottom, Values.mediumSpacing)
Spacer(minLength: 0)
.frame(maxHeight: 2 * Values.mediumSpacing)
let explanation: String = (self.flow == .register) ? "onboarding_display_name_explanation".localized() : "onboarding_display_name_explanation_new".localized() let explanation: String = (self.flow == .register) ? "onboarding_display_name_explanation".localized() : "onboarding_display_name_explanation_new".localized()
Text(explanation) Text(explanation)
.font(.system(size: Values.smallFontSize)) .font(.system(size: Values.smallFontSize))
.foregroundColor(themeColor: .textPrimary) .foregroundColor(themeColor: .textPrimary)
.padding(.vertical, Values.mediumSpacing) .fixedSize(horizontal: false, vertical: true)
Spacer(minLength: 0)
.frame(maxHeight: 2 * Values.mediumSpacing)
SessionTextField( SessionTextField(
$displayName, $displayName,
placeholder: "onboarding_display_name_hint".localized(), placeholder: "onboarding_display_name_hint".localized(),
error: $error error: $error
) )
.padding(.top, Values.mediumSpacing)
.padding(.bottom, Values.veryLargeSpacing) Spacer(minLength: 0)
.frame(maxHeight: Values.massiveSpacing)
Spacer(minLength: 0) Spacer(minLength: 0)
} }

@ -30,10 +30,11 @@ struct LandingView: View {
.bold() .bold()
.font(.system(size: Values.veryLargeFontSize)) .font(.system(size: Values.veryLargeFontSize))
.foregroundColor(themeColor: .textPrimary) .foregroundColor(themeColor: .textPrimary)
.padding(.bottom, Values.largeSpacing)
Spacer(minLength: 0)
.frame(maxHeight: 2 * Values.mediumSpacing)
FakeChat($numberOfBubblesShown) FakeChat($numberOfBubblesShown)
.padding(.bottom, Values.mediumSpacing)
.onAppear { .onAppear {
guard numberOfBubblesShown < 4 else { return } guard numberOfBubblesShown < 4 else { return }
@ -52,6 +53,9 @@ struct LandingView: View {
} }
} }
Spacer(minLength: 0)
.frame(maxHeight: Values.massiveSpacing)
Spacer(minLength: 0) Spacer(minLength: 0)
} }
.padding(.vertical, Values.mediumSpacing) .padding(.vertical, Values.mediumSpacing)

@ -182,19 +182,25 @@ struct EnterRecoveryPasswordView: View{
ZStack(alignment: .center) { ZStack(alignment: .center) {
VStack( VStack(
alignment: .leading, alignment: .leading,
spacing: Values.mediumSpacing spacing: 0
) { ) {
Spacer() Spacer(minLength: 0)
Text("onboarding_recovery_password_tab_title".localized()) Text("onboarding_recovery_password_tab_title".localized())
.bold() .bold()
.font(.system(size: Values.veryLargeFontSize)) .font(.system(size: Values.veryLargeFontSize))
.foregroundColor(themeColor: .textPrimary) .foregroundColor(themeColor: .textPrimary)
Spacer(minLength: 0)
.frame(maxHeight: 2 * Values.mediumSpacing)
Text("onboarding_recovery_password_tab_explanation".localized()) Text("onboarding_recovery_password_tab_explanation".localized())
.font(.system(size: Values.smallFontSize)) .font(.system(size: Values.smallFontSize))
.foregroundColor(themeColor: .textPrimary) .foregroundColor(themeColor: .textPrimary)
.padding(.vertical, Values.mediumSpacing) .fixedSize(horizontal: false, vertical: true)
Spacer(minLength: 0)
.frame(maxHeight: 2 * Values.mediumSpacing)
SessionTextField( SessionTextField(
$recoveryPassword, $recoveryPassword,
@ -202,10 +208,13 @@ struct EnterRecoveryPasswordView: View{
error: $error error: $error
) )
Spacer() Spacer(minLength: 0)
.frame(maxHeight: Values.massiveSpacing)
Spacer(minLength: 0)
} }
.padding(.horizontal, Values.veryLargeSpacing) .padding(.horizontal, Values.veryLargeSpacing)
.padding(.bottom, Values.massiveSpacing + Values.largeButtonHeight) .padding(.bottom, Values.largeButtonHeight)
VStack() { VStack() {
Spacer() Spacer()

@ -42,10 +42,8 @@ public struct SessionTextField: View {
.foregroundColor(themeColor: (error?.isEmpty == false) ? .danger : .textPrimary) .foregroundColor(themeColor: (error?.isEmpty == false) ? .danger : .textPrimary)
} }
.padding(.horizontal, Values.largeSpacing) .padding(.horizontal, Values.largeSpacing)
.frame( .frame(maxWidth: .infinity)
maxWidth: .infinity, .frame(height: Self.height)
maxHeight: Self.height
)
.overlay( .overlay(
RoundedRectangle( RoundedRectangle(
cornerSize: CGSize( cornerSize: CGSize(

Loading…
Cancel
Save