refactor on paddings

This commit is contained in:
Ryan Zhao 2023-08-24 16:58:31 +10:00
parent b39d37a9c5
commit 9178133d14
4 changed files with 32 additions and 15 deletions

View File

@ -37,21 +37,27 @@ struct DisplayNameView: View {
.bold()
.font(.system(size: Values.veryLargeFontSize))
.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()
Text(explanation)
.font(.system(size: Values.smallFontSize))
.foregroundColor(themeColor: .textPrimary)
.padding(.vertical, Values.mediumSpacing)
.fixedSize(horizontal: false, vertical: true)
Spacer(minLength: 0)
.frame(maxHeight: 2 * Values.mediumSpacing)
SessionTextField(
$displayName,
placeholder: "onboarding_display_name_hint".localized(),
error: $error
)
.padding(.top, Values.mediumSpacing)
.padding(.bottom, Values.veryLargeSpacing)
Spacer(minLength: 0)
.frame(maxHeight: Values.massiveSpacing)
Spacer(minLength: 0)
}

View File

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

View File

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

View File

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