-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Appearance module to SwiftUI
- Loading branch information
Showing
13 changed files
with
258 additions
and
857 deletions.
There are no files selected for viewing
42 changes: 12 additions & 30 deletions
42
UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceAppIconCell.swift
This file was deleted.
Oops, something went wrong.
86 changes: 0 additions & 86 deletions
86
UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceAppIconsCell.swift
This file was deleted.
Oops, something went wrong.
45 changes: 10 additions & 35 deletions
45
UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceModule.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,15 @@ | ||
import UIKit | ||
import ThemeKit | ||
import SwiftUI | ||
|
||
struct AppearanceModule { | ||
|
||
static func viewController() -> UIViewController { | ||
let service = AppearanceService( | ||
themeManager: App.shared.themeManager, | ||
launchScreenManager: App.shared.launchScreenManager, | ||
appIconManager: App.shared.appIconManager, | ||
balancePrimaryValueManager: App.shared.balancePrimaryValueManager, | ||
balanceConversionManager: App.shared.balanceConversionManager, | ||
balanceHiddenManager: App.shared.balanceHiddenManager | ||
static func view() -> some View { | ||
let viewModel = AppearanceViewModel( | ||
themeManager: App.shared.themeManager, | ||
launchScreenManager: App.shared.launchScreenManager, | ||
appIconManager: App.shared.appIconManager, | ||
balancePrimaryValueManager: App.shared.balancePrimaryValueManager, | ||
balanceConversionManager: App.shared.balanceConversionManager, | ||
balanceHiddenManager: App.shared.balanceHiddenManager | ||
) | ||
|
||
let viewModel = AppearanceViewModel(service: service) | ||
return AppearanceViewController(viewModel: viewModel) | ||
} | ||
|
||
} | ||
|
||
extension ThemeMode: CustomStringConvertible { | ||
|
||
public var title: String { | ||
switch self { | ||
case .system: return "appearance.theme.system".localized | ||
case .dark: return "appearance.theme.dark".localized | ||
case .light: return "appearance.theme.light".localized | ||
} | ||
return AppearanceView(viewModel: viewModel) | ||
} | ||
|
||
public var iconName: String { | ||
switch self { | ||
case .system: return "settings_24" | ||
case .dark: return "dark_24" | ||
case .light: return "light_24" | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.