Skip to content

Commit

Permalink
Merge pull request #434 from PermanentOrg/feature/VSP-1369-Onboarding…
Browse files Browse the repository at this point in the history
…-Enter-Archive-Name

VSP-1369[IOS][Tablet] Create your first Archive - Enter Archive Name
  • Loading branch information
luciancerbu-vsp authored Apr 25, 2024
2 parents 516bcd6 + 48dd11a commit 53e7af3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions Permanent/Modules/Onboarding/Views/OnboardingArchiveName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ struct OnboardingArchiveName: View {

var backButton: (() -> Void)
var nextButton: (() -> Void)
@State var bottomButtonsPadding: CGFloat = 40
@State var isKeyboardPresented = false
@State var textFieldText: String = ""

Expand Down Expand Up @@ -52,14 +51,11 @@ struct OnboardingArchiveName: View {
}
.onReceive(keyboardPublisher) { keyboard in
if keyboard.isFirstResponder {
bottomButtonsPadding = 10
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: {
withAnimation {
scrollReader.scrollTo(0, anchor: .center)
}
})
} else {
bottomButtonsPadding = 40
}
}
.onAppear {
Expand All @@ -73,7 +69,7 @@ struct OnboardingArchiveName: View {
SmallRoundButtonImageView(type: .noColor, imagePlace: .onLeft, text: "Back", image: Image(.leftArrowShort), action: backButton)
SmallRoundButtonImageView(isDisabled: onboardingValues.textFieldText.isEmpty, text: "Next", action: nextButton)
}
.padding(.bottom, bottomButtonsPadding)
.padding(.bottom, 40)
.sheet(isPresented: $presentSelectArchivesType, content: {
OnboardingSelectArchiveTypeView(onboardingValues: onboardingValues)
})
Expand Down Expand Up @@ -115,14 +111,11 @@ struct OnboardingArchiveName: View {
}
.onReceive(keyboardPublisher) { keyboard in
if keyboard.isFirstResponder {
bottomButtonsPadding = 10
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: {
withAnimation {
scrollReader.scrollTo(1, anchor: .center)
}
})
} else {
bottomButtonsPadding = 40
}
}
.onAppear {
Expand All @@ -137,7 +130,7 @@ struct OnboardingArchiveName: View {
.frame(width: 120)
RoundButtonRightImageView(text: "Create the archive", action: nextButton)
}
.padding(.bottom, bottomButtonsPadding)
.padding(.bottom, 40)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Permanent/Modules/Onboarding/Views/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct OnboardingView: View {
.padding(.horizontal, Constants.Design.isPhone ? 32 : 64)
.padding(.top, Constants.Design.isPhone ? 70 : 48)
}
.ignoresSafeArea(.container)
.ignoresSafeArea(.all)
}


Expand Down

0 comments on commit 53e7af3

Please sign in to comment.