Skip to content

Commit

Permalink
Sort items in dropdown so that usdc has priority
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Apr 3, 2024
1 parent ea4b8e8 commit 79aaab0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion centrifuge-app/src/components/InvestRedeem/InvestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ export function InvestForm({ autoFocus, investLabel = 'Invest' }: InvestFormProp
actions.selectPoolCurrency(e.target.value)
}}
value={state.poolCurrency?.symbol}
options={state?.poolCurrencies.map((c) => ({ value: c.symbol, label: c.displayName }))}
options={state?.poolCurrencies
.sort((_, b) => (b.displayName.toLowerCase().includes('usdc') ? 1 : -1))
.map((c) => ({ value: c.symbol, label: c.displayName }))}
style={{ textAlign: 'right' }}
/>
) : (
Expand Down
4 changes: 3 additions & 1 deletion centrifuge-app/src/components/InvestRedeem/RedeemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export function RedeemForm({ autoFocus }: RedeemFormProps) {
actions.selectPoolCurrency(e.target.value)
}}
value={state.poolCurrency?.symbol}
options={state?.poolCurrencies.map((c) => ({ value: c.symbol, label: c.displayName }))}
options={state?.poolCurrencies
.sort((_, b) => (b.displayName.toLowerCase().includes('usdc') ? 1 : -1))
.map((c) => ({ value: c.symbol, label: c.displayName }))}
style={{ textAlign: 'right' }}
/>
) : (
Expand Down

0 comments on commit 79aaab0

Please sign in to comment.