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
3e0f6e67
Commit
3e0f6e67
authored
Apr 02, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erc 404 fix
parent
af7a835f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
33 deletions
+57
-33
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.
ui/tx/FtTokenTransferSnippet.tsx
0 → 100644
View file @
3e0f6e67
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 @
3e0f6e67
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
import
type
{
...
@@ -9,11 +9,11 @@ import type {
...
@@ -9,11 +9,11 @@ import type {
Erc404TotalPayload
,
Erc404TotalPayload
,
}
from
'
types/api/tokenTransfer
'
;
}
from
'
types/api/tokenTransfer
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
NftTokenTransferSnippet
from
'
ui/tx/NftTokenTransferSnippet
'
;
import
NftTokenTransferSnippet
from
'
ui/tx/NftTokenTransferSnippet
'
;
import
FtTokenTransferSnippet
from
'
../FtTokenTransferSnippet
'
;
interface
Props
{
interface
Props
{
data
:
TTokenTransfer
;
data
:
TTokenTransfer
;
}
}
...
@@ -24,26 +24,7 @@ const TxDetailsTokenTransfer = ({ data }: Props) => {
...
@@ -24,26 +24,7 @@ const TxDetailsTokenTransfer = ({ data }: Props) => {
switch
(
data
.
token
.
type
)
{
switch
(
data
.
token
.
type
)
{
case
'
ERC-20
'
:
{
case
'
ERC-20
'
:
{
const
total
=
data
.
total
as
Erc20TotalPayload
;
const
total
=
data
.
total
as
Erc20TotalPayload
;
const
{
valueStr
,
usd
}
=
getCurrencyValue
({
return
<
FtTokenTransferSnippet
token=
{
data
.
token
}
value=
{
total
.
value
}
decimals=
{
total
.
decimals
}
/>;
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
>
}
</>
);
}
}
case
'
ERC-721
'
:
{
case
'
ERC-721
'
:
{
...
@@ -71,16 +52,22 @@ const TxDetailsTokenTransfer = ({ data }: Props) => {
...
@@ -71,16 +52,22 @@ const TxDetailsTokenTransfer = ({ data }: Props) => {
case
'
ERC-404
'
:
{
case
'
ERC-404
'
:
{
const
total
=
data
.
total
as
Erc404TotalPayload
;
const
total
=
data
.
total
as
Erc404TotalPayload
;
return
(
<
NftTokenTransferSnippet
if
(
'
token_id
'
in
total
)
{
token=
{
data
.
token
}
return
(
tokenId=
{
'
token_id
'
in
total
?
total
.
token_id
:
null
}
<
NftTokenTransferSnippet
value=
{
'
value
'
in
total
&&
total
.
value
?
token=
{
data
.
token
}
getCurrencyValue
({
value
:
total
.
value
,
decimals
:
total
.
decimals
||
'
0
'
,
accuracy
:
2
}).
valueStr
:
tokenId=
{
total
.
token_id
}
'
1
'
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 @
af7a835f
View file @
3e0f6e67
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 @
af7a835f
View file @
3e0f6e67
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