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
7eba3e1c
Unverified
Commit
7eba3e1c
authored
Nov 08, 2023
by
tom goriunov
Committed by
GitHub
Nov 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] fix network explorer links (#1338)
parent
7938a80e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
Address.tsx
ui/pages/Address.tsx
+2
-2
NetworkExplorers.tsx
ui/shared/NetworkExplorers.tsx
+9
-6
No files found.
ui/pages/Address.tsx
View file @
7eba3e1c
...
@@ -179,7 +179,7 @@ const AddressPageContent = () => {
...
@@ -179,7 +179,7 @@ const AddressPageContent = () => {
const
titleSecondRow
=
(
const
titleSecondRow
=
(
<
Flex
alignItems=
"center"
w=
"100%"
columnGap=
{
2
}
rowGap=
{
2
}
flexWrap=
{
{
base
:
'
wrap
'
,
lg
:
'
nowrap
'
}
}
>
<
Flex
alignItems=
"center"
w=
"100%"
columnGap=
{
2
}
rowGap=
{
2
}
flexWrap=
{
{
base
:
'
wrap
'
,
lg
:
'
nowrap
'
}
}
>
<
AddressEntity
<
AddressEntity
address=
{
{
...
addressQuery
.
data
,
name
:
''
}
}
address=
{
{
...
addressQuery
.
data
,
hash
,
name
:
''
}
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
fontFamily=
"heading"
fontFamily=
"heading"
fontSize=
"lg"
fontSize=
"lg"
...
@@ -192,7 +192,7 @@ const AddressPageContent = () => {
...
@@ -192,7 +192,7 @@ const AddressPageContent = () => {
{
!
isLoading
&&
!
addressQuery
.
data
?.
is_contract
&&
config
.
features
.
account
.
isEnabled
&&
(
{
!
isLoading
&&
!
addressQuery
.
data
?.
is_contract
&&
config
.
features
.
account
.
isEnabled
&&
(
<
AddressFavoriteButton
hash=
{
hash
}
watchListId=
{
addressQuery
.
data
?.
watchlist_address_id
}
/>
<
AddressFavoriteButton
hash=
{
hash
}
watchListId=
{
addressQuery
.
data
?.
watchlist_address_id
}
/>
)
}
)
}
<
AddressQrCode
address=
{
addressQuery
.
data
}
isLoading=
{
isLoading
}
/>
<
AddressQrCode
address=
{
{
hash
}
}
isLoading=
{
isLoading
}
/>
<
AccountActionsMenu
isLoading=
{
isLoading
}
/>
<
AccountActionsMenu
isLoading=
{
isLoading
}
/>
<
NetworkExplorers
type=
"address"
pathParam=
{
hash
}
ml=
"auto"
/>
<
NetworkExplorers
type=
"address"
pathParam=
{
hash
}
ml=
"auto"
/>
</
Flex
>
</
Flex
>
...
...
ui/shared/NetworkExplorers.tsx
View file @
7eba3e1c
...
@@ -6,6 +6,7 @@ import type { NetworkExplorer as TNetworkExplorer } from 'types/networks';
...
@@ -6,6 +6,7 @@ import type { NetworkExplorer as TNetworkExplorer } from 'types/networks';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
arrowIcon
from
'
icons/arrows/east-mini.svg
'
;
import
arrowIcon
from
'
icons/arrows/east-mini.svg
'
;
import
explorerIcon
from
'
icons/explorer.svg
'
;
import
explorerIcon
from
'
icons/explorer.svg
'
;
import
stripTrailingSlash
from
'
lib/stripTrailingSlash
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
interface
Props
{
interface
Props
{
...
@@ -17,12 +18,14 @@ interface Props {
...
@@ -17,12 +18,14 @@ interface Props {
const
NetworkExplorers
=
({
className
,
type
,
pathParam
}:
Props
)
=>
{
const
NetworkExplorers
=
({
className
,
type
,
pathParam
}:
Props
)
=>
{
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
explorersLinks
=
config
.
UI
.
explorers
.
items
const
explorersLinks
=
React
.
useMemo
(()
=>
{
.
filter
((
explorer
)
=>
explorer
.
paths
[
type
])
return
config
.
UI
.
explorers
.
items
.
map
((
explorer
)
=>
{
.
filter
((
explorer
)
=>
typeof
explorer
.
paths
[
type
]
===
'
string
'
)
const
url
=
new
URL
(
explorer
.
paths
[
type
]
+
'
/
'
+
pathParam
,
explorer
.
baseUrl
);
.
map
((
explorer
)
=>
{
return
<
LinkExternal
key=
{
explorer
.
baseUrl
}
href=
{
url
.
toString
()
}
>
{
explorer
.
title
}
</
LinkExternal
>;
const
url
=
new
URL
(
stripTrailingSlash
(
explorer
.
paths
[
type
]
||
''
)
+
'
/
'
+
pathParam
,
explorer
.
baseUrl
);
});
return
<
LinkExternal
key=
{
explorer
.
baseUrl
}
href=
{
url
.
toString
()
}
>
{
explorer
.
title
}
</
LinkExternal
>;
});
},
[
pathParam
,
type
]);
if
(
explorersLinks
.
length
===
0
)
{
if
(
explorersLinks
.
length
===
0
)
{
return
null
;
return
null
;
...
...
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