Rename rate labels, style them like other amount fields
"1 BTC to USD" -> "BTC to USD", "1 <currency> to Sats" -> "<currency> to Sats" (the "1 " was redundant with the field itself now carrying the label). Compose: the BTC-to-currency rate and currency-to-sats value are now OutlinedTextFields (read-only, matching the enabled/disabled styling of the Currencies section's fields) instead of plain Text, with the label folded into the field itself rather than a separate heading. The manual-source rate field's label changes from generic "Rate" to the same "BTC to <currency>". iOS/macOS: dropped the Section's "1 BTC to <currency>" header; the label now sits directly on the rate row (label left, value right), matching the existing Sats/BTC/currency field rows and the already-matching "<currency> to Sats" row below it. rate_label is now unused and removed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
@@ -55,10 +55,6 @@ struct ContentView: View {
|
||||
private func form(for state: IosConverterState) -> some View {
|
||||
Form {
|
||||
Section(
|
||||
header: Text(IosLocalizationKt.localizedFormattedString(
|
||||
resource: MR.strings.shared.btc_to_currency,
|
||||
args: [state.defaultCurrencyCode]
|
||||
)),
|
||||
footer: Group {
|
||||
if !state.statusLine.isEmpty {
|
||||
Text(state.statusLine)
|
||||
@@ -78,19 +74,22 @@ struct ContentView: View {
|
||||
}
|
||||
|
||||
HStack {
|
||||
Text(IosLocalizationKt.localizedFormattedString(
|
||||
resource: MR.strings.shared.btc_to_currency,
|
||||
args: [state.defaultCurrencyCode]
|
||||
))
|
||||
Spacer()
|
||||
if state.isManualSource {
|
||||
NumericField(
|
||||
placeholder: IosLocalizationKt.localizedString(resource: MR.strings.shared.rate_label),
|
||||
placeholder: "",
|
||||
value: state.manualRateInput,
|
||||
keyboardType: .decimalPad,
|
||||
sanitize: sanitizeDecimalInput,
|
||||
onChange: { viewModel.onManualRateChanged($0) }
|
||||
onChange: { viewModel.onManualRateChanged($0) },
|
||||
alignment: .trailing
|
||||
)
|
||||
} else if !state.defaultCurrencyRate.isEmpty {
|
||||
Text(NumberFormatKt.groupDigits(value: state.defaultCurrencyRate))
|
||||
Spacer()
|
||||
} else {
|
||||
Spacer()
|
||||
}
|
||||
if !state.isManualSource {
|
||||
if state.isLoading {
|
||||
|
||||
Reference in New Issue
Block a user