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
0dbb04b0
Unverified
Commit
0dbb04b0
authored
Apr 04, 2024
by
Igor Stuev
Committed by
GitHub
Apr 04, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1780 from blockscout/1280-hf2
1280 hf2
parents
3fd7f42b
586831e3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
36 deletions
+63
-36
tokenTransfer.ts
mocks/tokens/tokenTransfer.ts
+1
-0
tokenTransfer.ts
types/api/tokenTransfer.ts
+4
-3
Web3ModalProvider.tsx
ui/shared/Web3ModalProvider.tsx
+1
-0
FtTokenTransferSnippet.tsx
ui/tx/FtTokenTransferSnippet.tsx
+37
-0
TxDetailsTokenTransfer.tsx
ui/tx/details/TxDetailsTokenTransfer.tsx
+20
-33
TxInfo.pw.tsx_default_with-token-transfer-mobile-1.png
...__/TxInfo.pw.tsx_default_with-token-transfer-mobile-1.png
+0
-0
TxInfo.pw.tsx_mobile_with-token-transfer-mobile-1.png
...s__/TxInfo.pw.tsx_mobile_with-token-transfer-mobile-1.png
+0
-0
No files found.
mocks/tokens/tokenTransfer.ts
View file @
0dbb04b0
...
...
@@ -208,6 +208,7 @@ export const erc404A: TokenTransfer = {
total
:
{
value
:
'
42000000000000000000000000
'
,
decimals
:
'
18
'
,
token_id
:
null
,
},
tx_hash
:
'
0x05d6589367633c032d757a69c5fb16c0e33e3994b0d9d1483f82aeee1f05d746
'
,
type
:
'
token_transfer
'
,
...
...
types/api/tokenTransfer.ts
View file @
0dbb04b0
...
...
@@ -17,10 +17,11 @@ export type Erc1155TotalPayload = {
}
export
type
Erc404TotalPayload
=
{
decimals
:
string
|
null
;
value
:
string
|
null
;
decimals
:
string
;
value
:
string
;
token_id
:
null
;
}
|
{
token_id
:
string
|
null
;
token_id
:
string
;
};
export
type
TokenTransfer
=
(
...
...
ui/shared/Web3ModalProvider.tsx
View file @
0dbb04b0
...
...
@@ -27,6 +27,7 @@ const init = () => {
'
--w3m-z-index
'
:
zIndices
.
modal
,
},
featuredWalletIds
:
[],
allowUnsupportedChain
:
true
,
});
}
catch
(
error
)
{}
};
...
...
ui/tx/FtTokenTransferSnippet.tsx
0 → 100644
View file @
0dbb04b0
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
interface
Props
{
token
:
TokenInfo
;
value
:
string
;
decimals
:
string
|
null
;
}
const
FtTokenTransferSnippet
=
({
token
,
value
,
decimals
}:
Props
)
=>
{
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
value
:
value
,
exchangeRate
:
token
.
exchange_rate
,
accuracyUsd
:
2
,
decimals
:
decimals
,
});
return
(
<>
<
chakra
.
span
color=
"text_secondary"
>
for
</
chakra
.
span
>
<
span
>
{
valueStr
}
</
span
>
<
TokenEntity
token=
{
{
...
token
,
name
:
token
.
symbol
||
token
.
name
}
}
noCopy
noSymbol
w=
"auto"
/>
{
usd
&&
<
chakra
.
span
color=
"text_secondary"
>
($
{
usd
}
)
</
chakra
.
span
>
}
</>
);
};
export
default
React
.
memo
(
FtTokenTransferSnippet
);
ui/tx/details/TxDetailsTokenTransfer.tsx
View file @
0dbb04b0
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
...
...
@@ -9,11 +9,11 @@ import type {
Erc404TotalPayload
,
}
from
'
types/api/tokenTransfer
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
NftTokenTransferSnippet
from
'
ui/tx/NftTokenTransferSnippet
'
;
import
FtTokenTransferSnippet
from
'
../FtTokenTransferSnippet
'
;
interface
Props
{
data
:
TTokenTransfer
;
}
...
...
@@ -24,26 +24,7 @@ const TxDetailsTokenTransfer = ({ data }: Props) => {
switch
(
data
.
token
.
type
)
{
case
'
ERC-20
'
:
{
const
total
=
data
.
total
as
Erc20TotalPayload
;
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
value
:
total
.
value
,
exchangeRate
:
data
.
token
.
exchange_rate
,
accuracyUsd
:
2
,
decimals
:
total
.
decimals
,
});
return
(
<>
<
chakra
.
span
color=
"text_secondary"
>
for
</
chakra
.
span
>
<
span
>
{
valueStr
}
</
span
>
<
TokenEntity
token=
{
{
...
data
.
token
,
name
:
data
.
token
.
symbol
||
data
.
token
.
name
}
}
noCopy
noSymbol
w=
"auto"
/>
{
usd
&&
<
chakra
.
span
color=
"text_secondary"
>
($
{
usd
}
)
</
chakra
.
span
>
}
</>
);
return
<
FtTokenTransferSnippet
token=
{
data
.
token
}
value=
{
total
.
value
}
decimals=
{
total
.
decimals
}
/>;
}
case
'
ERC-721
'
:
{
...
...
@@ -71,16 +52,22 @@ const TxDetailsTokenTransfer = ({ data }: Props) => {
case
'
ERC-404
'
:
{
const
total
=
data
.
total
as
Erc404TotalPayload
;
if
(
total
.
token_id
!==
null
)
{
return
(
<
NftTokenTransferSnippet
token=
{
data
.
token
}
tokenId=
{
'
token_id
'
in
total
?
total
.
token_id
:
null
}
value=
{
'
value
'
in
total
&&
total
.
value
?
getCurrencyValue
({
value
:
total
.
value
,
decimals
:
total
.
decimals
||
'
0
'
,
accuracy
:
2
}).
valueStr
:
'
1
'
}
tokenId=
{
total
.
token_id
}
value=
"1"
/>
);
}
else
{
if
(
total
.
value
===
null
)
{
return
null
;
}
return
<
FtTokenTransferSnippet
token=
{
data
.
token
}
value=
{
total
.
value
}
decimals=
{
total
.
decimals
}
/>;
}
}
}
})();
...
...
ui/tx/details/__screenshots__/TxInfo.pw.tsx_default_with-token-transfer-mobile-1.png
View replaced file @
3fd7f42b
View file @
0dbb04b0
182 KB
|
W:
|
H:
182 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/tx/details/__screenshots__/TxInfo.pw.tsx_mobile_with-token-transfer-mobile-1.png
View replaced file @
3fd7f42b
View file @
0dbb04b0
166 KB
|
W:
|
H:
164 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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