-
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.
Apply new layout for Appearance module
- Loading branch information
Showing
16 changed files
with
298 additions
and
177 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
UnstoppableWallet/UnstoppableWallet/Core/Managers/PriceChangeModeManager.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Combine | ||
import HsExtensions | ||
|
||
class PriceChangeModeManager { | ||
private let keyPriceChangeMode = "price-change-mode" | ||
|
||
private let userDefaultsStorage: UserDefaultsStorage | ||
|
||
@PostPublished var priceChangeMode: PriceChangeMode { | ||
didSet { | ||
userDefaultsStorage.set(value: priceChangeMode.rawValue, for: keyPriceChangeMode) | ||
} | ||
} | ||
|
||
init(userDefaultsStorage: UserDefaultsStorage) { | ||
self.userDefaultsStorage = userDefaultsStorage | ||
|
||
if let rawValue: String = userDefaultsStorage.value(for: keyPriceChangeMode), let value = PriceChangeMode(rawValue: rawValue) { | ||
priceChangeMode = value | ||
} else { | ||
priceChangeMode = .hour24 | ||
} | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
UnstoppableWallet/UnstoppableWallet/Models/BalancePrimaryValue.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,18 +1,4 @@ | ||
enum BalancePrimaryValue: String, CaseIterable, Codable { | ||
case coin | ||
case currency | ||
|
||
var title: String { | ||
switch self { | ||
case .coin: return "appearance.balance_value.coin_value".localized | ||
case .currency: return "appearance.balance_value.fiat_value".localized | ||
} | ||
} | ||
|
||
var subtitle: String { | ||
switch self { | ||
case .coin: return "appearance.balance_value.fiat_value".localized | ||
case .currency: return "appearance.balance_value.coin_value".localized | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
UnstoppableWallet/UnstoppableWallet/Models/PriceChangeMode.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
enum PriceChangeMode: String, CaseIterable, Codable { | ||
case hour24 | ||
case midnightUtc | ||
} |
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
Oops, something went wrong.