-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: social - traders list leaderboard #28170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zone-live
wants to merge
40
commits into
main
Choose a base branch
from
TSA-114-traders-list-leaderboard
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
3731883
chore: adds the initial setup for leaderboard
zone-live 56fe30f
chore: review points
zone-live b315bbc
chore: tests update
zone-live 60c8de0
chore: update
zone-live e615d55
chore: UI update
zone-live 434c01b
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 84d9e79
chore: button foolow | following
zone-live 8d75c90
chore: integrates core controller and service in the Top Traders feature
zone-live 154509c
chore: api url
zone-live 0f5f7d0
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 0d54e09
chore: mock useQuery
zone-live 8f74d86
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 7de904b
chore: lock update
zone-live dac5f62
chore: adds mocked data
zone-live e9a1a06
chore: adds mocked data
zone-live f5cb2b0
chore: calls the Social Dev API
zone-live 0529476
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 360ecef
chore: update test
zone-live 8f4558a
chore: update initial-background-state.json
zone-live 7422558
chore: update snapshots
zone-live 955b334
chore: fix addCommas
zone-live 0764134
chore: update and clean up
zone-live 3d3ddd5
chore: update and clean up
zone-live bbe85b2
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 7d94c98
chore: update api url
zone-live cbd6b28
Merge branch 'TSA-114-traders-list-leaderboard' of github.com:MetaMas…
zone-live 86ea0af
chore: test update
zone-live 2c77bd3
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 40d3e3f
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 6c07b42
chore: update preview package
zone-live 63af6e2
chore: update formatPnl
zone-live a1bfd8d
chore: test update
zone-live e77a8b6
chore: review updates
zone-live d3d82f5
chore: logger fix and preview package update
zone-live 82d18a2
chore: dedupe
zone-live 9a904d9
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 5554c47
chore: remove preview package and add correct one
zone-live e2b056d
Merge branch 'main' into TSA-114-traders-list-leaderboard
zone-live 5f9424f
chore: review update and lint fix
zone-live 5881e59
chore: review update
zone-live File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
app/components/Views/Homepage/Sections/TopTraders/components/NetworkFilterButton.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import React from 'react'; | ||
| import { TouchableOpacity, View } from 'react-native'; | ||
| import { useTailwind } from '@metamask/design-system-twrnc-preset'; | ||
| import { | ||
| Text, | ||
| Icon, | ||
| IconName, | ||
| IconColor, | ||
| IconSize, | ||
| } from '@metamask/design-system-react-native'; | ||
| import { strings } from '../../../../../../../locales/i18n'; | ||
| import type { NetworkFilterSelection } from '../types'; | ||
|
|
||
| export interface NetworkFilterButtonProps { | ||
| /** Currently selected network label (null = All networks) */ | ||
| selectedNetwork: NetworkFilterSelection; | ||
| /** Called when the user taps the button */ | ||
| onPress: () => void; | ||
| testID?: string; | ||
| } | ||
|
|
||
| /** | ||
| * NetworkFilterButton — compact dropdown-style button for filtering by network. | ||
| * | ||
| * Follows the same visual pattern as the FilterButton in the Trending section. | ||
| * Tapping opens the TrendingTokenNetworkBottomSheet managed by the parent. | ||
| */ | ||
| const NetworkFilterButton: React.FC<NetworkFilterButtonProps> = ({ | ||
| selectedNetwork, | ||
| onPress, | ||
| testID, | ||
| }) => { | ||
| const tw = useTailwind(); | ||
|
|
||
| const label = selectedNetwork ?? strings('social_leaderboard.all_networks'); | ||
zone-live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return ( | ||
| <TouchableOpacity | ||
| testID={testID ?? 'top-traders-network-filter-button'} | ||
| onPress={onPress} | ||
| style={tw.style('self-start rounded-lg bg-muted py-2 px-3')} | ||
| activeOpacity={0.2} | ||
| > | ||
| <View style={tw`flex-row items-center justify-center gap-1`}> | ||
| <Text | ||
| twClassName="text-[14px] font-semibold text-default" | ||
| numberOfLines={1} | ||
| > | ||
| {label} | ||
| </Text> | ||
| <Icon | ||
| name={IconName.ArrowDown} | ||
| color={IconColor.IconAlternative} | ||
| size={IconSize.Xs} | ||
| /> | ||
| </View> | ||
| </TouchableOpacity> | ||
| ); | ||
| }; | ||
|
|
||
| export default NetworkFilterButton; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.