Skip to content

Commit

Permalink
add default sorting and checkmarks to dropdown menus
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Dec 20, 2024
1 parent 572edec commit d1f5b01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/components/Discover/TrendingTokens.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DropdownMenu } from '@/components/DropdownMenu';
import { DropdownMenu, MenuItem } from '@/components/DropdownMenu';
import { globalColors, Text, TextIcon, useBackgroundColor, useColorMode } from '@/design-system';
import { useForegroundColor } from '@/design-system/color/useForegroundColor';

Expand Down Expand Up @@ -571,6 +571,7 @@ function TimeFilter() {
menuConfig={{
menuItems: timeFilters.map(time => ({
actionTitle: i18n.t(t.filters.time[time]),
menuState: time === timeframe ? 'on' : 'off',
actionKey: time,
})),
}}
Expand All @@ -597,12 +598,11 @@ function SortFilter() {
return (
<DropdownMenu
menuConfig={{
menuItems: sortFilters
.filter(s => s !== 'RECOMMENDED')
.map(sort => ({
actionTitle: i18n.t(t.filters.sort[sort]),
actionKey: sort,
})),
menuItems: sortFilters.map(s => ({
actionTitle: i18n.t(t.filters.sort[s]),
menuState: s === sort ? 'on' : 'off',
actionKey: s,
})),
}}
side="bottom"
onPressMenuItem={selection => {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,7 @@
"FARCASTER": "Farcaster"
},
"sort": {
"RECOMMENDED": "Sort",
"RECOMMENDED": "Default",
"VOLUME": "Volume",
"MARKET_CAP": "Market Cap",
"TOP_GAINERS": "Top Gainers",
Expand Down

0 comments on commit d1f5b01

Please sign in to comment.