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
6a2ec0e0
Unverified
Commit
6a2ec0e0
authored
Aug 01, 2023
by
Igor Stuev
Committed by
GitHub
Aug 01, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1048 from blockscout/no-rpc-no-add-network
hide add to wallet button if no rpc url
parents
38c25380
8078b937
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
[id].tsx
pages/apps/[id].tsx
+13
-2
index.tsx
pages/apps/index.tsx
+13
-2
NetworkAddToWallet.tsx
ui/shared/NetworkAddToWallet.tsx
+1
-1
No files found.
pages/apps/[id].tsx
View file @
6a2ec0e0
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetServerSideProps
}
from
'
next
'
;
import
dynamic
from
'
next/dynamic
'
;
import
dynamic
from
'
next/dynamic
'
;
import
Head
from
'
next/head
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
type
{
Props
}
from
'
lib/next/getServerSideProps
'
;
import
{
getServerSideProps
as
getServerSidePropsBase
}
from
'
lib/next/getServerSideProps
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
MarketplaceApp
=
dynamic
(()
=>
import
(
'
ui/pages/MarketplaceApp
'
),
{
ssr
:
false
});
const
MarketplaceApp
=
dynamic
(()
=>
import
(
'
ui/pages/MarketplaceApp
'
),
{
ssr
:
false
});
...
@@ -20,4 +23,12 @@ const MarketplaceAppPage: NextPage = () => {
...
@@ -20,4 +23,12 @@ const MarketplaceAppPage: NextPage = () => {
export
default
MarketplaceAppPage
;
export
default
MarketplaceAppPage
;
export
{
getServerSideProps
}
from
'
lib/next/getServerSideProps
'
;
export
const
getServerSideProps
:
GetServerSideProps
<
Props
>
=
async
(
args
)
=>
{
if
(
!
appConfig
.
marketplace
.
configUrl
||
!
appConfig
.
network
.
rpcUrl
)
{
return
{
notFound
:
true
,
};
}
return
getServerSidePropsBase
(
args
);
};
pages/apps/index.tsx
View file @
6a2ec0e0
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetServerSideProps
}
from
'
next
'
;
import
dynamic
from
'
next/dynamic
'
;
import
dynamic
from
'
next/dynamic
'
;
import
Head
from
'
next/head
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
type
{
Props
}
from
'
lib/next/getServerSideProps
'
;
import
{
getServerSideProps
as
getServerSidePropsBase
}
from
'
lib/next/getServerSideProps
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
...
@@ -22,4 +25,12 @@ const MarketplacePage: NextPage = () => {
...
@@ -22,4 +25,12 @@ const MarketplacePage: NextPage = () => {
export
default
MarketplacePage
;
export
default
MarketplacePage
;
export
{
getServerSideProps
}
from
'
lib/next/getServerSideProps
'
;
export
const
getServerSideProps
:
GetServerSideProps
<
Props
>
=
async
(
args
)
=>
{
if
(
!
appConfig
.
marketplace
.
configUrl
||
!
appConfig
.
network
.
rpcUrl
)
{
return
{
notFound
:
true
,
};
}
return
getServerSidePropsBase
(
args
);
};
ui/shared/NetworkAddToWallet.tsx
View file @
6a2ec0e0
...
@@ -54,7 +54,7 @@ const NetworkAddToWallet = ({ className }: Props) => {
...
@@ -54,7 +54,7 @@ const NetworkAddToWallet = ({ className }: Props) => {
}
}
},
[
provider
,
toast
]);
},
[
provider
,
toast
]);
if
(
!
provider
)
{
if
(
!
provider
||
!
appConfig
.
network
.
rpcUrl
)
{
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