-
Notifications
You must be signed in to change notification settings - Fork 638
Clusters Feature Integration #2816
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
Closed
Closed
Changes from all commits
Commits
Show all changes
133 commits
Select commit
Hold shift + click to select a range
09aff98
adds clusters api configs
ayv8er 18eeee5
adds clusters api configs
ayv8er 3e8c016
adds api types
ayv8er 073ff24
adds props routes and titles for cluster pages
ayv8er 98c2ac4
adds query param enum for clusters api
ayv8er ebc3b21
adds clusters svg
ayv8er 416e1ac
adds dynamic page routes
ayv8er 489f650
adds clusters entity ui in ui/shared/entities
ayv8er 3c78b55
adds functions to detect input type; will be used to check whether a …
ayv8er bcc9f55
adds stubs for loading skeleton view
ayv8er ba2481a
adds pagination hook
ayv8er 6e82802
adds query param hooks for clusters trpc endpoints
ayv8er e3176db
adds query param hooks for clusters trpc endpoints
ayv8er f51fb65
adds components that make up the /clusters ui
ayv8er 7abf89a
adds components for /cluster ui
ayv8er 283ca0a
adds clusters api endpoint to query by cluster id
ayv8er 31d0ae5
implements call to cluster id endpoint to get ac
ayv8er 7603627
adds clusters search types and in api category
ayv8er 0f30607
creates clusters search hook and wraps useQuickSearchQuery hook
ayv8er c5698ff
replaces useQuickSearchQuery for useSearchWithClusters hook for both …
ayv8er a2e02f1
add search suggestion ui
ayv8er b75739b
adds optional chaining to handle react re-render when search type cha…
ayv8er f50021c
adds cluster ui to ui/pages/address on address details
ayv8er 912538f
prevents clicking on cluster suggestion if address is non EVM
ayv8er 5c66c45
adds util functions for testability along with tests, for action bar …
ayv8er d74ebe0
refactor - extract clusters display logic wit
ayv8er 370a674
refactor: extract page utilities from Clusters.tsx with tests
ayv8er 9a11dc3
adds jest testing infra for react components
ayv8er 265788d
adds hook testing coverage
ayv8er 5176607
adds component and integration tests
ayv8er 182daae
adds detectInputType util tests
ayv8er fb4f80a
removes generic parameters from clusters pagination types
ayv8er 1603710
replaces any type with proper cluster config types
ayv8er aaa02d1
adds cluster routes to metadata and analytics mappings
ayv8er a21d2fd
updates order and stacks action bar items vertically when mobile view
ayv8er 9888e77
repositions clusters logo
ayv8er 88af76f
refactors search logic to render community clusters in search sugge
ayv8er 75133fc
adding clusters env vars
ayv8er d37f17d
centers directory/leaderboard toggle in mobile view
ayv8er 057d8e6
resizes and sets proper color to logo in entity component
ayv8er 304766d
hides clusters nav when clusters env is missing
ayv8er ae4a40e
removes duplicate trailing slashes in cluster community names
ayv8er 54c816f
Bump `react` to v19 (#2782)
maxaleks c4ad60c
change links to ton explorer
tom2drum 38f9fed
fix internal links in ENVS.md file
tom2drum 98277c2
tx info: tac operation stage could be an array
tom2drum 65ea2a5
fix display of ad banner
maxaleks 6a0ff19
tac ui updates
tom2drum 7f8c6c2
add more "button click" events
tom2drum 1f33137
update clock icon
tom2drum 7caeec4
update screenshots
tom2drum 27a601f
fix age filter reset
isstuev 095c2d9
change tac operation status once again
tom2drum 7076d36
fix address icon tooltip content
tom2drum 24114c9
[skip ci] label released issues workflow: don't override release tag …
tom2drum dd0c1e3
puzzle-15 (#2471)
isstuev 7fc0cf4
fix testnet and rollup stage badges
tom2drum 090fcfd
New styles for pagination and "Add / Remove" buttons (#2791)
tom2drum a5c8693
Gas tracker: bug fixes and improvements (#2792)
tom2drum c2b8d30
Public tags form improvements (#2796)
tom2drum 2b602a4
NFT marketplaces: make `collection_url` and `instance_url ` optional …
tom2drum 52d481e
Bump brace-expansion from 1.1.11 to 1.1.12 in /deploy/tools/affected-…
dependabot[bot] 82992d6
allow toaster to render custom description
tom2drum 7b168f8
Encode the address hash for links to the TON chain (#2813)
tom2drum 5adc1d8
Support redirects for known address discrepancies (#2799)
tom2drum 97c31e9
Celo: support L2 epochs (#2784)
tom2drum 1864a82
Icons in footer links (#2809)
tom2drum 01557d2
Metadata: send address to fetchers once visited (#2814)
tom2drum c153dde
replaces jest-dom matchers with standard matchers
ayv8er fadeb3b
makes /clusters page default view the directory instead of leaderboar…
ayv8er 99b687e
updates columnn name from backing to total backing, in leaderboard di…
ayv8er 3e07a7f
alphabetically reorders clusters export
ayv8er 387f225
adds Cluster section to the Table of Cont
ayv8er c2f506a
removes redundant Flex component wrapper around ClustersEntity
ayv8er 671fdc7
uses standard toolkit values for border radius and color
ayv8er 979eea5
uses getFeaturePayload util instead of type coercion
ayv8er 1ff5248
extends ImageProps interface to ClusterIconProps, and uses getFeature…
ayv8er 4527410
adds evm address regexp in regexp.ts as single source of truth
ayv8er 76928cd
updates imports for files that used form validator address regexp to …
ayv8er 4458aee
removes unused args, unnecessary type coercions and memoizations. upp…
ayv8er 98c8e6c
sets correct action bar height using ACTION_BAR_HEIGHT_DESKTOP constant
ayv8er ee79771
implements TimeFormatToggle to Joined column
ayv8er bff04df
simplifies conditionals and removes unnecessary Box component wrapper
ayv8er 4847ec6
displays standard 404 error screen on erroneous ClusterDetails query
ayv8er 8bc9b8d
standardizes details page to display ETH value and time in line with …
ayv8er e0850bc
removes redundant debouncing
ayv8er 3084704
moves useQueryParams hook to lib/router and updates imports and test …
ayv8er e0f0b74
moves config.features.cluster
ayv8er 77cfe87
removes unnecessary 3rd column and isContractVerified since it is alw…
ayv8er 6807e95
checks clusters enable for placeholder
ayv8er ab0ddf6
makes isClusterClickable condition more generic for future repurpose
ayv8er 3168dce
splits isEvmAddress out to general purpose utility in lib/address, up…
ayv8er 1456acf
moves all cluster hooks and tests to lib/clusters folder
ayv8er 5b6d0ab
wraps action bar with standard button wrapper
ayv8er 7b86f70
makes nextjs-routes mock condition stricter
ayv8er ee589ba
adds mock clusters api data
ayv8er 50f5cbb
adds pw tests for cluster detail page
ayv8er 80e9dab
adds pw tests for clusters directory page
ayv8er b195776
adds pw tests for clustersentity ui component
ayv8er f46c569
adds mock envs for pw tests
ayv8er 844ed54
adds clusters api host and cdn url to env.pw
ayv8er a9fafeb
fixes resolve react-hooks/rules-of-hooks violation in cluster search …
ayv8er 5374fb2
throws error instead of using app error component
ayv8er 95b16ba
uses semantic token to reference color as per standard method in chak…
ayv8er 4b855f7
removes empty or loading state pw tests
ayv8er e379292
pw tests - uses mockAssetResponse for icons, removes redundant tests,…
ayv8er 1583a20
migrates all clusters pw tests from page.route to mockApiResponse
ayv8er 47426b1
updates docker generated pw screenshots
ayv8er e87e345
removes object cloning in useSearchWithClusters hook
ayv8er 441ccc2
uses standardized chakra name for backgroundColor
ayv8er 510afad
resolves Clusters.pw.tsx docker screen generation issues and updates …
ayv8er 4a47831
removes unneeded screenshots for Cluster.pw.tsx
ayv8er e86ac70
standardizes mobile testing approach with +@mobile tag by removing ex…
ayv8er a3cc84b
reverts expanded pw test coverage for ClustersEntity
ayv8er f7d6e92
removes all clusters pw screenshots
ayv8er dc07db6
removes nested describe which was resulting in a failed test
ayv8er 20baa35
uploads latest docker generated screenshots for pw
ayv8er ef55984
force trigger for conflict check
ayv8er 079ea87
Merge remote-tracking branch 'upstream/main' into clusters-page
ayv8er 10fe80b
removes repeating var from blockchainNavItems array
ayv8er 519a41a
fix screenshot merge conflicts - use upstream versions
ayv8er f7f73bf
updates yarn.lock with upstream lib
ayv8er def146e
fix jest tests by mocking useQuery directly to resolve QueryClient co…
ayv8er 91758bb
creates global mock object and proper typing to reduce duplication
ayv8er 5521e62
updates clusters pw screenshots with docker generation. update helia …
ayv8er 082959b
updates yarn.lock
ayv8er 06e3e9d
Merge branch 'main' into clusters-page
ayv8er 011dbbd
removes unused imports from upstream/main
ayv8er eea01dc
add vite aliases for @libp2p/utils and @helia/verified-fetch to resol…
ayv8er 8b55892
updates pw screenshots for hero banner, home page and desktop header
ayv8er dbe21aa
downgrades helia to v2.6.12
ayv8er d24db05
revert changes in yarn.lock file related to helia package
ayv8er 314639a
updates yarn.lock with helia downgrade
ayv8er 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import type { Feature } from './types'; | ||
|
|
||
| import apis from '../apis'; | ||
| import { getEnvValue } from '../utils'; | ||
|
|
||
| const title = 'Clusters Universal Name Service'; | ||
|
|
||
| const config: Feature<{ cdnUrl: string }> = (() => { | ||
| const cdnUrl = getEnvValue('NEXT_PUBLIC_CLUSTERS_CDN_URL') || 'https://cdn.clusters.xyz'; | ||
|
|
||
| if (apis.clusters) { | ||
| return Object.freeze({ | ||
| title, | ||
| isEnabled: true, | ||
| cdnUrl, | ||
| }); | ||
| } | ||
|
|
||
| return Object.freeze({ | ||
| title, | ||
| isEnabled: false, | ||
| cdnUrl, | ||
| }); | ||
| })(); | ||
|
|
||
| export default config; |
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| module.exports = { | ||
| route: jest.fn((opts) => { | ||
| const pathname = opts?.pathname; | ||
| const query = opts?.query || {}; | ||
|
|
||
| if (pathname === '/address/[hash]') { | ||
| return `/address/${ query.hash || 'test-hash' }`; | ||
| } | ||
| if (pathname === '/tx/[hash]') { | ||
| return `/tx/${ query.hash || 'test-hash' }`; | ||
| } | ||
| if (pathname === '/clusters/[name]') { | ||
| return `/clusters/${ query.name || 'test-cluster' }`; | ||
| } | ||
|
|
||
| return pathname || '/'; | ||
| }), | ||
| }; |
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 @@ | ||
| module.exports = 'test-file-stub'; |
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,12 @@ | ||
| module.exports = { | ||
| useClickAway: jest.fn(() => jest.fn()), | ||
| useEventListener: jest.fn(), | ||
| useLocalStorage: jest.fn(() => [ '', jest.fn() ]), | ||
| useSessionStorage: jest.fn(() => [ '', jest.fn() ]), | ||
| useToggle: jest.fn(() => [ false, jest.fn() ]), | ||
| useDebounce: jest.fn((value) => value), | ||
| useThrottle: jest.fn((value) => value), | ||
| usePrevious: jest.fn(), | ||
| useCounter: jest.fn(() => ({ count: 0, increment: jest.fn(), decrement: jest.fn(), reset: jest.fn() })), | ||
| useCopyToClipboard: jest.fn(() => [ '', jest.fn() ]), | ||
| }; |
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,6 @@ | ||
| import { ADDRESS_REGEXP } from 'toolkit/utils/regexp'; | ||
|
|
||
| export function isEvmAddress(address: string): boolean { | ||
| if (!address) return false; | ||
| return ADDRESS_REGEXP.test(address.trim()); | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import type { ApiResource } from '../types'; | ||
| import type { | ||
| ClustersByAddressResponse, | ||
| ClusterByNameResponse, | ||
| ClustersLeaderboardResponse, | ||
| ClustersDirectoryResponse, | ||
| ClustersByAddressQueryParams, | ||
| ClusterByNameQueryParams, | ||
| ClustersLeaderboardQueryParams, | ||
| ClustersDirectoryQueryParams, | ||
| ClusterByIdQueryParams, | ||
| ClusterByIdResponse, | ||
| } from 'types/api/clusters'; | ||
|
|
||
| export const CLUSTERS_API_RESOURCES = { | ||
| get_clusters_by_address: { | ||
| path: '/v1/trpc/names.getNamesByOwnerAddress', | ||
| pathParams: [], | ||
| }, | ||
| get_cluster_by_name: { | ||
| path: '/v1/trpc/names.get', | ||
| pathParams: [], | ||
| }, | ||
| get_cluster_by_id: { | ||
| path: '/v1/trpc/clusters.getClusterById', | ||
| pathParams: [], | ||
| }, | ||
| get_leaderboard: { | ||
| path: '/v1/trpc/names.leaderboard', | ||
| pathParams: [], | ||
| }, | ||
| get_directory: { | ||
| path: '/v1/trpc/names.search', | ||
| pathParams: [], | ||
| }, | ||
| } satisfies Record<string, ApiResource>; | ||
|
|
||
| export type ClustersApiResourceName = `clusters:${ keyof typeof CLUSTERS_API_RESOURCES }`; | ||
|
|
||
| export type ClustersApiResourcePayload<R extends ClustersApiResourceName> = | ||
| R extends 'clusters:get_clusters_by_address' ? ClustersByAddressResponse : | ||
| R extends 'clusters:get_cluster_by_name' ? ClusterByNameResponse : | ||
| R extends 'clusters:get_cluster_by_id' ? ClusterByIdResponse : | ||
| R extends 'clusters:get_leaderboard' ? ClustersLeaderboardResponse : | ||
| R extends 'clusters:get_directory' ? ClustersDirectoryResponse : | ||
| never; | ||
|
|
||
| export type ClustersApiQueryParams<R extends ClustersApiResourceName> = | ||
| R extends 'clusters:get_clusters_by_address' ? ClustersByAddressQueryParams : | ||
| R extends 'clusters:get_cluster_by_name' ? ClusterByNameQueryParams : | ||
| R extends 'clusters:get_cluster_by_id' ? ClusterByIdQueryParams : | ||
| R extends 'clusters:get_leaderboard' ? ClustersLeaderboardQueryParams : | ||
| R extends 'clusters:get_directory' ? ClustersDirectoryQueryParams : | ||
| never; | ||
|
|
||
| export type ClustersApiPaginationFilters = never; | ||
| export type ClustersApiPaginationSorting = never; |
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
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.