Split the currency picker's browsable list into Priced/Unpriced
The "Currencies" section (not-yet-added currencies) is now two: "Priced Currencies" and "Unpriced Currencies", partitioned by whether the active source quotes a rate for each one. "Current Currency" and "Selected Currencies" are unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
@@ -36,9 +36,20 @@ struct CurrencyPickerSheet: View {
|
||||
}
|
||||
|
||||
let matchingUnselected = unselectedCurrencies.filter(matches)
|
||||
if !matchingUnselected.isEmpty {
|
||||
Section(IosLocalizationKt.localizedString(resource: MR.strings.shared.currencies_section_title)) {
|
||||
ForEach(matchingUnselected, id: \.code) { info in
|
||||
let unselectedPriced = matchingUnselected.filter { pricedCurrencyCodes.contains($0.code) }
|
||||
let unselectedUnpriced = matchingUnselected.filter { !pricedCurrencyCodes.contains($0.code) }
|
||||
|
||||
if !unselectedPriced.isEmpty {
|
||||
Section(IosLocalizationKt.localizedString(resource: MR.strings.shared.priced_currencies_section_title)) {
|
||||
ForEach(unselectedPriced, id: \.code) { info in
|
||||
currencyRow(for: info, isSelected: false, onTap: { onToggle(info.code) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !unselectedUnpriced.isEmpty {
|
||||
Section(IosLocalizationKt.localizedString(resource: MR.strings.shared.unpriced_currencies_section_title)) {
|
||||
ForEach(unselectedUnpriced, id: \.code) { info in
|
||||
currencyRow(for: info, isSelected: false, onTap: { onToggle(info.code) })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user