Hide currency row controls when there's only one currency
With a single currency shown there's nothing to reorder or remove, so the per-row "..." menu (Compose) and the Edit button plus swipe-to- delete/drag-to-reorder (iOS) no longer appear. This also covers Manual, which always shows just the default currency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
@@ -359,33 +359,35 @@ fun PriceScreen(
|
||||
visualTransformation = DigitGroupingTransformation,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
CurrencyRowMenu(
|
||||
code = code,
|
||||
canMoveUp = index > 0,
|
||||
canMoveDown = index < displayedCurrencies.lastIndex,
|
||||
canRemove = code != state.defaultCurrencyCode,
|
||||
onMoveUp = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, index - 1),
|
||||
)
|
||||
},
|
||||
onMoveDown = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, index + 1),
|
||||
)
|
||||
},
|
||||
onMoveToTop = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, 0),
|
||||
)
|
||||
},
|
||||
onMoveToBottom = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, state.selectedFiatCurrencies.lastIndex),
|
||||
)
|
||||
},
|
||||
onRemove = { viewModel.onFiatCurrencyToggled(code) },
|
||||
)
|
||||
if (displayedCurrencies.size > 1) {
|
||||
CurrencyRowMenu(
|
||||
code = code,
|
||||
canMoveUp = index > 0,
|
||||
canMoveDown = index < displayedCurrencies.lastIndex,
|
||||
canRemove = code != state.defaultCurrencyCode,
|
||||
onMoveUp = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, index - 1),
|
||||
)
|
||||
},
|
||||
onMoveDown = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, index + 1),
|
||||
)
|
||||
},
|
||||
onMoveToTop = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, 0),
|
||||
)
|
||||
},
|
||||
onMoveToBottom = {
|
||||
viewModel.onFiatCurrenciesReordered(
|
||||
state.selectedFiatCurrencies.moved(index, state.selectedFiatCurrencies.lastIndex),
|
||||
)
|
||||
},
|
||||
onRemove = { viewModel.onFiatCurrencyToggled(code) },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user