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
fcde6016
Commit
fcde6016
authored
Feb 07, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
noves assets flow tab
parent
ffc87f4d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
109 additions
and
129 deletions
+109
-129
transaction.ts
types/api/transaction.ts
+1
-1
Transaction.tsx
ui/pages/Transaction.tsx
+6
-6
NovesFromTo.tsx
ui/shared/Noves/NovesFromTo.tsx
+8
-7
TokenEntity.tsx
ui/shared/entities/token/TokenEntity.tsx
+2
-3
TxFee.tsx
ui/shared/tx/TxFee.tsx
+5
-5
TxAssetFlows.tsx
ui/tx/TxAssetFlows.tsx
+24
-23
TxDetailsWrapped.tsx
ui/tx/TxDetailsWrapped.tsx
+3
-3
TxAssetFlowsListItem.tsx
ui/tx/assetFlows/TxAssetFlowsListItem.tsx
+3
-3
TxAssetFlowsTableItem.tsx
ui/tx/assetFlows/TxAssetFlowsTableItem.tsx
+7
-7
NovesActionSnippet.tsx
ui/tx/assetFlows/components/NovesActionSnippet.tsx
+45
-64
NovesTokenTooltipContent.tsx
ui/tx/assetFlows/components/NovesTokenTooltipContent.tsx
+5
-7
No files found.
types/api/transaction.ts
View file @
fcde6016
...
@@ -15,7 +15,7 @@ export type TransactionRevertReason = {
...
@@ -15,7 +15,7 @@ export type TransactionRevertReason = {
raw
:
string
;
raw
:
string
;
}
|
DecodedInput
;
}
|
DecodedInput
;
type
WrappedTransactionFields
=
'
decoded_input
'
|
'
fee
'
|
'
gas_limit
'
|
'
gas_price
'
|
'
hash
'
|
'
max_fee_per_gas
'
|
export
type
WrappedTransactionFields
=
'
decoded_input
'
|
'
fee
'
|
'
gas_limit
'
|
'
gas_price
'
|
'
hash
'
|
'
max_fee_per_gas
'
|
'
max_priority_fee_per_gas
'
|
'
method
'
|
'
nonce
'
|
'
raw_input
'
|
'
to
'
|
'
type
'
|
'
value
'
;
'
max_priority_fee_per_gas
'
|
'
method
'
|
'
nonce
'
|
'
raw_input
'
|
'
to
'
|
'
type
'
|
'
value
'
;
export
interface
OpWithdrawal
{
export
interface
OpWithdrawal
{
...
...
ui/pages/Transaction.tsx
View file @
fcde6016
...
@@ -52,12 +52,12 @@ const TransactionPageContent = () => {
...
@@ -52,12 +52,12 @@ const TransactionPageContent = () => {
title
:
config
.
features
.
suave
.
isEnabled
&&
data
?.
wrapped
?
'
Confidential compute tx details
'
:
'
Details
'
,
title
:
config
.
features
.
suave
.
isEnabled
&&
data
?.
wrapped
?
'
Confidential compute tx details
'
:
'
Details
'
,
component
:
detailsComponent
,
component
:
detailsComponent
,
},
},
//
txInterpretation.isEnabled && txInterpretation.provider === 'noves' ?
txInterpretation
.
isEnabled
&&
txInterpretation
.
provider
===
'
noves
'
?
//
{ id: 'asset_flows', title: 'Asset Flows', component: <TxAssetFlows hash={ hash }/> } :
{
id
:
'
asset_flows
'
,
title
:
'
Asset Flows
'
,
component
:
<
TxAssetFlows
hash=
{
hash
}
/>
}
:
//
undefined,
undefined
,
//
config.features.suave.isEnabled && data?.wrapped ?
config
.
features
.
suave
.
isEnabled
&&
data
?.
wrapped
?
//
{ id: 'wrapped', title: 'Regular tx details', component: <TxDetailsWrapped data={ data.wrapped }/> } :
{
id
:
'
wrapped
'
,
title
:
'
Regular tx details
'
,
component
:
<
TxDetailsWrapped
data=
{
data
.
wrapped
}
/>
}
:
//
undefined,
undefined
,
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TxTokenTransfer
txQuery=
{
txQuery
}
/>
},
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TxTokenTransfer
txQuery=
{
txQuery
}
/>
},
config
.
features
.
userOps
.
isEnabled
?
config
.
features
.
userOps
.
isEnabled
?
{
id
:
'
user_ops
'
,
title
:
'
User operations
'
,
component
:
<
TxUserOps
txQuery=
{
txQuery
}
/>
}
:
{
id
:
'
user_ops
'
,
title
:
'
User operations
'
,
component
:
<
TxUserOps
txQuery=
{
txQuery
}
/>
}
:
...
...
ui/shared/Noves/NovesFromTo.tsx
View file @
fcde6016
...
@@ -4,10 +4,10 @@ import React from 'react';
...
@@ -4,10 +4,10 @@ import React from 'react';
import
type
{
NovesResponseData
}
from
'
types/api/noves
'
;
import
type
{
NovesResponseData
}
from
'
types/api/noves
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
type
{
NovesFlowViewItem
}
from
'
ui/tx/assetFlows/utils/generateFlowViewData
'
;
import
type
{
NovesFlowViewItem
}
from
'
ui/tx/assetFlows/utils/generateFlowViewData
'
;
import
Tag
from
'
../chakra/Tag
'
;
import
AddressEntity
from
'
../entities/address/AddressEntity
'
;
import
AddressEntity
from
'
../entities/address/AddressEntity
'
;
import
{
getActionFromTo
,
getFromTo
}
from
'
./utils
'
;
import
{
getActionFromTo
,
getFromTo
}
from
'
./utils
'
;
...
@@ -35,16 +35,17 @@ const NovesFromTo: FC<Props> = ({ isLoaded, txData, currentAddress = '', item })
...
@@ -35,16 +35,17 @@ const NovesFromTo: FC<Props> = ({ isLoaded, txData, currentAddress = '', item })
const
address
=
{
hash
:
data
.
address
||
''
,
name
:
data
.
name
||
''
};
const
address
=
{
hash
:
data
.
address
||
''
,
name
:
data
.
name
||
''
};
return
(
return
(
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
isLoaded
}
>
<
Skeleton
borderRadius=
"sm"
loading=
{
!
isLoaded
}
>
<
Box
display=
"flex"
>
<
Box
display=
"flex"
>
<
Tag
<
Badge
color
Schem
e=
{
isSent
?
'
yellow
'
:
'
green
'
}
color
Palett
e=
{
isSent
?
'
yellow
'
:
'
green
'
}
px=
{
0
}
px=
{
0
}
w=
"113px"
w=
"113px"
textAlign=
"center"
flexShrink=
{
0
}
justifyContent=
"center"
>
>
{
data
.
text
}
{
data
.
text
}
</
Tag
>
</
Badge
>
<
AddressEntity
<
AddressEntity
address=
{
address
}
address=
{
address
}
...
...
ui/shared/entities/token/TokenEntity.tsx
View file @
fcde6016
...
@@ -144,13 +144,12 @@ export interface EntityProps extends EntityBase.EntityBaseProps {
...
@@ -144,13 +144,12 @@ export interface EntityProps extends EntityBase.EntityBaseProps {
const
TokenEntity
=
(
props
:
EntityProps
)
=>
{
const
TokenEntity
=
(
props
:
EntityProps
)
=>
{
const
partsProps
=
distributeEntityProps
(
props
);
const
partsProps
=
distributeEntityProps
(
props
);
const
content
=
<
Content
{
...
partsProps
.
content
}
/>;
return
(
return
(
<
Container
w=
"100%"
{
...
partsProps
.
container
}
>
<
Container
w=
"100%"
{
...
partsProps
.
container
}
>
<
Icon
{
...
partsProps
.
icon
}
/>
<
Icon
{
...
partsProps
.
icon
}
/>
<
Link
{
...
partsProps
.
link
}
>
{
props
.
noLink
?
content
:
<
Link
{
...
partsProps
.
link
}
>
{
content
}
</
Link
>
}
<
Content
{
...
partsProps
.
content
}
/>
</
Link
>
<
Symbol
{
...
partsProps
.
symbol
}
/>
<
Symbol
{
...
partsProps
.
symbol
}
/>
<
Copy
{
...
partsProps
.
copy
}
/>
<
Copy
{
...
partsProps
.
copy
}
/>
</
Container
>
</
Container
>
...
...
ui/shared/tx/TxFee.tsx
View file @
fcde6016
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Transaction
}
from
'
types/api/transaction
'
;
import
type
{
Transaction
,
WrappedTransactionFields
}
from
'
types/api/transaction
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
...
@@ -13,7 +13,7 @@ import TokenEntity from 'ui/shared/entities/token/TokenEntity';
...
@@ -13,7 +13,7 @@ import TokenEntity from 'ui/shared/entities/token/TokenEntity';
interface
Props
{
interface
Props
{
className
?:
string
;
className
?:
string
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
tx
:
Transaction
;
tx
:
Transaction
|
Pick
<
Transaction
,
WrappedTransactionFields
>
;
withCurrency
?:
boolean
;
withCurrency
?:
boolean
;
withUsd
?:
boolean
;
withUsd
?:
boolean
;
accuracy
?:
number
;
accuracy
?:
number
;
...
@@ -22,7 +22,7 @@ interface Props {
...
@@ -22,7 +22,7 @@ interface Props {
const
TxFee
=
({
className
,
tx
,
accuracy
,
accuracyUsd
,
isLoading
,
withCurrency
=
true
,
withUsd
}:
Props
)
=>
{
const
TxFee
=
({
className
,
tx
,
accuracy
,
accuracyUsd
,
isLoading
,
withCurrency
=
true
,
withUsd
}:
Props
)
=>
{
if
(
tx
.
celo
?.
gas_token
)
{
if
(
'
celo
'
in
tx
&&
tx
.
celo
?.
gas_token
)
{
const
token
=
tx
.
celo
.
gas_token
;
const
token
=
tx
.
celo
.
gas_token
;
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
value
:
tx
.
fee
.
value
||
'
0
'
,
value
:
tx
.
fee
.
value
||
'
0
'
,
...
@@ -40,7 +40,7 @@ const TxFee = ({ className, tx, accuracy, accuracyUsd, isLoading, withCurrency =
...
@@ -40,7 +40,7 @@ const TxFee = ({ className, tx, accuracy, accuracyUsd, isLoading, withCurrency =
);
);
}
}
if
(
tx
.
stability_fee
)
{
if
(
'
stability_fee
'
in
tx
&&
tx
.
stability_fee
)
{
const
token
=
tx
.
stability_fee
.
token
;
const
token
=
tx
.
stability_fee
.
token
;
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
value
:
tx
.
stability_fee
.
total_fee
,
value
:
tx
.
stability_fee
.
total_fee
,
...
@@ -65,7 +65,7 @@ const TxFee = ({ className, tx, accuracy, accuracyUsd, isLoading, withCurrency =
...
@@ -65,7 +65,7 @@ const TxFee = ({ className, tx, accuracy, accuracyUsd, isLoading, withCurrency =
<
CurrencyValue
<
CurrencyValue
value=
{
tx
.
fee
.
value
}
value=
{
tx
.
fee
.
value
}
currency=
{
showCurrency
?
currencyUnits
.
ether
:
''
}
currency=
{
showCurrency
?
currencyUnits
.
ether
:
''
}
exchangeRate=
{
withUsd
?
tx
.
exchange_rate
:
null
}
exchangeRate=
{
withUsd
&&
'
exchange_rate
'
in
tx
?
tx
.
exchange_rate
:
null
}
accuracy=
{
accuracy
}
accuracy=
{
accuracy
}
accuracyUsd=
{
accuracyUsd
}
accuracyUsd=
{
accuracyUsd
}
flexWrap=
"wrap"
flexWrap=
"wrap"
...
...
ui/tx/TxAssetFlows.tsx
View file @
fcde6016
import
{
Table
,
Tbody
,
Tr
,
Th
,
Box
,
Text
,
Show
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
chunk
}
from
'
es-toolkit
'
;
import
{
chunk
}
from
'
es-toolkit
'
;
import
React
,
{
useMemo
,
useState
}
from
'
react
'
;
import
React
,
{
useMemo
,
useState
}
from
'
react
'
;
...
@@ -6,12 +6,12 @@ import type { PaginationParams } from 'ui/shared/pagination/types';
...
@@ -6,12 +6,12 @@ import type { PaginationParams } from 'ui/shared/pagination/types';
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
{
NOVES_TRANSLATE
}
from
'
stubs/noves/NovesTranslate
'
;
import
{
NOVES_TRANSLATE
}
from
'
stubs/noves/NovesTranslate
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
TheadSticky
from
'
ui/shared/TheadSticky
'
;
import
TxAssetFlowsListItem
from
'
./assetFlows/TxAssetFlowsListItem
'
;
import
TxAssetFlowsListItem
from
'
./assetFlows/TxAssetFlowsListItem
'
;
import
TxAssetFlowsTableItem
from
'
./assetFlows/TxAssetFlowsTableItem
'
;
import
TxAssetFlowsTableItem
from
'
./assetFlows/TxAssetFlowsTableItem
'
;
...
@@ -53,7 +53,7 @@ export default function TxAssetFlows(props: FlowViewProps) {
...
@@ -53,7 +53,7 @@ export default function TxAssetFlows(props: FlowViewProps) {
const
actionBar
=
(
const
actionBar
=
(
<
ActionBar
mt=
{
-
6
}
pb=
{
{
base
:
6
,
md
:
5
}
}
flexDir=
{
{
base
:
'
column
'
,
md
:
'
initial
'
}
}
gap=
{
{
base
:
'
2
'
,
md
:
'
initial
'
}
}
>
<
ActionBar
mt=
{
-
6
}
pb=
{
{
base
:
6
,
md
:
5
}
}
flexDir=
{
{
base
:
'
column
'
,
md
:
'
initial
'
}
}
gap=
{
{
base
:
'
2
'
,
md
:
'
initial
'
}
}
>
<
Box
display=
"flex"
alignItems=
"center"
gap=
{
1
}
>
<
Box
display=
"flex"
alignItems=
"center"
gap=
{
1
}
>
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
!
isPlaceholderData
}
>
<
Skeleton
borderRadius=
"sm"
loading=
{
isPlaceholderData
}
>
<
Text
fontWeight=
"400"
mr=
{
1
}
>
<
Text
fontWeight=
"400"
mr=
{
1
}
>
Wallet
Wallet
</
Text
>
</
Text
>
...
@@ -72,7 +72,7 @@ export default function TxAssetFlows(props: FlowViewProps) {
...
@@ -72,7 +72,7 @@ export default function TxAssetFlows(props: FlowViewProps) {
const
content
=
(
const
content
=
(
<>
<>
<
Hide
above=
"lg"
>
<
Box
hideFrom=
"lg"
>
{
data
?.
map
((
item
,
i
)
=>
(
{
data
?.
map
((
item
,
i
)
=>
(
<
TxAssetFlowsListItem
<
TxAssetFlowsListItem
key=
{
`${ i }-${ item.accountAddress }`
}
key=
{
`${ i }-${ item.accountAddress }`
}
...
@@ -80,21 +80,21 @@ export default function TxAssetFlows(props: FlowViewProps) {
...
@@ -80,21 +80,21 @@ export default function TxAssetFlows(props: FlowViewProps) {
isPlaceholderData=
{
isPlaceholderData
}
isPlaceholderData=
{
isPlaceholderData
}
/>
/>
))
}
))
}
</
Hide
>
</
Box
>
<
Show
above
=
"lg"
>
<
Box
hideBelow
=
"lg"
>
<
Table
>
<
Table
Root
>
<
T
head
Sticky
top=
{
75
}
>
<
T
ableHeader
Sticky
top=
{
75
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
>
<
T
ableColumnHeader
>
Actions
Actions
</
T
h
>
</
T
ableColumnHeader
>
<
T
h
width=
"450px"
>
<
T
ableColumnHeader
width=
"450px"
>
From/To
From/To
</
T
h
>
</
T
ableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
Sticky
>
</
T
ableHeader
Sticky
>
<
T
b
ody
>
<
T
ableB
ody
>
{
data
?.
map
((
item
,
i
)
=>
(
{
data
?.
map
((
item
,
i
)
=>
(
<
TxAssetFlowsTableItem
<
TxAssetFlowsTableItem
key=
{
`${ i }-${ item.accountAddress }`
}
key=
{
`${ i }-${ item.accountAddress }`
}
...
@@ -102,19 +102,20 @@ export default function TxAssetFlows(props: FlowViewProps) {
...
@@ -102,19 +102,20 @@ export default function TxAssetFlows(props: FlowViewProps) {
isPlaceholderData=
{
isPlaceholderData
}
isPlaceholderData=
{
isPlaceholderData
}
/>
/>
))
}
))
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
</
Show
>
</
Box
>
</>
</>
);
);
return
(
return
(
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
data
}
items
Num=
{
data
?.
length
}
emptyText=
"There are no transfers."
emptyText=
"There are no transfers."
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
);
);
}
}
ui/tx/TxDetailsWrapped.tsx
View file @
fcde6016
...
@@ -6,7 +6,7 @@ import type { Transaction } from 'types/api/transaction';
...
@@ -6,7 +6,7 @@ import type { Transaction } from 'types/api/transaction';
import
type
{
ExcludeUndefined
}
from
'
types/utils
'
;
import
type
{
ExcludeUndefined
}
from
'
types/utils
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
*
as
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
*
as
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItemDivider
from
'
ui/shared/DetailsInfoItemDivider
'
;
import
DetailsInfoItemDivider
from
'
ui/shared/DetailsInfoItemDivider
'
;
...
@@ -40,9 +40,9 @@ const TxDetailsWrapped = ({ data }: Props) => {
...
@@ -40,9 +40,9 @@ const TxDetailsWrapped = ({ data }: Props) => {
Method
Method
</
DetailsInfoItem
.
Label
>
</
DetailsInfoItem
.
Label
>
<
DetailsInfoItem
.
Value
>
<
DetailsInfoItem
.
Value
>
<
Tag
colorSchem
e=
"gray"
>
<
Badge
colorPalett
e=
"gray"
>
{
data
.
method
}
{
data
.
method
}
</
Tag
>
</
Badge
>
</
DetailsInfoItem
.
Value
>
</
DetailsInfoItem
.
Value
>
<
DetailsInfoItemDivider
/>
<
DetailsInfoItemDivider
/>
...
...
ui/tx/assetFlows/TxAssetFlowsListItem.tsx
View file @
fcde6016
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
Skeleton
from
'
ui/shared/chakra/S
keleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/s
keleton
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
...
@@ -18,7 +18,7 @@ const TxAssetFlowsListItem = (props: Props) => {
...
@@ -18,7 +18,7 @@ const TxAssetFlowsListItem = (props: Props) => {
return
(
return
(
<
ListItemMobile
rowGap=
{
4
}
w=
"full"
>
<
ListItemMobile
rowGap=
{
4
}
w=
"full"
>
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
!
props
.
isPlaceholderData
}
w=
"full"
>
<
Skeleton
borderRadius=
"sm"
loading=
{
props
.
isPlaceholderData
}
w=
"full"
>
<
Box
display=
"flex"
>
<
Box
display=
"flex"
>
<
IconSvg
<
IconSvg
...
@@ -28,7 +28,7 @@ const TxAssetFlowsListItem = (props: Props) => {
...
@@ -28,7 +28,7 @@ const TxAssetFlowsListItem = (props: Props) => {
color=
"text_secondary"
color=
"text_secondary"
/>
/>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
<
Text
textStyle=
"sm"
fontWeight=
"medium"
>
Action
Action
</
Text
>
</
Text
>
</
Box
>
</
Box
>
...
...
ui/tx/assetFlows/TxAssetFlowsTableItem.tsx
View file @
fcde6016
import
{
Td
,
Tr
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
TableRow
,
TableCell
}
from
'
toolkit/chakra/table
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
NovesActionSnippet
from
'
./components/NovesActionSnippet
'
;
import
NovesActionSnippet
from
'
./components/NovesActionSnippet
'
;
...
@@ -14,14 +14,14 @@ type Props = {
...
@@ -14,14 +14,14 @@ type Props = {
const
TxAssetFlowsTableItem
=
(
props
:
Props
)
=>
{
const
TxAssetFlowsTableItem
=
(
props
:
Props
)
=>
{
return
(
return
(
<
T
r
>
<
T
ableRow
>
<
T
d
px=
{
3
}
py=
{
5
}
fontSize=
"sm"
borderColor=
"gray.200"
_dark=
{
{
borderColor
:
'
whiteAlpha.200
'
}
}
>
<
T
ableCell
px=
{
3
}
py=
{
5
}
textStyle=
"sm"
borderColor=
{
{
_light
:
'
gray.200
'
,
_dark
:
'
whiteAlpha.200
'
}
}
>
<
NovesActionSnippet
item=
{
props
.
item
}
isLoaded=
{
!
props
.
isPlaceholderData
}
/>
<
NovesActionSnippet
item=
{
props
.
item
}
isLoaded=
{
!
props
.
isPlaceholderData
}
/>
</
T
d
>
</
T
ableCell
>
<
T
d
px=
{
3
}
py=
"18px"
fontSize=
"sm"
borderColor=
"gray.200"
_dark=
{
{
borderColor
:
'
whiteAlpha.200
'
}
}
>
<
T
ableCell
px=
{
3
}
py=
"18px"
textStyle=
"sm"
borderColor=
{
{
_light
:
'
gray.200
'
,
_dark
:
'
whiteAlpha.200
'
}
}
>
<
NovesFromTo
item=
{
props
.
item
}
isLoaded=
{
!
props
.
isPlaceholderData
}
/>
<
NovesFromTo
item=
{
props
.
item
}
isLoaded=
{
!
props
.
isPlaceholderData
}
/>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/tx/assetFlows/components/NovesActionSnippet.tsx
View file @
fcde6016
import
{
Box
,
Hide
,
PopoverArrow
,
PopoverContent
,
PopoverTrigger
,
Show
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
type
{
FC
}
from
'
react
'
;
import
type
{
FC
}
from
'
react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
HEX_REGEXP
}
from
'
lib/regexp
'
;
import
{
HEX_REGEXP
}
from
'
lib/regexp
'
;
import
Popover
from
'
ui/shared/chakra/Popover
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -17,8 +17,6 @@ interface Props {
...
@@ -17,8 +17,6 @@ interface Props {
}
}
const
NovesActionSnippet
:
FC
<
Props
>
=
({
item
,
isLoaded
})
=>
{
const
NovesActionSnippet
:
FC
<
Props
>
=
({
item
,
isLoaded
})
=>
{
const
popoverBg
=
useColorModeValue
(
'
gray.700
'
,
'
gray.300
'
);
const
token
=
React
.
useMemo
(()
=>
{
const
token
=
React
.
useMemo
(()
=>
{
const
action
=
item
.
action
;
const
action
=
item
.
action
;
...
@@ -38,10 +36,47 @@ const NovesActionSnippet: FC<Props> = ({ item, isLoaded }) => {
...
@@ -38,10 +36,47 @@ const NovesActionSnippet: FC<Props> = ({ item, isLoaded }) => {
const
validTokenAddress
=
token
.
address
?
HEX_REGEXP
.
test
(
token
.
address
)
:
false
;
const
validTokenAddress
=
token
.
address
?
HEX_REGEXP
.
test
(
token
.
address
)
:
false
;
const
tooltipContent
=
(
<
NovesTokenTooltipContent
token=
{
item
.
action
.
token
||
item
.
action
.
nft
}
amount=
{
item
.
action
.
amount
}
/>
);
return
(
return
(
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
isLoaded
}
>
<
Skeleton
borderRadius=
"sm"
loading=
{
!
isLoaded
}
>
<
Hide
above=
"lg"
>
<
Box
hideFrom=
"lg"
display=
"flex"
gap=
{
2
}
cursor=
"pointer"
flexWrap=
"wrap"
>
<
Box
display=
"flex"
gap=
{
2
}
cursor=
"pointer"
flexWrap=
"wrap"
>
<
Text
fontWeight=
"700"
>
{
item
.
action
.
label
}
</
Text
>
<
Text
fontWeight=
"500"
>
{
item
.
action
.
amount
}
</
Text
>
<
TokenEntity
token=
{
token
}
noCopy
noSymbol
noLink=
{
!
validTokenAddress
}
fontWeight=
"500"
color=
"link.primary"
w=
"fit-content"
/>
</
Box
>
<
Tooltip
content=
{
tooltipContent
}
openDelay=
{
50
}
closeDelay=
{
50
}
positioning=
{
{
placement
:
'
bottom
'
}
}
interactive
>
<
Box
hideBelow=
"lg"
display=
"flex"
gap=
{
2
}
cursor=
"pointer"
w=
"fit-content"
maxW=
"100%"
alignItems=
"center"
>
<
IconSvg
name=
"lightning"
height=
"5"
width=
"5"
color=
{
{
_light
:
'
gray.500
'
,
_dark
:
'
gray.400
'
}
}
/>
<
Text
fontWeight=
"700"
>
<
Text
fontWeight=
"700"
>
{
item
.
action
.
label
}
{
item
.
action
.
label
}
</
Text
>
</
Text
>
...
@@ -51,68 +86,14 @@ const NovesActionSnippet: FC<Props> = ({ item, isLoaded }) => {
...
@@ -51,68 +86,14 @@ const NovesActionSnippet: FC<Props> = ({ item, isLoaded }) => {
<
TokenEntity
<
TokenEntity
token=
{
token
}
token=
{
token
}
noCopy
noCopy
no
Symbol
joint
Symbol
noLink=
{
!
validTokenAddress
}
noLink=
{
!
validTokenAddress
}
fontWeight=
"500"
fontWeight=
"500"
color=
"link.primary"
color=
"link.primary"
w=
"fit-content"
w=
"fit-content"
/>
/>
</
Box
>
</
Box
>
</
Hide
>
</
Tooltip
>
<
Show
above=
"lg"
>
<
Popover
trigger=
"hover"
openDelay=
{
50
}
closeDelay=
{
50
}
arrowSize=
{
15
}
arrowShadowColor=
"transparent"
placement=
"bottom"
flip=
{
false
}
>
<
PopoverTrigger
>
<
Box
display=
"flex"
gap=
{
2
}
cursor=
"pointer"
w=
"fit-content"
maxW=
"100%"
alignItems=
"center"
>
<
IconSvg
name=
"lightning"
height=
"5"
width=
"5"
color=
"gray.500"
_dark=
{
{
color
:
'
gray.400
'
}
}
/>
<
Text
fontWeight=
"700"
>
{
item
.
action
.
label
}
</
Text
>
<
Text
fontWeight=
"500"
>
{
item
.
action
.
amount
}
</
Text
>
<
TokenEntity
token=
{
token
}
noCopy
jointSymbol
noLink=
{
!
validTokenAddress
}
fontWeight=
"500"
color=
"link.primary"
w=
"fit-content"
/>
</
Box
>
</
PopoverTrigger
>
<
PopoverContent
bg=
{
popoverBg
}
shadow=
"lg"
width=
"fit-content"
zIndex=
"modal"
padding=
{
2
}
>
<
PopoverArrow
bg=
{
popoverBg
}
/>
<
NovesTokenTooltipContent
token=
{
item
.
action
.
token
||
item
.
action
.
nft
}
amount=
{
item
.
action
.
amount
}
/>
</
PopoverContent
>
</
Popover
>
</
Show
>
</
Skeleton
>
</
Skeleton
>
);
);
};
};
...
...
ui/tx/assetFlows/components/NovesTokenTooltipContent.tsx
View file @
fcde6016
import
{
Box
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
type
{
FC
}
from
'
react
'
;
import
type
{
FC
}
from
'
react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -13,8 +13,6 @@ interface Props {
...
@@ -13,8 +13,6 @@ interface Props {
}
}
const
NovesTokenTooltipContent
:
FC
<
Props
>
=
({
token
,
amount
})
=>
{
const
NovesTokenTooltipContent
:
FC
<
Props
>
=
({
token
,
amount
})
=>
{
const
textColor
=
useColorModeValue
(
'
white
'
,
'
blackAlpha.900
'
);
if
(
!
token
)
{
if
(
!
token
)
{
return
null
;
return
null
;
}
}
...
@@ -23,8 +21,8 @@ const NovesTokenTooltipContent: FC<Props> = ({ token, amount }) => {
...
@@ -23,8 +21,8 @@ const NovesTokenTooltipContent: FC<Props> = ({ token, amount }) => {
const
showTokenAddress
=
HEX_REGEXP
.
test
(
token
.
address
);
const
showTokenAddress
=
HEX_REGEXP
.
test
(
token
.
address
);
return
(
return
(
<
Box
color=
{
textColor
}
display=
"flex"
flexDir=
"column"
alignItems=
"center"
gap=
{
1
}
>
<
Box
color=
{
{
_light
:
'
white
'
,
_dark
:
'
blackAlpha.900
'
}
}
display=
"flex"
flexDir=
"column"
alignItems=
"center"
gap=
{
1
}
>
<
Text
as=
"p"
color=
"inherit"
fontWeight=
"
600
"
>
<
Text
as=
"p"
color=
"inherit"
fontWeight=
"
semibold
"
>
<
Text
color=
"inherit"
as=
"span"
>
<
Text
color=
"inherit"
as=
"span"
>
{
amount
}
{
amount
}
</
Text
>
</
Text
>
...
@@ -34,14 +32,14 @@ const NovesTokenTooltipContent: FC<Props> = ({ token, amount }) => {
...
@@ -34,14 +32,14 @@ const NovesTokenTooltipContent: FC<Props> = ({ token, amount }) => {
</
Text
>
</
Text
>
{
showTokenName
&&
(
{
showTokenName
&&
(
<
Text
as=
"p"
color=
"inherit"
fontWeight=
"
600
"
mt=
"6px"
>
<
Text
as=
"p"
color=
"inherit"
fontWeight=
"
semibold
"
mt=
"6px"
>
{
token
.
name
}
{
token
.
name
}
</
Text
>
</
Text
>
)
}
)
}
{
showTokenAddress
&&
(
{
showTokenAddress
&&
(
<
Box
display=
"flex"
alignItems=
"center"
>
<
Box
display=
"flex"
alignItems=
"center"
>
<
Text
color=
"inherit"
fontWeight=
"
400
"
>
<
Text
color=
"inherit"
fontWeight=
"
normal
"
>
{
token
.
address
}
{
token
.
address
}
</
Text
>
</
Text
>
<
CopyToClipboard
text=
{
token
.
address
}
/>
<
CopyToClipboard
text=
{
token
.
address
}
/>
...
...
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