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
47e154d5
Commit
47e154d5
authored
Jan 17, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation name in tabs
parent
9db394ab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
ContractImplementationAddress.tsx
ui/address/contract/ContractImplementationAddress.tsx
+32
-0
ContractRead.tsx
ui/address/contract/ContractRead.tsx
+4
-2
ContractWrite.tsx
ui/address/contract/ContractWrite.tsx
+4
-2
No files found.
ui/address/contract/ContractImplementationAddress.tsx
0 → 100644
View file @
47e154d5
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
React
from
'
react
'
;
import
type
{
Address
as
TAddress
}
from
'
types/api/address
'
;
import
{
getResourceKey
}
from
'
lib/api/useApiQuery
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
interface
Props
{
hash
:
string
|
undefined
;
}
const
ContractImplementationAddress
=
({
hash
}:
Props
)
=>
{
const
queryClient
=
useQueryClient
();
const
data
=
queryClient
.
getQueryData
<
TAddress
>
(
getResourceKey
(
'
address
'
,
{
pathParams
:
{
id
:
hash
},
}));
if
(
!
data
?.
implementation_address
)
{
return
null
;
}
return
(
<
Address
whiteSpace=
"pre-wrap"
flexWrap=
"wrap"
mb=
{
6
}
>
<
span
>
Implementation address:
</
span
>
<
AddressLink
hash=
{
data
.
implementation_address
}
/>
</
Address
>
);
};
export
default
React
.
memo
(
ContractImplementationAddress
);
ui/address/contract/ContractRead.tsx
View file @
47e154d5
...
@@ -12,6 +12,7 @@ import ContentLoader from 'ui/shared/ContentLoader';
...
@@ -12,6 +12,7 @@ import ContentLoader from 'ui/shared/ContentLoader';
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
ContractConnectWallet
from
'
./ContractConnectWallet
'
;
import
ContractConnectWallet
from
'
./ContractConnectWallet
'
;
import
ContractImplementationAddress
from
'
./ContractImplementationAddress
'
;
import
ContractMethodCallable
from
'
./ContractMethodCallable
'
;
import
ContractMethodCallable
from
'
./ContractMethodCallable
'
;
import
ContractMethodConstant
from
'
./ContractMethodConstant
'
;
import
ContractMethodConstant
from
'
./ContractMethodConstant
'
;
import
ContractReadResult
from
'
./ContractReadResult
'
;
import
ContractReadResult
from
'
./ContractReadResult
'
;
...
@@ -80,13 +81,14 @@ const ContractRead = ({ isProxy }: Props) => {
...
@@ -80,13 +81,14 @@ const ContractRead = ({ isProxy }: Props) => {
return
<
ContentLoader
/>;
return
<
ContentLoader
/>;
}
}
if
(
data
.
length
===
0
)
{
if
(
data
.
length
===
0
&&
!
isProxy
)
{
return
<
span
>
No public read
{
isProxy
?
'
proxy
'
:
''
}
functions were found for this contract.
</
span
>;
return
<
span
>
No public read functions were found for this contract.
</
span
>;
}
}
return
(
return
(
<>
<>
<
ContractConnectWallet
/>
<
ContractConnectWallet
/>
{
isProxy
&&
<
ContractImplementationAddress
hash=
{
addressHash
}
/>
}
<
ContractMethodsAccordion
data=
{
data
}
renderContent=
{
renderContent
}
/>
<
ContractMethodsAccordion
data=
{
data
}
renderContent=
{
renderContent
}
/>
</>
</>
);
);
...
...
ui/address/contract/ContractWrite.tsx
View file @
47e154d5
...
@@ -13,6 +13,7 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert';
...
@@ -13,6 +13,7 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert';
import
{
useContractContext
}
from
'
./context
'
;
import
{
useContractContext
}
from
'
./context
'
;
import
ContractConnectWallet
from
'
./ContractConnectWallet
'
;
import
ContractConnectWallet
from
'
./ContractConnectWallet
'
;
import
ContractImplementationAddress
from
'
./ContractImplementationAddress
'
;
import
ContractMethodCallable
from
'
./ContractMethodCallable
'
;
import
ContractMethodCallable
from
'
./ContractMethodCallable
'
;
import
ContractWriteResult
from
'
./ContractWriteResult
'
;
import
ContractWriteResult
from
'
./ContractWriteResult
'
;
import
{
getNativeCoinValue
,
isExtendedError
}
from
'
./utils
'
;
import
{
getNativeCoinValue
,
isExtendedError
}
from
'
./utils
'
;
...
@@ -108,13 +109,14 @@ const ContractWrite = ({ isProxy }: Props) => {
...
@@ -108,13 +109,14 @@ const ContractWrite = ({ isProxy }: Props) => {
return
<
ContentLoader
/>;
return
<
ContentLoader
/>;
}
}
if
(
data
.
length
===
0
)
{
if
(
data
.
length
===
0
&&
!
isProxy
)
{
return
<
span
>
No public write
{
isProxy
?
'
proxy
'
:
''
}
functions were found for this contract.
</
span
>;
return
<
span
>
No public write functions were found for this contract.
</
span
>;
}
}
return
(
return
(
<>
<>
<
ContractConnectWallet
/>
<
ContractConnectWallet
/>
{
isProxy
&&
<
ContractImplementationAddress
hash=
{
addressHash
}
/>
}
<
ContractMethodsAccordion
data=
{
data
}
renderContent=
{
renderContent
}
/>
<
ContractMethodsAccordion
data=
{
data
}
renderContent=
{
renderContent
}
/>
</>
</>
);
);
...
...
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