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
1cea43f7
Commit
1cea43f7
authored
May 07, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename meta props
parent
349813a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
parseMetaPayload.ts
lib/address/parseMetaPayload.ts
+4
-4
addressMetadata.ts
types/api/addressMetadata.ts
+3
-3
AppActionButton.tsx
ui/shared/AppActionButton/AppActionButton.tsx
+5
-5
useAppActionData.tsx
ui/shared/AppActionButton/useAppActionData.tsx
+1
-1
No files found.
lib/address/parseMetaPayload.ts
View file @
1cea43f7
...
@@ -16,15 +16,15 @@ export default function parseMetaPayload(meta: AddressMetadataTag['meta']): Addr
...
@@ -16,15 +16,15 @@ export default function parseMetaPayload(meta: AddressMetadataTag['meta']): Addr
const
stringFields
:
Array
<
keyof
MetaParsed
>
=
[
const
stringFields
:
Array
<
keyof
MetaParsed
>
=
[
'
textColor
'
,
'
textColor
'
,
'
bgColor
'
,
'
bgColor
'
,
'
actionURL
'
,
'
appID
'
,
'
logoURL
'
,
'
text
'
,
'
tagUrl
'
,
'
tagUrl
'
,
'
tooltipIcon
'
,
'
tooltipIcon
'
,
'
tooltipTitle
'
,
'
tooltipTitle
'
,
'
tooltipDescription
'
,
'
tooltipDescription
'
,
'
tooltipUrl
'
,
'
tooltipUrl
'
,
'
appID
'
,
'
appMarketplaceURL
'
,
'
appLogoURL
'
,
'
appActionButtonText
'
,
];
];
for
(
const
stringField
of
stringFields
)
{
for
(
const
stringField
of
stringFields
)
{
...
...
types/api/addressMetadata.ts
View file @
1cea43f7
...
@@ -26,9 +26,9 @@ export interface AddressMetadataTagApi extends Omit<AddressMetadataTag, 'meta'>
...
@@ -26,9 +26,9 @@ export interface AddressMetadataTagApi extends Omit<AddressMetadataTag, 'meta'>
tooltipTitle
?:
string
;
tooltipTitle
?:
string
;
tooltipDescription
?:
string
;
tooltipDescription
?:
string
;
tooltipUrl
?:
string
;
tooltipUrl
?:
string
;
actionURL
?:
string
;
appID
?:
string
;
appID
?:
string
;
logoURL
?:
string
;
appMarketplaceURL
?:
string
;
text
?:
string
;
appLogoURL
?:
string
;
appActionButtonText
?:
string
;
}
|
null
;
}
|
null
;
}
}
ui/shared/AppActionButton/AppActionButton.tsx
View file @
1cea43f7
...
@@ -21,9 +21,9 @@ const AppActionButton = ({ data, className, txHash, source }: Props) => {
...
@@ -21,9 +21,9 @@ const AppActionButton = ({ data, className, txHash, source }: Props) => {
const
defaultTextColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
const
defaultTextColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
const
defaultBg
=
useColorModeValue
(
'
gray.100
'
,
'
gray.700
'
);
const
defaultBg
=
useColorModeValue
(
'
gray.100
'
,
'
gray.700
'
);
const
{
appID
,
textColor
,
bgColor
,
text
,
l
ogoURL
}
=
data
;
const
{
appID
,
textColor
,
bgColor
,
appActionButtonText
,
appL
ogoURL
}
=
data
;
const
actionURL
=
data
.
a
ction
URL
?.
replace
(
'
{chainId}
'
,
config
.
chain
.
id
||
''
).
replace
(
'
{txHash}
'
,
txHash
||
''
);
const
actionURL
=
data
.
a
ppMarketplace
URL
?.
replace
(
'
{chainId}
'
,
config
.
chain
.
id
||
''
).
replace
(
'
{txHash}
'
,
txHash
||
''
);
const
handleClick
=
React
.
useCallback
(()
=>
{
const
handleClick
=
React
.
useCallback
(()
=>
{
const
info
=
appID
||
actionURL
;
const
info
=
appID
||
actionURL
;
...
@@ -35,14 +35,14 @@ const AppActionButton = ({ data, className, txHash, source }: Props) => {
...
@@ -35,14 +35,14 @@ const AppActionButton = ({ data, className, txHash, source }: Props) => {
const
content
=
(
const
content
=
(
<>
<>
<
Image
<
Image
src=
{
l
ogoURL
}
src=
{
appL
ogoURL
}
alt=
{
`${
t
ext } button`
}
alt=
{
`${
appActionButtonT
ext } button`
}
boxSize=
{
5
}
boxSize=
{
5
}
borderRadius=
"sm"
borderRadius=
"sm"
mr=
{
2
}
mr=
{
2
}
/>
/>
<
Text
fontSize=
"sm"
fontWeight=
"500"
color=
"currentColor"
>
<
Text
fontSize=
"sm"
fontWeight=
"500"
color=
"currentColor"
>
{
t
ext
}
{
appActionButtonT
ext
}
</
Text
>
</
Text
>
</>
</>
);
);
...
...
ui/shared/AppActionButton/useAppActionData.tsx
View file @
1cea43f7
...
@@ -7,7 +7,7 @@ export default function useAppActionData(address: string | undefined = '') {
...
@@ -7,7 +7,7 @@ export default function useAppActionData(address: string | undefined = '') {
const
{
data
}
=
useAddressMetadataInfoQuery
(
memoizedArray
);
const
{
data
}
=
useAddressMetadataInfoQuery
(
memoizedArray
);
const
metadata
=
data
?.
addresses
[
address
?.
toLowerCase
()];
const
metadata
=
data
?.
addresses
[
address
?.
toLowerCase
()];
const
tag
=
metadata
?.
tags
?.
find
(({
tagType
})
=>
tagType
===
'
protocol
'
);
const
tag
=
metadata
?.
tags
?.
find
(({
tagType
})
=>
tagType
===
'
protocol
'
);
if
(
tag
?.
meta
?.
a
ction
URL
||
tag
?.
meta
?.
appID
)
{
if
(
tag
?.
meta
?.
a
ppMarketplace
URL
||
tag
?.
meta
?.
appID
)
{
return
tag
.
meta
;
return
tag
.
meta
;
}
}
return
null
;
return
null
;
...
...
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