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
deb3868b
Commit
deb3868b
authored
Mar 30, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite change
parent
7098908a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
21 deletions
+19
-21
TxState.pw.tsx_default_base-view-mobile-1.png
...reenshots__/TxState.pw.tsx_default_base-view-mobile-1.png
+0
-0
TxState.pw.tsx_mobile_base-view-mobile-1.png
...creenshots__/TxState.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
TxStateListItem.tsx
ui/tx/state/TxStateListItem.tsx
+6
-2
utils.tsx
ui/tx/state/utils.tsx
+13
-19
No files found.
ui/tx/__screenshots__/TxState.pw.tsx_default_base-view-mobile-1.png
View replaced file @
7098908a
View file @
deb3868b
41.1 KB
|
W:
|
H:
39.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/tx/__screenshots__/TxState.pw.tsx_mobile_base-view-mobile-1.png
View replaced file @
7098908a
View file @
deb3868b
55.3 KB
|
W:
|
H:
52.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/tx/state/TxStateListItem.tsx
View file @
deb3868b
...
@@ -43,8 +43,12 @@ const TxStateListItem = ({ data }: Props) => {
...
@@ -43,8 +43,12 @@ const TxStateListItem = ({ data }: Props) => {
</>
</>
)
}
)
}
<
ListItemMobileGrid
.
Label
>
Change
</
ListItemMobileGrid
.
Label
>
{
change
&&
(
<
ListItemMobileGrid
.
Value
>
{
change
}
</
ListItemMobileGrid
.
Value
>
<>
<
ListItemMobileGrid
.
Label
>
Change
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
{
change
}
</
ListItemMobileGrid
.
Value
>
</>
)
}
{
tokenId
&&
(
{
tokenId
&&
(
<>
<>
...
...
ui/tx/state/utils.tsx
View file @
deb3868b
...
@@ -25,7 +25,14 @@ export function getStateElements(data: TxStateChange) {
...
@@ -25,7 +25,14 @@ export function getStateElements(data: TxStateChange) {
}
}
if
(
data
.
address
.
hash
===
ZERO_ADDRESS
)
{
if
(
data
.
address
.
hash
===
ZERO_ADDRESS
)
{
const
changeDirection
=
Array
.
isArray
(
data
.
change
)
?
data
.
change
[
0
].
direction
:
null
;
const
changeDirection
=
(()
=>
{
if
(
Array
.
isArray
(
data
.
change
))
{
const
firstChange
=
data
.
change
[
0
];
return
firstChange
.
direction
;
}
return
Number
(
data
.
change
)
>
0
?
'
to
'
:
'
from
'
;
})();
if
(
changeDirection
)
{
if
(
changeDirection
)
{
const
text
=
changeDirection
===
'
from
'
?
'
Mint
'
:
'
Burn
'
;
const
text
=
changeDirection
===
'
from
'
?
'
Mint
'
:
'
Burn
'
;
return
(
return
(
...
@@ -58,29 +65,16 @@ export function getStateElements(data: TxStateChange) {
...
@@ -58,29 +65,16 @@ export function getStateElements(data: TxStateChange) {
const
tokenLink
=
<
AddressLink
type=
"token"
hash=
{
data
.
token
.
address
}
alias=
{
trimTokenSymbol
(
data
.
token
?.
symbol
||
data
.
token
.
address
)
}
/>;
const
tokenLink
=
<
AddressLink
type=
"token"
hash=
{
data
.
token
.
address
}
alias=
{
trimTokenSymbol
(
data
.
token
?.
symbol
||
data
.
token
.
address
)
}
/>;
const
before
=
Number
(
data
.
balance_before
);
const
before
=
Number
(
data
.
balance_before
);
const
after
=
Number
(
data
.
balance_after
);
const
after
=
Number
(
data
.
balance_after
);
const
difference
=
after
-
before
;
const
changeColor
=
difference
>=
0
?
'
green.500
'
:
'
red.500
'
;
const
changeSign
=
difference
>=
0
?
'
+
'
:
'
-
'
;
const
change
=
(()
=>
{
const
change
=
(()
=>
{
if
(
!
before
&&
!
after
&&
data
.
address
.
hash
===
ZERO_ADDRESS
)
{
const
difference
=
typeof
data
.
change
===
'
string
'
?
Number
(
data
.
change
)
:
after
-
before
;
const
changeDirection
=
Array
.
isArray
(
data
.
change
)
?
data
.
change
[
0
].
direction
:
null
;
if
(
changeDirection
)
{
return
(
<
Flex
color=
{
changeDirection
===
'
from
'
?
'
green.500
'
:
'
red.500
'
}
justifyContent=
{
{
base
:
'
flex-start
'
,
lg
:
'
flex-end
'
}
}
>
{
changeDirection
===
'
from
'
?
'
Mint
'
:
'
Burn
'
}
{
nbsp
}
{
tokenLink
}
</
Flex
>
);
}
}
if
(
!
difference
)
{
if
(
!
difference
)
{
return
<
Box
>
0
</
Box
>
;
return
null
;
}
}
const
changeColor
=
difference
>=
0
?
'
green.500
'
:
'
red.500
'
;
const
changeSign
=
difference
>=
0
?
'
+
'
:
'
-
'
;
return
<
Box
color=
{
changeColor
}
>
{
changeSign
}{
nbsp
}{
Math
.
abs
(
difference
).
toLocaleString
()
}
</
Box
>;
return
<
Box
color=
{
changeColor
}
>
{
changeSign
}{
nbsp
}{
Math
.
abs
(
difference
).
toLocaleString
()
}
</
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