Bug fix: DisplayConfigurationView now supports dark mode
@@ -10,21 +10,25 @@ struct DisplayConfigurationView: View {
Picker(
selection: Binding(
get: { model.fiatCurrency },
- set: { postIntent(DisplayConfiguration.IntentUpdateFiatCurrency(fiatCurrency: $0)) }
- ), label: Text("Fiat currency")) {
+ set: {
+ postIntent(DisplayConfiguration.IntentUpdateFiatCurrency(fiatCurrency: $0))
+ }
+ ), label: Text("Fiat currency")
+ ) {
ForEach(0 ..< FiatCurrency.default().values.count) {
let fiatCurrency = FiatCurrency.default().values[$0]
Text(fiatCurrency.label).tag(fiatCurrency)
}
}
- }
- Section {
Picker(
selection: Binding(
get: { model.bitcoinUnit },
- set: { postIntent(DisplayConfiguration.IntentUpdateBitcoinUnit(bitcoinUnit: $0)) }
- ), label: Text("Bitcoin unit")) {
+ set: {
+ postIntent(DisplayConfiguration.IntentUpdateBitcoinUnit(bitcoinUnit: $0))
+ }
+ ), label: Text("Bitcoin unit")
+ ) {
ForEach(0 ..< BitcoinUnit.default().values.count) {
let unit = BitcoinUnit.default().values[$0]
Text(unit.label).tag(unit)
@@ -36,8 +40,11 @@ struct DisplayConfigurationView: View {
Picker(
selection: Binding(
get: { model.appTheme },
- set: { postIntent(DisplayConfiguration.IntentUpdateAppTheme(appTheme: $0)) }
- ), label: Text("application theme")) {
+ set: {
+ postIntent(DisplayConfiguration.IntentUpdateAppTheme(appTheme: $0))
+ }
+ ), label: Text("application theme")
+ ) {
ForEach(0..<AppTheme.default().values.count) {
let theme = AppTheme.default().values[$0]
Text(theme.label).tag(theme)
@@ -46,7 +53,6 @@ struct DisplayConfigurationView: View {
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
- .background(Color.appBackground)
.edgesIgnoringSafeArea(.bottom)
.navigationBarTitle("Display options", displayMode: .inline)
@@ -56,7 +62,12 @@ struct DisplayConfigurationView: View {
}
class DisplayConfigurationView_Previews: PreviewProvider {
- static let mockModel = DisplayConfiguration.Model(fiatCurrency: .usd, bitcoinUnit: .satoshi, appTheme: .system)
+
+ static let mockModel = DisplayConfiguration.Model(
+ fiatCurrency: .usd,
+ bitcoinUnit: .satoshi,
+ appTheme: .system
+ )
static var previews: some View {
mockView(DisplayConfigurationView())
