Skip to content

Commit

Permalink
Fix le typo
Browse files Browse the repository at this point in the history
  • Loading branch information
adudenamedruby committed Jun 14, 2024
1 parent 38d49fd commit e366b5f
Show file tree
Hide file tree
Showing 124 changed files with 252 additions and 252 deletions.
4 changes: 2 additions & 2 deletions BrowserKit/Sources/Common/Theming/DefaultThemeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final class DefaultThemeManager: ThemeManager, Notifiable {
}

// MARK: - Themeing general functions
public func getcurrentTheme(for window: WindowUUID?) -> Theme {
public func getCurrentTheme(for window: WindowUUID?) -> Theme {
guard let window else {
assertionFailure("Attempt to get the theme for a nil window UUID.")
return DarkTheme()
Expand Down Expand Up @@ -189,7 +189,7 @@ public final class DefaultThemeManager: ThemeManager, Notifiable {
private func applyThemeChanges(for window: WindowUUID, using newTheme: ThemeType) {
// Overwrite the user interface style on the window attached to our scene
// once we have multiple scenes we need to update all of them
let style = self.getcurrentTheme(for: window).type.getInterfaceStyle()
let style = self.getCurrentTheme(for: window).type.getInterfaceStyle()
self.windows[window]?.overrideUserInterfaceStyle = style
notifyCurrentThemeDidChange(for: window)
}
Expand Down
2 changes: 1 addition & 1 deletion BrowserKit/Sources/Common/Theming/ThemeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UIKit

public protocol ThemeManager {
// Current theme
func getcurrentTheme(for window: WindowUUID?) -> Theme
func getCurrentTheme(for window: WindowUUID?) -> Theme

// System theme and brightness settings
var systemThemeIsOn: Bool { get }
Expand Down
2 changes: 1 addition & 1 deletion BrowserKit/Sources/Common/Theming/Themeable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension Themeable {
public func updateThemeApplicableSubviews(_ view: UIView, for window: WindowUUID?) {
guard let uuid = (view as? ThemeUUIDIdentifiable)?.currentWindowUUID ?? window else { return }
assert(uuid != .unavailable, "Theme applicable view has `unavailable` window UUID. Unexpected.")
let theme = themeManager.getcurrentTheme(for: uuid)
let theme = themeManager.getCurrentTheme(for: uuid)
let themeViews = getAllSubviews(for: view, ofType: ThemeApplicable.self)
themeViews.forEach { $0.applyTheme(theme: theme) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public class BottomSheetViewController: UIViewController,

public func applyTheme() {
guard let uuid = (self.view as? ThemeUUIDIdentifiable)?.currentWindowUUID else { return }
contentView.backgroundColor = themeManager.getcurrentTheme(for: uuid).colors.layer1
contentView.backgroundColor = themeManager.getCurrentTheme(for: uuid).colors.layer1
sheetView.layer.shadowOpacity = viewModel.shadowOpacity

if useDimmedBackground {
Expand Down
2 changes: 1 addition & 1 deletion firefox-ios/Client/AccessoryViewProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class AccessoryViewProvider: UIView, Themeable, InjectedThemeUUIDIdentifiable {
}

func applyTheme() {
let theme = themeManager.getcurrentTheme(for: windowUUID)
let theme = themeManager.getCurrentTheme(for: windowUUID)

backgroundColor = theme.colors.layer5
[previousButton, nextButton, doneButton].forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CredentialAutofillCoordinator: BaseCoordinator {
// MARK: - Methods

private func currentTheme() -> Theme {
return themeManager.getcurrentTheme(for: windowUUID)
return themeManager.getCurrentTheme(for: windowUUID)
}

func showCreditCardAutofill(creditCard: CreditCard?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct SceneSetupHelper {
// Setting the initial theme correctly as we don't have a window attached yet to let ThemeManager set it
let themeManager: ThemeManager = AppContainer.shared.resolve()
themeManager.setWindow(window, for: windowUUID)
window.overrideUserInterfaceStyle = themeManager.getcurrentTheme(for: windowUUID).type.getInterfaceStyle()
window.overrideUserInterfaceStyle = themeManager.getCurrentTheme(for: windowUUID).type.getInterfaceStyle()

return window
}
Expand Down
2 changes: 1 addition & 1 deletion firefox-ios/Client/Coordinators/SettingsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class SettingsCoordinator: BaseCoordinator,
let viewModel = WallpaperSettingsViewModel(
wallpaperManager: wallpaperManager,
tabManager: tabManager,
theme: themeManager.getcurrentTheme(for: windowUUID)
theme: themeManager.getCurrentTheme(for: windowUUID)
)
let wallpaperVC = WallpaperSettingsViewController(viewModel: viewModel, windowUUID: windowUUID)
wallpaperVC.settingsDelegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ShareExtensionCoordinator: BaseCoordinator,
SimpleToast().showAlertWithText(
.AppMenu.AppMenuCopyURLConfirmMessage,
bottomContainer: alertContainer,
theme: themeManager.getcurrentTheme(for: windowUUID))
theme: themeManager.getCurrentTheme(for: windowUUID))
dequeueNotShownJSAlert()
default:
dequeueNotShownJSAlert()
Expand All @@ -95,7 +95,7 @@ class ShareExtensionCoordinator: BaseCoordinator,
shareItem = ShareItem(url: url.absoluteString, title: nil)
}

let themeColors = themeManager.getcurrentTheme(for: windowUUID).colors
let themeColors = themeManager.getCurrentTheme(for: windowUUID).colors
let colors = SendToDeviceHelper.Colors(defaultBackground: themeColors.layer1,
textColor: themeColors.textPrimary,
iconColor: themeColors.iconDisabled)
Expand Down Expand Up @@ -165,7 +165,7 @@ class ShareExtensionCoordinator: BaseCoordinator,
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
SimpleToast().showAlertWithText(.AppMenu.AppMenuTabSentConfirmMessage,
bottomContainer: self.alertContainer,
theme: self.themeManager.getcurrentTheme(for: self.windowUUID))
theme: self.themeManager.getCurrentTheme(for: self.windowUUID))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ struct AddressAutoFillBottomSheetView: View {
Spacer()
}
.padding()
.background(Color(themeManager.getcurrentTheme(for: windowUUID).colors.layer1))
.background(Color(themeManager.getCurrentTheme(for: windowUUID).colors.layer1))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ struct AddressAutofillSettingsView: View {
}
.onAppear {
// Apply the theme when the view appears
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class AddressAutofillSettingsViewController: SensitiveViewController, Themeable

/// Applies the current theme to the view.
func applyTheme() {
let theme = themeManager.getcurrentTheme(for: windowUUID)
let theme = themeManager.getCurrentTheme(for: windowUUID)
view.backgroundColor = theme.colors.layer1
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ struct AddressAutofillToggle: View {
.background(backgroundColor)
.onAppear {
// Apply theme when the view appears
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ struct AddressCellView: View {
Divider().frame(height: 1)
}
.listRowInsets(EdgeInsets())
.buttonStyle(AddressButtonStyle(theme: themeManager.getcurrentTheme(for: windowUUID)))
.buttonStyle(AddressButtonStyle(theme: themeManager.getCurrentTheme(for: windowUUID)))
.listRowSeparator(.hidden)
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ struct AddressListView: View {
}
.onAppear {
viewModel.fetchAddresses()
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AddressListViewModel: ObservableObject, FeatureFlaggable {
var currentRegionCode: () -> String = { Locale.current.regionCode ?? "" }
var isDarkTheme: (WindowUUID) -> Bool = { windowUUID in
let themeManager: ThemeManager = AppContainer.shared.resolve()
return themeManager.getcurrentTheme(for: windowUUID).type == .dark
return themeManager.getCurrentTheme(for: windowUUID).type == .dark
}

// MARK: - Initializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ struct AddressScrollView: View {
.listRowInsets(EdgeInsets())
.onAppear {
viewModel.fetchAddresses()
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class EditAddressViewController: UIViewController, WKNavigationDelegate, WKScrip

func applyTheme() {
guard let currentWindowUUID else { return }
let isDarkTheme = themeManager.getcurrentTheme(for: currentWindowUUID).type == .dark
let isDarkTheme = themeManager.getCurrentTheme(for: currentWindowUUID).type == .dark
evaluateJavaScript("setTheme(\(isDarkTheme));")
}
}
Expand Down
4 changes: 2 additions & 2 deletions firefox-ios/Client/Frontend/Autofill/AutofillFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ struct AutofillFooterView: View {
.accessibility(identifier: AccessibilityIdentifiers.Autofill.footerPrimaryAction)
}
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
4 changes: 2 additions & 2 deletions firefox-ios/Client/Frontend/Autofill/AutofillHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ struct AutofillHeaderView: View {
.padding(.bottom, UX.bottomSpacing)

.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class CreditCardBottomSheetViewController: UIViewController,
a11yIdentifier: AccessibilityIdentifiers.RememberCreditCard.yesButton
)
yesButton.configure(viewModel: buttonViewModel)
yesButton.applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
yesButton.applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}

contentView.addSubviews(cardTableView, buttonsContainerStackView)
Expand Down Expand Up @@ -311,7 +311,7 @@ class CreditCardBottomSheetViewController: UIViewController,
) as? CreditCardBottomSheetHeaderView else {
return nil
}
headerView.applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
headerView.applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
headerView.viewModel = viewModel
return headerView
}
Expand All @@ -327,7 +327,7 @@ class CreditCardBottomSheetViewController: UIViewController,
) as? CreditCardBottomSheetFooterView else {
return nil
}
footerView.applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
footerView.applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
if !footerView.manageCardsButton.responds(
to: #selector(CreditCardBottomSheetViewController.didTapManageCards)
) {
Expand Down Expand Up @@ -363,7 +363,7 @@ class CreditCardBottomSheetViewController: UIViewController,

// MARK: Themable
func applyTheme() {
let currentTheme = themeManager.getcurrentTheme(for: windowUUID).colors
let currentTheme = themeManager.getCurrentTheme(for: windowUUID).colors
view.backgroundColor = currentTheme.layer1
cardTableView.reloadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ struct CreditCardInputView: View {
}
.blur(radius: isBlurred ? 10 : 0)
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(
for: UIApplication.willResignActiveNotification)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ struct CreditCardItemRow: View {
.background(ClearBackgroundView())
.padding(.vertical, addPadding ? 8 : 0)
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ struct CreditCardSectionHeader: View {
bottom: 8,
trailing: 16))
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ struct CreditCardSettingsEmptyView: View {
}
}
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class CreditCardSettingsViewController: SensitiveViewController, Themeable {
}

private func currentTheme() -> Theme {
return themeManager.getcurrentTheme(for: windowUUID)
return themeManager.getCurrentTheme(for: windowUUID)
}

func applyTheme() {
Expand Down Expand Up @@ -194,7 +194,7 @@ class CreditCardSettingsViewController: SensitiveViewController, Themeable {
guard status != .none else { return }
SimpleToast().showAlertWithText(status.message,
bottomContainer: view,
theme: self.themeManager.getcurrentTheme(for: self.windowUUID))
theme: self.themeManager.getCurrentTheme(for: self.windowUUID))
}

@objc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class CreditCardTableViewController: UIViewController, Themeable {
}

func applyTheme() {
let theme = themeManager.getcurrentTheme(for: windowUUID)
let theme = themeManager.getCurrentTheme(for: windowUUID)
view.backgroundColor = theme.colors.layer1
tableView.backgroundColor = theme.colors.layer1
}
Expand Down Expand Up @@ -156,7 +156,7 @@ extension CreditCardTableViewController: UITableViewDelegate,
) as? HostingTableViewSectionHeader<CreditCardSectionHeader>
else { return nil }

let theme = themeManager.getcurrentTheme(for: windowUUID)
let theme = themeManager.getCurrentTheme(for: windowUUID)
let headerView = CreditCardSectionHeader(windowUUID: windowUUID, textColor: theme.colors.textSecondary.color)
hostingCell.host(headerView, parentController: self)
return hostingCell
Expand All @@ -180,7 +180,7 @@ extension CreditCardTableViewController: UITableViewDelegate,
return UITableViewCell()
}

let theme = themeManager.getcurrentTheme(for: windowUUID)
let theme = themeManager.getCurrentTheme(for: windowUUID)
let row = CreditCardAutofillToggle(windowUUID: windowUUID,
textColor: theme.colors.textPrimary.color,
model: model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ struct CreditCardAutofillToggle: View {
}
.background(backgroundColor)
.onAppear {
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
.onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in
guard let uuid = notification.windowUUID, uuid == windowUUID else { return }
applyTheme(theme: themeManager.getcurrentTheme(for: windowUUID))
applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID))
}
}

Expand Down
Loading

0 comments on commit e366b5f

Please sign in to comment.