Skip to content

Commit 52b301c

Browse files
committed
Merge branch 'main' of github.com:blockworks-foundation/mango-v4-ui
2 parents daa49ea + 9d42fed commit 52b301c

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

pages/dashboard/index.tsx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@ const Dashboard: NextPage = () => {
194194

195195
const sortByTier = (tier: string | undefined) => {
196196
const tierOrder: Record<string, number> = {
197-
AAA: 0,
198-
AA: 1,
199-
A: 2,
200-
'A-': 3,
201-
BBB: 4,
202-
BB: 5,
203-
B: 6,
204-
C: 7,
197+
S: 0,
198+
AAA: 1,
199+
AA: 2,
200+
A: 3,
201+
'A-': 4,
202+
BBB: 5,
203+
BB: 6,
204+
B: 7,
205+
C: 8,
206+
D: 9,
205207
}
206208
if (tier) {
207209
return tierOrder[tier]
@@ -266,25 +268,20 @@ const Dashboard: NextPage = () => {
266268
<h3 className="mb-3 mt-6 flex text-base text-th-fgd-3">
267269
<span>Banks</span>
268270
<span className="ml-auto pr-12 text-sm font-normal">
269-
Current / <span className="text-th-success">Suggested</span>{' '}
271+
Current / <span className="text-th-success">Detected</span>{' '}
270272
</span>
271273
</h3>
272274
<div className="border-b border-th-bkg-3">
273275
{banks
274276
.sort((a, b) => {
275-
const aTier = getSuggestedAndCurrentTier(a, midPriceImp)
276-
const bTier = getSuggestedAndCurrentTier(b, midPriceImp)
277277
const aIsReduceOnly = a.areDepositsReduceOnly()
278278
const bIsReduceOnly = b.areDepositsReduceOnly()
279279
if (aIsReduceOnly && !bIsReduceOnly) {
280280
return 1
281281
} else if (!aIsReduceOnly && bIsReduceOnly) {
282282
return -1
283283
} else {
284-
return (
285-
sortByTier(aTier?.currentTier?.preset_name) -
286-
sortByTier(bTier?.currentTier?.preset_name)
287-
)
284+
return sortByTier(a.tier) - sortByTier(b.tier)
288285
}
289286
})
290287
.map((bank, i) => {
@@ -944,10 +941,10 @@ const BankDisclosure = ({
944941
</div>
945942
<div className="flex items-center space-x-3">
946943
<div className="flex space-x-2">
947-
<div>{currentTier?.preset_name}</div>
944+
<div>{formattedBankValues.tier}</div>
948945
<div>/</div>
949946
<div className="text-th-success">
950-
{LISTING_PRESETS[suggestedTierKey].preset_name}
947+
{currentTier?.preset_name}
951948
</div>
952949
</div>
953950
<ChevronDownIcon

0 commit comments

Comments
 (0)