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
f14596e4
Commit
f14596e4
authored
Dec 09, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creation and last balance update
parent
a02b8064
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
AddressDetails.tsx
ui/address/AddressDetails.tsx
+31
-1
AddressBalance.tsx
ui/address/details/AddressBalance.tsx
+1
-0
No files found.
ui/address/AddressDetails.tsx
View file @
f14596e4
import
{
Box
,
Flex
,
Text
,
Icon
,
Button
,
Grid
,
Select
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Text
,
Icon
,
Button
,
Grid
,
Select
,
Link
}
from
'
@chakra-ui/react
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
...
@@ -9,13 +9,16 @@ import type { Address as TAddress, AddressCounters, AddressTokenBalance } from '
...
@@ -9,13 +9,16 @@ import type { Address as TAddress, AddressCounters, AddressTokenBalance } from '
import
{
QueryKeys
}
from
'
types/client/queries
'
;
import
{
QueryKeys
}
from
'
types/client/queries
'
;
import
appConfig
from
'
configs/app/config
'
;
import
appConfig
from
'
configs/app/config
'
;
import
blockIcon
from
'
icons/block.svg
'
;
import
metamaskIcon
from
'
icons/metamask.svg
'
;
import
metamaskIcon
from
'
icons/metamask.svg
'
;
import
qrCodeIcon
from
'
icons/qr_code.svg
'
;
import
qrCodeIcon
from
'
icons/qr_code.svg
'
;
import
starOutlineIcon
from
'
icons/star_outline.svg
'
;
import
starOutlineIcon
from
'
icons/star_outline.svg
'
;
import
walletIcon
from
'
icons/wallet.svg
'
;
import
walletIcon
from
'
icons/wallet.svg
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
link
from
'
lib/link/link
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
...
@@ -91,6 +94,16 @@ const AddressDetails = ({ addressQuery }: Props) => {
...
@@ -91,6 +94,16 @@ const AddressDetails = ({ addressQuery }: Props) => {
templateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
auto minmax(0, 1fr)
'
}
}
overflow=
"hidden"
templateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
auto minmax(0, 1fr)
'
}
}
overflow=
"hidden"
>
>
<
AddressNameInfo
data=
{
addressQuery
.
data
}
/>
<
AddressNameInfo
data=
{
addressQuery
.
data
}
/>
{
addressQuery
.
data
.
is_contract
&&
addressQuery
.
data
.
creation_tx_hash
&&
addressQuery
.
data
.
creator_address_hash
&&
(
<
DetailsInfoItem
title=
"Creator"
hint=
"Transaction and address of creation."
>
<
AddressLink
hash=
{
addressQuery
.
data
.
creator_address_hash
}
truncation=
"constant"
/>
<
Text
whiteSpace=
"pre"
>
at
</
Text
>
<
AddressLink
hash=
{
addressQuery
.
data
.
creation_tx_hash
}
truncation=
"constant"
/>
</
DetailsInfoItem
>
)
}
<
AddressBalance
data=
{
addressQuery
.
data
}
/>
<
AddressBalance
data=
{
addressQuery
.
data
}
/>
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Tokens"
title=
"Tokens"
...
@@ -144,6 +157,23 @@ const AddressDetails = ({ addressQuery }: Props) => {
...
@@ -144,6 +157,23 @@ const AddressDetails = ({ addressQuery }: Props) => {
{
Number
(
countersQuery
.
data
.
validation_count
).
toLocaleString
()
}
{
Number
(
countersQuery
.
data
.
validation_count
).
toLocaleString
()
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
{
addressQuery
.
data
.
block_number_balance_updated_at
&&
(
<
DetailsInfoItem
title=
"Last balance update"
hint=
"Block number in which the address was updated."
alignSelf=
"center"
py=
{
{
base
:
0
,
lg
:
1
}
}
>
<
Link
href=
{
link
(
'
block
'
,
{
id
:
String
(
addressQuery
.
data
.
block_number_balance_updated_at
)
})
}
display=
"flex"
alignItems=
"center"
>
<
Icon
as=
{
blockIcon
}
boxSize=
{
6
}
mr=
{
2
}
/>
{
addressQuery
.
data
.
block_number_balance_updated_at
}
</
Link
>
</
DetailsInfoItem
>
)
}
</
Grid
>
</
Grid
>
</
Box
>
</
Box
>
);
);
...
...
ui/address/details/AddressBalance.tsx
View file @
f14596e4
...
@@ -34,6 +34,7 @@ const AddressBalance = ({ data }: Props) => {
...
@@ -34,6 +34,7 @@ const AddressBalance = ({ data }: Props) => {
...
prevData
,
...
prevData
,
coin_balance
:
balance
,
coin_balance
:
balance
,
exchange_rate
:
exchangeRate
,
exchange_rate
:
exchangeRate
,
block_number_balance_updated_at
:
blockNumber
,
};
};
});
});
},
[
data
.
hash
,
lastBlockNumber
,
queryClient
]);
},
[
data
.
hash
,
lastBlockNumber
,
queryClient
]);
...
...
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