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
324af2cc
Commit
324af2cc
authored
May 07, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename vars
parent
f5c890f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
31 deletions
+33
-31
AppActionButton.tsx
ui/shared/AppActionButton/AppActionButton.tsx
+2
-2
useAppActionData.tsx
ui/shared/AppActionButton/useAppActionData.tsx
+1
-1
TokenDetails.tsx
ui/token/TokenDetails.tsx
+8
-8
TokenNftMarketplaces.tsx
ui/token/TokenNftMarketplaces.tsx
+7
-7
TokenInstanceDetails.tsx
ui/tokenInstance/TokenInstanceDetails.tsx
+8
-8
TxSubHeading.tsx
ui/tx/TxSubHeading.tsx
+7
-5
No files found.
ui/shared/A
ctionButton/
ActionButton.tsx
→
ui/shared/A
ppActionButton/App
ActionButton.tsx
View file @
324af2cc
...
...
@@ -17,7 +17,7 @@ type Props = {
source
:
'
Txn
'
|
'
NFT collection
'
|
'
NFT item
'
;
}
const
ActionButton
=
({
data
,
className
,
txHash
,
source
}:
Props
)
=>
{
const
A
ppA
ctionButton
=
({
data
,
className
,
txHash
,
source
}:
Props
)
=>
{
const
defaultTextColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
const
defaultBg
=
useColorModeValue
(
'
gray.100
'
,
'
gray.700
'
);
...
...
@@ -81,4 +81,4 @@ const ActionButton = ({ data, className, txHash, source }: Props) => {
);
};
export
default
chakra
(
ActionButton
);
export
default
chakra
(
A
ppA
ctionButton
);
ui/shared/A
ctionButton/use
ActionData.tsx
→
ui/shared/A
ppActionButton/useApp
ActionData.tsx
View file @
324af2cc
import
useAddressMetadataInfoQuery
from
'
lib/address/useAddressMetadataInfoQuery
'
;
export
default
function
useActionData
(
address
:
string
|
undefined
=
''
)
{
export
default
function
useA
ppA
ctionData
(
address
:
string
|
undefined
=
''
)
{
const
{
data
}
=
useAddressMetadataInfoQuery
([
address
]);
const
metadata
=
data
?.
addresses
[
address
?.
toLowerCase
()];
const
tag
=
metadata
?.
tags
?.
find
(({
tagType
})
=>
tagType
===
'
protocol
'
);
...
...
ui/token/TokenDetails.tsx
View file @
324af2cc
...
...
@@ -16,8 +16,8 @@ import useFeatureValue from 'lib/growthbook/useFeatureValue';
import
useIsMounted
from
'
lib/hooks/useIsMounted
'
;
import
{
TOKEN_COUNTERS
}
from
'
stubs/token
'
;
import
type
{
TokenTabs
}
from
'
ui/pages/Token
'
;
import
A
ctionButton
from
'
ui/shared/ActionButton/
ActionButton
'
;
import
useA
ctionData
from
'
ui/shared/ActionButton/use
ActionData
'
;
import
A
ppActionButton
from
'
ui/shared/AppActionButton/App
ActionButton
'
;
import
useA
ppActionData
from
'
ui/shared/AppActionButton/useApp
ActionData
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsSponsoredItem
from
'
ui/shared/DetailsSponsoredItem
'
;
import
TruncatedValue
from
'
ui/shared/TruncatedValue
'
;
...
...
@@ -31,7 +31,7 @@ interface Props {
const
TokenDetails
=
({
tokenQuery
}:
Props
)
=>
{
const
router
=
useRouter
();
const
isMounted
=
useIsMounted
();
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
action_button_exp
'
,
false
);
const
{
value
:
is
ActionButton
Experiment
}
=
useFeatureValue
(
'
action_button_exp
'
,
false
);
const
hash
=
router
.
query
.
hash
?.
toString
();
...
...
@@ -40,7 +40,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {
queryOptions
:
{
enabled
:
Boolean
(
router
.
query
.
hash
),
placeholderData
:
TOKEN_COUNTERS
},
});
const
a
ctionData
=
use
ActionData
(
hash
);
const
a
ppActionData
=
useApp
ActionData
(
hash
);
const
changeUrlAndScroll
=
useCallback
((
tab
:
TokenTabs
)
=>
()
=>
{
router
.
push
(
...
...
@@ -179,20 +179,20 @@ const TokenDetails = ({ tokenQuery }: Props) => {
<
TokenNftMarketplaces
hash=
{
hash
}
isLoading=
{
tokenQuery
.
isPlaceholderData
}
a
ctionData=
{
a
ctionData
}
a
ppActionData=
{
appA
ctionData
}
source=
"NFT collection"
is
Experiment=
{
is
Experiment
}
is
ActionButtonExperiment=
{
isActionButton
Experiment
}
/>
)
}
{
(
type
!==
'
ERC-20
'
&&
config
.
UI
.
views
.
nft
.
marketplaces
.
length
===
0
&&
a
ctionData
&&
is
Experiment
)
&&
(
{
(
type
!==
'
ERC-20
'
&&
config
.
UI
.
views
.
nft
.
marketplaces
.
length
===
0
&&
a
ppActionData
&&
isActionButton
Experiment
)
&&
(
<
DetailsInfoItem
title=
"Dapp"
hint=
"Link to the dapp"
alignSelf=
"center"
py=
{
1
}
>
<
A
ctionButton
data=
{
a
ctionData
}
height=
"30px"
source=
"NFT collection"
/>
<
A
ppActionButton
data=
{
appA
ctionData
}
height=
"30px"
source=
"NFT collection"
/>
</
DetailsInfoItem
>
)
}
...
...
ui/token/TokenNftMarketplaces.tsx
View file @
324af2cc
...
...
@@ -4,7 +4,7 @@ import React from 'react';
import
type
{
AddressMetadataTagFormatted
}
from
'
types/client/addressMetadata
'
;
import
config
from
'
configs/app
'
;
import
A
ctionButton
from
'
ui/shared/ActionButton/
ActionButton
'
;
import
A
ppActionButton
from
'
ui/shared/AppActionButton/App
ActionButton
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
TextSeparator
from
'
ui/shared/TextSeparator
'
;
...
...
@@ -12,12 +12,12 @@ interface Props {
hash
:
string
|
undefined
;
id
?:
string
;
isLoading
?:
boolean
;
actionData
?:
AddressMetadataTagFormatted
[
'
meta
'
];
a
ppA
ctionData
?:
AddressMetadataTagFormatted
[
'
meta
'
];
source
:
'
NFT collection
'
|
'
NFT item
'
;
isExperiment
?:
boolean
;
is
ActionButton
Experiment
?:
boolean
;
}
const
TokenNftMarketplaces
=
({
hash
,
id
,
isLoading
,
a
ctionData
,
source
,
is
Experiment
}:
Props
)
=>
{
const
TokenNftMarketplaces
=
({
hash
,
id
,
isLoading
,
a
ppActionData
,
source
,
isActionButton
Experiment
}:
Props
)
=>
{
if
(
!
hash
||
config
.
UI
.
views
.
nft
.
marketplaces
.
length
===
0
)
{
return
null
;
}
...
...
@@ -28,7 +28,7 @@ const TokenNftMarketplaces = ({ hash, id, isLoading, actionData, source, isExper
hint=
"Marketplaces trading this NFT"
alignSelf=
"center"
isLoading=
{
isLoading
}
py=
{
(
a
ctionData
&&
is
Experiment
)
?
1
:
{
base
:
1
,
lg
:
2
}
}
py=
{
(
a
ppActionData
&&
isActionButton
Experiment
)
?
1
:
{
base
:
1
,
lg
:
2
}
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"flex"
columnGap=
{
3
}
flexWrap=
"wrap"
alignItems=
"center"
>
{
config
.
UI
.
views
.
nft
.
marketplaces
.
map
((
item
)
=>
{
...
...
@@ -49,10 +49,10 @@ const TokenNftMarketplaces = ({ hash, id, isLoading, actionData, source, isExper
</
Tooltip
>
);
})
}
{
(
a
ctionData
&&
is
Experiment
)
&&
(
{
(
a
ppActionData
&&
isActionButton
Experiment
)
&&
(
<>
<
TextSeparator
color=
"gray.500"
margin=
{
0
}
/>
<
A
ctionButton
data=
{
a
ctionData
}
height=
"30px"
source=
{
source
}
/>
<
A
ppActionButton
data=
{
appA
ctionData
}
height=
"30px"
source=
{
source
}
/>
</>
)
}
</
Skeleton
>
...
...
ui/tokenInstance/TokenInstanceDetails.tsx
View file @
324af2cc
...
...
@@ -5,8 +5,8 @@ import type { TokenInfo, TokenInstance } from 'types/api/token';
import
config
from
'
configs/app
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
A
ctionButton
from
'
ui/shared/ActionButton/
ActionButton
'
;
import
useA
ctionData
from
'
ui/shared/ActionButton/use
ActionData
'
;
import
A
ppActionButton
from
'
ui/shared/AppActionButton/App
ActionButton
'
;
import
useA
ppActionData
from
'
ui/shared/AppActionButton/useApp
ActionData
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItemDivider
from
'
ui/shared/DetailsInfoItemDivider
'
;
...
...
@@ -28,8 +28,8 @@ interface Props {
}
const
TokenInstanceDetails
=
({
data
,
token
,
scrollRef
,
isLoading
}:
Props
)
=>
{
const
a
ctionData
=
use
ActionData
(
token
?.
address
);
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
action_button_exp
'
,
false
);
const
a
ppActionData
=
useApp
ActionData
(
token
?.
address
);
const
{
value
:
is
ActionButton
Experiment
}
=
useFeatureValue
(
'
action_button_exp
'
,
false
);
const
handleCounterItemClick
=
React
.
useCallback
(()
=>
{
window
.
setTimeout
(()
=>
{
...
...
@@ -82,18 +82,18 @@ const TokenInstanceDetails = ({ data, token, scrollRef, isLoading }: Props) => {
isLoading=
{
isLoading
}
hash=
{
token
.
address
}
id=
{
data
.
id
}
a
ctionData=
{
a
ctionData
}
a
ppActionData=
{
appA
ctionData
}
source=
"NFT item"
is
Experiment=
{
is
Experiment
}
is
ActionButtonExperiment=
{
isActionButton
Experiment
}
/>
{
(
config
.
UI
.
views
.
nft
.
marketplaces
.
length
===
0
&&
a
ctionData
&&
is
Experiment
)
&&
(
{
(
config
.
UI
.
views
.
nft
.
marketplaces
.
length
===
0
&&
a
ppActionData
&&
isActionButton
Experiment
)
&&
(
<
DetailsInfoItem
title=
"Dapp"
hint=
"Link to the dapp"
alignSelf=
"center"
py=
{
1
}
>
<
A
ctionButton
data=
{
a
ctionData
}
height=
"30px"
source=
"NFT item"
/>
<
A
ppActionButton
data=
{
appA
ctionData
}
height=
"30px"
source=
"NFT item"
/>
</
DetailsInfoItem
>
)
}
</
Grid
>
...
...
ui/tx/TxSubHeading.tsx
View file @
324af2cc
...
...
@@ -7,8 +7,8 @@ import useFeatureValue from 'lib/growthbook/useFeatureValue';
import
{
NOVES_TRANSLATE
}
from
'
stubs/noves/NovesTranslate
'
;
import
{
TX_INTERPRETATION
}
from
'
stubs/txInterpretation
'
;
import
AccountActionsMenu
from
'
ui/shared/AccountActionsMenu/AccountActionsMenu
'
;
import
A
ctionButton
from
'
ui/shared/ActionButton/
ActionButton
'
;
import
useA
ctionData
from
'
ui/shared/ActionButton/use
ActionData
'
;
import
A
ppActionButton
from
'
ui/shared/AppActionButton/App
ActionButton
'
;
import
useA
ppActionData
from
'
ui/shared/AppActionButton/useApp
ActionData
'
;
import
{
TX_ACTIONS_BLOCK_ID
}
from
'
ui/shared/DetailsActionsWrapper
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
...
...
@@ -29,8 +29,8 @@ const TxSubHeading = ({ hash, hasTag, txQuery }: Props) => {
const
hasInterpretationFeature
=
feature
.
isEnabled
;
const
isNovesInterpretation
=
hasInterpretationFeature
&&
feature
.
provider
===
'
noves
'
;
const
a
ctionData
=
use
ActionData
(
txQuery
.
data
?.
to
?.
hash
);
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
action_button_exp
'
,
false
);
const
a
ppActionData
=
useApp
ActionData
(
txQuery
.
data
?.
to
?.
hash
);
const
{
value
:
is
ActionButton
Experiment
}
=
useFeatureValue
(
'
action_button_exp
'
,
false
);
const
txInterpretationQuery
=
useApiQuery
(
'
tx_interpretation
'
,
{
pathParams
:
{
hash
},
...
...
@@ -124,7 +124,9 @@ const TxSubHeading = ({ hash, hasTag, txQuery }: Props) => {
mt=
{
{
base
:
3
,
lg
:
0
}
}
>
{
!
hasTag
&&
<
AccountActionsMenu
/>
}
{
(
actionData
&&
isExperiment
&&
hasAnyInterpretation
)
&&
<
ActionButton
data=
{
actionData
}
txHash=
{
hash
}
source=
"Txn"
/>
}
{
(
appActionData
&&
isActionButtonExperiment
&&
hasAnyInterpretation
)
&&
(
<
AppActionButton
data=
{
appActionData
}
txHash=
{
hash
}
source=
"Txn"
/>
)
}
<
NetworkExplorers
type=
"tx"
pathParam=
{
hash
}
ml=
{
{
base
:
0
,
lg
:
'
auto
'
}
}
/>
</
Flex
>
</
Box
>
...
...
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