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
19283abb
Unverified
Commit
19283abb
authored
Oct 10, 2023
by
tom goriunov
Committed by
GitHub
Oct 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Top accounts percentage of funds is not displayed correctly (#1274)
Fixes #1267
parent
6f422b9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
AddressesListItem.tsx
ui/addresses/AddressesListItem.tsx
+3
-2
AddressesTable.tsx
ui/addresses/AddressesTable.tsx
+4
-2
AddressesTableItem.tsx
ui/addresses/AddressesTableItem.tsx
+2
-2
Accounts.tsx
ui/pages/Accounts.tsx
+7
-2
No files found.
ui/addresses/AddressesListItem.tsx
View file @
19283abb
...
@@ -5,6 +5,7 @@ import React from 'react';
...
@@ -5,6 +5,7 @@ import React from 'react';
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
ZERO
}
from
'
lib/consts
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
...
@@ -12,7 +13,7 @@ import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
...
@@ -12,7 +13,7 @@ import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
type
Props
=
{
type
Props
=
{
item
:
AddressesItem
;
item
:
AddressesItem
;
index
:
number
;
index
:
number
;
totalSupply
:
string
;
totalSupply
:
BigNumber
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
...
@@ -47,7 +48,7 @@ const AddressesListItem = ({
...
@@ -47,7 +48,7 @@ const AddressesListItem = ({
<
span
>
{
addressBalance
.
dp
(
8
).
toFormat
()
}
</
span
>
<
span
>
{
addressBalance
.
dp
(
8
).
toFormat
()
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
{
totalSupply
&&
totalSupply
!==
'
0
'
&&
(
{
!
totalSupply
.
eq
(
ZERO
)
&&
(
<
HStack
spacing=
{
3
}
>
<
HStack
spacing=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Percentage
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Percentage
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
...
...
ui/addresses/AddressesTable.tsx
View file @
19283abb
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
type
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
ZERO
}
from
'
lib/consts
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
AddressesTableItem
from
'
./AddressesTableItem
'
;
import
AddressesTableItem
from
'
./AddressesTableItem
'
;
interface
Props
{
interface
Props
{
items
:
Array
<
AddressesItem
>
;
items
:
Array
<
AddressesItem
>
;
totalSupply
:
string
;
totalSupply
:
BigNumber
;
pageStartIndex
:
number
;
pageStartIndex
:
number
;
top
:
number
;
top
:
number
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
const
AddressesTable
=
({
items
,
totalSupply
,
pageStartIndex
,
top
,
isLoading
}:
Props
)
=>
{
const
AddressesTable
=
({
items
,
totalSupply
,
pageStartIndex
,
top
,
isLoading
}:
Props
)
=>
{
const
hasPercentage
=
Boolean
(
totalSupply
&&
totalSupply
!==
'
0
'
);
const
hasPercentage
=
!
totalSupply
.
eq
(
ZERO
);
return
(
return
(
<
Table
variant=
"simple"
size=
"sm"
>
<
Table
variant=
"simple"
size=
"sm"
>
<
Thead
top=
{
top
}
>
<
Thead
top=
{
top
}
>
...
...
ui/addresses/AddressesTableItem.tsx
View file @
19283abb
...
@@ -11,7 +11,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
...
@@ -11,7 +11,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
type
Props
=
{
type
Props
=
{
item
:
AddressesItem
;
item
:
AddressesItem
;
index
:
number
;
index
:
number
;
totalSupply
:
string
;
totalSupply
:
BigNumber
;
hasPercentage
:
boolean
;
hasPercentage
:
boolean
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
...
@@ -55,7 +55,7 @@ const AddressesTableItem = ({
...
@@ -55,7 +55,7 @@ const AddressesTableItem = ({
</
Td
>
</
Td
>
{
hasPercentage
&&
(
{
hasPercentage
&&
(
<
Td
isNumeric
>
<
Td
isNumeric
>
<
Text
lineHeight=
"24px"
>
{
addressBalance
.
div
(
BigNumber
(
totalSupply
)
).
multipliedBy
(
100
).
dp
(
8
).
toFormat
()
+
'
%
'
}
</
Text
>
<
Text
lineHeight=
"24px"
>
{
addressBalance
.
div
(
totalSupply
).
multipliedBy
(
100
).
dp
(
8
).
toFormat
()
+
'
%
'
}
</
Text
>
</
Td
>
</
Td
>
)
}
)
}
<
Td
isNumeric
>
<
Td
isNumeric
>
...
...
ui/pages/Accounts.tsx
View file @
19283abb
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
TOP_ADDRESS
}
from
'
stubs/address
'
;
import
{
TOP_ADDRESS
}
from
'
stubs/address
'
;
...
@@ -39,13 +40,17 @@ const Accounts = () => {
...
@@ -39,13 +40,17 @@ const Accounts = () => {
);
);
const
pageStartIndex
=
(
pagination
.
page
-
1
)
*
PAGE_SIZE
+
1
;
const
pageStartIndex
=
(
pagination
.
page
-
1
)
*
PAGE_SIZE
+
1
;
const
totalSupply
=
React
.
useMemo
(()
=>
{
return
BigNumber
(
data
?.
total_supply
||
'
0
'
);
},
[
data
?.
total_supply
]);
const
content
=
data
?.
items
?
(
const
content
=
data
?.
items
?
(
<>
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
AddressesTable
<
AddressesTable
top=
{
pagination
.
isVisible
?
80
:
0
}
top=
{
pagination
.
isVisible
?
80
:
0
}
items=
{
data
.
items
}
items=
{
data
.
items
}
totalSupply=
{
data
.
total_s
upply
}
totalSupply=
{
totalS
upply
}
pageStartIndex=
{
pageStartIndex
}
pageStartIndex=
{
pageStartIndex
}
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
/>
/>
...
@@ -57,7 +62,7 @@ const Accounts = () => {
...
@@ -57,7 +62,7 @@ const Accounts = () => {
key=
{
item
.
hash
+
(
isPlaceholderData
?
index
:
''
)
}
key=
{
item
.
hash
+
(
isPlaceholderData
?
index
:
''
)
}
item=
{
item
}
item=
{
item
}
index=
{
pageStartIndex
+
index
}
index=
{
pageStartIndex
+
index
}
totalSupply=
{
data
.
total_s
upply
}
totalSupply=
{
totalS
upply
}
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
/>
/>
);
);
...
...
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