Skip to content

Commit

Permalink
Clean up unused onboarding code
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandroboron committed Dec 6, 2024
1 parent 74e1f19 commit c8d2e97
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,17 @@ import Onboarding

extension OnboardingView {

struct AddToDockPromoContentState {
var animateTitle = true
var animateMessage = false
var showContent = false
}

struct AddToDockPromoContent: View {

@State private var showAddToDockTutorial = false

private var animateTitle: Binding<Bool>
private var animateMessage: Binding<Bool>
private var showContent: Binding<Bool>
private let showTutorialAction: () -> Void
private let dismissAction: (_ fromAddToDock: Bool) -> Void

init(
animateTitle: Binding<Bool> = .constant(true),
animateMessage: Binding<Bool> = .constant(true),
showContent: Binding<Bool> = .constant(false),
showTutorialAction: @escaping () -> Void,
dismissAction: @escaping (_ fromAddToDock: Bool) -> Void
) {
self.animateTitle = animateTitle
self.animateMessage = animateMessage
self.showContent = showContent
self.showTutorialAction = showTutorialAction
self.dismissAction = dismissAction
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ private enum Metrics {
}

struct AppIconPicker: View {
@Environment(\.colorScheme) private var color

@StateObject private var viewModel = AppIconPickerViewModel()

let layout = [GridItem(.adaptive(minimum: Metrics.iconSize), spacing: Metrics.spacing, alignment: .leading)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,14 @@ extension OnboardingIntroViewModel {
struct Copy {
let introTitle: String
let browserComparisonTitle: String
let trackerBlockers: String
let cookiePopups: String
let creepyAds: String
let eraseBrowsingData: String
}
}

extension OnboardingIntroViewModel.Copy {

static let `default` = OnboardingIntroViewModel.Copy(
introTitle: UserText.Onboarding.Intro.title,
browserComparisonTitle: UserText.Onboarding.BrowsersComparison.title,
trackerBlockers: UserText.Onboarding.BrowsersComparison.Features.trackerBlockers,
cookiePopups: UserText.Onboarding.BrowsersComparison.Features.cookiePopups,
creepyAds: UserText.Onboarding.BrowsersComparison.Features.creepyAds,
eraseBrowsingData: UserText.Onboarding.BrowsersComparison.Features.eraseBrowsingData
browserComparisonTitle: UserText.Onboarding.BrowsersComparison.title
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import Onboarding

private enum Metrics {
static let titleFont = Font.system(size: 20, weight: .semibold)
static let messageFont = Font.system(size: 16)
}

extension OnboardingView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@ extension OnboardingView {
private enum Metrics {
static let titleFont = Font.system(size: 20, weight: .semibold)
static let messageFont = Font.system(size: 16)
static let pickerLeadingOffset: CGFloat = -20
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension OnboardingView {

var body: some View {
VStack(spacing: 24.0) {
AnimatableTypingText(title) {
AnimatableTypingText(title, startAnimating: animateText) {
withAnimation {
showCTA.wrappedValue = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct OnboardingView: View {

@State private var appIconPickerContentState = AppIconPickerContentState()
@State private var addressBarPositionContentState = AddressBarPositionContentState()
@State private var addToDockPromoContentState = AddToDockPromoContentState()

init(model: OnboardingIntroViewModel) {
self.model = model
Expand Down Expand Up @@ -75,10 +74,6 @@ struct OnboardingView: View {
case .browsersComparisonDialog:
showComparisonButton = true
animateComparisonText = false
case .addToDockPromoDialog:
addToDockPromoContentState.animateTitle = false
addToDockPromoContentState.animateMessage = false
addToDockPromoContentState.showContent = true
case .chooseAppIconDialog:
appIconPickerContentState.animateTitle = false
appIconPickerContentState.animateMessage = false
Expand Down

0 comments on commit c8d2e97

Please sign in to comment.