Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
8414b870
Commit
8414b870
authored
Nov 25, 2024
by
tom
Committed by
tom goriunov
Nov 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change priority for pre-defined tags
parent
b5bde81f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
Address.tsx
ui/pages/Address.tsx
+7
-6
Token.pw.tsx_default_bridged-token-1.png
.../__screenshots__/Token.pw.tsx_default_bridged-token-1.png
+0
-0
TokenPageTitle.tsx
ui/token/TokenPageTitle.tsx
+9
-2
No files found.
ui/pages/Address.tsx
View file @
8414b870
...
@@ -57,6 +57,7 @@ import PageTitle from 'ui/shared/Page/PageTitle';
...
@@ -57,6 +57,7 @@ import PageTitle from 'ui/shared/Page/PageTitle';
import
RoutedTabs
from
'
ui/shared/Tabs/RoutedTabs
'
;
import
RoutedTabs
from
'
ui/shared/Tabs/RoutedTabs
'
;
const
TOKEN_TABS
=
[
'
tokens_erc20
'
,
'
tokens_nfts
'
,
'
tokens_nfts_collection
'
,
'
tokens_nfts_list
'
];
const
TOKEN_TABS
=
[
'
tokens_erc20
'
,
'
tokens_nfts
'
,
'
tokens_nfts_collection
'
,
'
tokens_nfts_list
'
];
const
PREDEFINED_TAG_PRIORITY
=
100
;
const
txInterpretation
=
config
.
features
.
txInterpretation
;
const
txInterpretation
=
config
.
features
.
txInterpretation
;
const
addressProfileAPIFeature
=
config
.
features
.
addressProfileAPI
;
const
addressProfileAPIFeature
=
config
.
features
.
addressProfileAPI
;
...
@@ -275,12 +276,12 @@ const AddressPageContent = () => {
...
@@ -275,12 +276,12 @@ const AddressPageContent = () => {
const tags: Array<EntityTag> = React.useMemo(() => {
const tags: Array<EntityTag> = React.useMemo(() => {
return [
return [
...(addressQuery.data?.public_tags?.map((tag) => ({ slug: tag.label, name: tag.display_name, tagType: 'custom' as const, ordinal: -1 })) || []),
...(addressQuery.data?.public_tags?.map((tag) => ({ slug: tag.label, name: tag.display_name, tagType: 'custom' as const, ordinal: -1 })) || []),
!addressQuery.data?.is_contract ? { slug: 'eoa', name: 'EOA', tagType: 'custom' as const, ordinal:
-1
} : undefined,
!addressQuery.data?.is_contract ? { slug: 'eoa', name: 'EOA', tagType: 'custom' as const, ordinal:
PREDEFINED_TAG_PRIORITY
} : undefined,
config.features.validators.isEnabled && addressQuery.data?.has_validated_blocks ?
config.features.validators.isEnabled && addressQuery.data?.has_validated_blocks ?
{ slug: 'validator', name: 'Validator', tagType: 'custom' as const, ordinal:
10
} :
{ slug: 'validator', name: 'Validator', tagType: 'custom' as const, ordinal:
PREDEFINED_TAG_PRIORITY
} :
undefined,
undefined,
addressQuery.data?.implementations?.length ? { slug: 'proxy', name: 'Proxy', tagType: 'custom' as const, ordinal:
-1
} : undefined,
addressQuery.data?.implementations?.length ? { slug: 'proxy', name: 'Proxy', tagType: 'custom' as const, ordinal:
PREDEFINED_TAG_PRIORITY
} : undefined,
addressQuery.data?.token ? { slug: 'token', name: 'Token', tagType: 'custom' as const, ordinal:
-1
} : undefined,
addressQuery.data?.token ? { slug: 'token', name: 'Token', tagType: 'custom' as const, ordinal:
PREDEFINED_TAG_PRIORITY
} : undefined,
isSafeAddress ? { slug: 'safe', name: 'Multisig: Safe', tagType: 'custom' as const, ordinal: -10 } : undefined,
isSafeAddress ? { slug: 'safe', name: 'Multisig: Safe', tagType: 'custom' as const, ordinal: -10 } : undefined,
addressProfileAPIFeature.isEnabled && usernameApiTag ? {
addressProfileAPIFeature.isEnabled && usernameApiTag ? {
slug: 'username_api',
slug: 'username_api',
...
@@ -295,10 +296,10 @@ const AddressPageContent = () => {
...
@@ -295,10 +296,10 @@ const AddressPageContent = () => {
},
},
} : undefined,
} : undefined,
config.features.userOps.isEnabled && userOpsAccountQuery.data ?
config.features.userOps.isEnabled && userOpsAccountQuery.data ?
{ slug: 'user_ops_acc', name: 'Smart contract wallet', tagType: 'custom' as const, ordinal:
-10
} :
{ slug: 'user_ops_acc', name: 'Smart contract wallet', tagType: 'custom' as const, ordinal:
PREDEFINED_TAG_PRIORITY
} :
undefined,
undefined,
config.features.mudFramework.isEnabled && mudTablesCountQuery.data ?
config.features.mudFramework.isEnabled && mudTablesCountQuery.data ?
{ slug: 'mud', name: 'MUD World', tagType: 'custom' as const, ordinal:
-10
} :
{ slug: 'mud', name: 'MUD World', tagType: 'custom' as const, ordinal:
PREDEFINED_TAG_PRIORITY
} :
undefined,
undefined,
...formatUserTags(addressQuery.data),
...formatUserTags(addressQuery.data),
...(addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags.filter(tag => tag.tagType !== 'note') || []),
...(addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags.filter(tag => tag.tagType !== 'note') || []),
...
...
ui/pages/__screenshots__/Token.pw.tsx_default_bridged-token-1.png
View replaced file @
b5bde81f
View file @
8414b870
51.7 KB
|
W:
|
H:
51.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/token/TokenPageTitle.tsx
View file @
8414b870
...
@@ -27,6 +27,8 @@ import PageTitle from 'ui/shared/Page/PageTitle';
...
@@ -27,6 +27,8 @@ import PageTitle from 'ui/shared/Page/PageTitle';
import
TokenVerifiedInfo
from
'
./TokenVerifiedInfo
'
;
import
TokenVerifiedInfo
from
'
./TokenVerifiedInfo
'
;
const
PREDEFINED_TAG_PRIORITY
=
100
;
interface
Props
{
interface
Props
{
tokenQuery
:
UseQueryResult
<
TokenInfo
,
ResourceError
<
unknown
>>
;
tokenQuery
:
UseQueryResult
<
TokenInfo
,
ResourceError
<
unknown
>>
;
addressQuery
:
UseQueryResult
<
Address
,
ResourceError
<
unknown
>>
;
addressQuery
:
UseQueryResult
<
Address
,
ResourceError
<
unknown
>>
;
...
@@ -69,13 +71,18 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
...
@@ -69,13 +71,18 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
const
tags
:
Array
<
EntityTag
>
=
React
.
useMemo
(()
=>
{
const
tags
:
Array
<
EntityTag
>
=
React
.
useMemo
(()
=>
{
return
[
return
[
tokenQuery
.
data
?
{
slug
:
tokenQuery
.
data
?.
type
,
name
:
getTokenTypeName
(
tokenQuery
.
data
.
type
),
tagType
:
'
custom
'
as
const
,
ordinal
:
-
20
}
:
undefined
,
tokenQuery
.
data
?
{
slug
:
tokenQuery
.
data
?.
type
,
name
:
getTokenTypeName
(
tokenQuery
.
data
.
type
),
tagType
:
'
custom
'
as
const
,
ordinal
:
PREDEFINED_TAG_PRIORITY
,
}
:
undefined
,
config
.
features
.
bridgedTokens
.
isEnabled
&&
tokenQuery
.
data
?.
is_bridged
?
config
.
features
.
bridgedTokens
.
isEnabled
&&
tokenQuery
.
data
?.
is_bridged
?
{
{
slug
:
'
bridged
'
,
slug
:
'
bridged
'
,
name
:
'
Bridged
'
,
name
:
'
Bridged
'
,
tagType
:
'
custom
'
as
const
,
tagType
:
'
custom
'
as
const
,
ordinal
:
-
10
,
ordinal
:
PREDEFINED_TAG_PRIORITY
,
meta
:
{
bgColor
:
bridgedTokenTagBgColor
,
textColor
:
bridgedTokenTagTextColor
},
meta
:
{
bgColor
:
bridgedTokenTagBgColor
,
textColor
:
bridgedTokenTagTextColor
},
}
:
}
:
undefined
,
undefined
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment