File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
frontends/web/src/routes/settings/components/appearance Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44- Add feedback link to guide and about settings
5+ - Move active currencies to top of currency dropdown
56
67## v4.49.0
78- Bundle BitBox02 Nova firmware version v9.24.0
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ type TSelectProps = {
3737 onOpenChange : ( isOpen : boolean ) => void ;
3838} ;
3939
40+ const sortCurrencyOptions = ( options : SelectOption [ ] , activeCurrencies : Fiat [ ] ) : SelectOption [ ] => {
41+ const byLabel = ( a : SelectOption , b : SelectOption ) => a . label . localeCompare ( b . label ) ;
42+ const selected = options . filter ( opt => activeCurrencies . includes ( opt . value ) ) . sort ( byLabel ) ;
43+ const others = options . filter ( opt => ! activeCurrencies . includes ( opt . value ) ) . sort ( byLabel ) ;
44+ return [ ...selected , ...others ] ;
45+ } ;
46+
4047export const ActiveCurrenciesDropdown = ( {
4148 options,
4249 defaultCurrency,
@@ -71,12 +78,13 @@ export const ActiveCurrenciesDropdown = ({
7178 </ div >
7279 ) ;
7380 } ;
81+ const sortedOptions = sortCurrencyOptions ( options , activeCurrencies ) ;
7482
7583 return (
7684 < Dropdown
7785 isMulti
7886 closeMenuOnSelect = { false }
79- options = { options }
87+ options = { sortedOptions }
8088 value = { formattedActiveCurrencies }
8189 title = { t ( 'newSettings.appearance.activeCurrencies.title' ) }
8290 mobileFullScreen
You can’t perform that action at this time.
0 commit comments