From f0484650e8255863fd7e638410bd003aeb472f1c Mon Sep 17 00:00:00 2001 From: Saeid Rezaei Date: Fri, 29 Dec 2023 17:16:30 +0100 Subject: [PATCH] Refactor FXIOS-8013 [v123] Replaced signInButton with PrimaryRoundedButton type (#17934) * Replaced signInButton with PrimaryRoundedButton type * Removed unused static params from UX struct --- .../Tabs/Views/RemoteTabsEmptyView.swift | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsEmptyView.swift b/firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsEmptyView.swift index 7692b2f8e92b..e13aef0f155d 100644 --- a/firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsEmptyView.swift +++ b/firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsEmptyView.swift @@ -18,12 +18,9 @@ class RemoteTabsEmptyView: UIView, ThemeApplicable { static let verticalPadding: CGFloat = 40 static let horizontalPadding: CGFloat = 24 static let paddingInBetweenItems: CGFloat = 15 - static let buttonCornerRadius: CGFloat = 13 static let titleSizeFont: CGFloat = 22 static let descriptionSizeFont: CGFloat = 17 - static let buttonSizeFont: CGFloat = 16 static let imageSize = CGSize(width: 90, height: 60) - static let buttonVerticalInset: CGFloat = 12 } weak var delegate: RemoteTabsEmptyViewDelegate? @@ -58,16 +55,12 @@ class RemoteTabsEmptyView: UIView, ThemeApplicable { label.textAlignment = .center } - private let signInButton: LegacyResizableButton = .build { button in - button.titleLabel?.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .callout, - size: UX.buttonSizeFont) - button.setTitle(.Settings.Sync.ButtonTitle, for: []) - button.layer.cornerRadius = UX.buttonCornerRadius - button.contentEdgeInsets = UIEdgeInsets(top: UX.buttonVerticalInset, - left: UX.buttonVerticalInset, - bottom: UX.buttonVerticalInset, - right: UX.buttonVerticalInset) - button.accessibilityIdentifier = AccessibilityIdentifiers.TabTray.syncDataButton + private let signInButton: PrimaryRoundedButton = .build { button in + let viewModel = PrimaryRoundedButtonViewModel( + title: .Settings.Sync.ButtonTitle, + a11yIdentifier: AccessibilityIdentifiers.TabTray.syncDataButton + ) + button.configure(viewModel: viewModel) } override init(frame: CGRect) { @@ -128,8 +121,7 @@ class RemoteTabsEmptyView: UIView, ThemeApplicable { emptyStateImageView.tintColor = theme.colors.textPrimary titleLabel.textColor = theme.colors.textPrimary instructionsLabel.textColor = theme.colors.textPrimary - signInButton.setTitleColor(theme.colors.textInverted, for: .normal) - signInButton.backgroundColor = theme.colors.actionPrimary + signInButton.applyTheme(theme: theme) backgroundColor = theme.colors.layer3 }