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
ecdc5c90
Unverified
Commit
ecdc5c90
authored
Jul 10, 2023
by
tom goriunov
Committed by
GitHub
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
title for marketplace app page (#990)
Fixes #983
parent
f566ff9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
34 deletions
+56
-34
[id].tsx
pages/apps/[id].tsx
+8
-4
index.tsx
pages/apps/index.tsx
+6
-5
MarketplaceApp.tsx
ui/pages/MarketplaceApp.tsx
+42
-25
No files found.
pages/apps/[id].tsx
View file @
ecdc5c90
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
}
from
'
next
'
;
import
dynamic
from
'
next/dynamic
'
;
import
Head
from
'
next/head
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
MarketplaceApp
from
'
ui/pages/MarketplaceApp
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
MarketplaceApp
=
dynamic
(()
=>
import
(
'
ui/pages/MarketplaceApp
'
),
{
ssr
:
false
});
const
MarketplaceAppPage
:
NextPage
=
()
=>
{
const
MarketplaceAppPage
:
NextPage
=
()
=>
{
return
(
return
(
<
Page
wrapChildren=
{
false
}
>
<>
<
Head
><
title
>
Blockscout | Marketplace
</
title
></
Head
>
<
Head
><
title
>
Blockscout | Marketplace
</
title
></
Head
>
<
MarketplaceApp
/>
<
Page
wrapChildren=
{
false
}
>
</
Page
>
<
MarketplaceApp
/>
</
Page
>
</>
);
);
};
};
...
...
pages/apps/index.tsx
View file @
ecdc5c90
...
@@ -10,12 +10,13 @@ const Marketplace = dynamic(() => import('ui/pages/Marketplace'), { ssr: false }
...
@@ -10,12 +10,13 @@ const Marketplace = dynamic(() => import('ui/pages/Marketplace'), { ssr: false }
const
MarketplacePage
:
NextPage
=
()
=>
{
const
MarketplacePage
:
NextPage
=
()
=>
{
return
(
return
(
<
Page
>
<>
<
PageTitle
title=
"Marketplace"
/>
<
Head
><
title
>
Blockscout | Marketplace
</
title
></
Head
>
<
Head
><
title
>
Blockscout | Marketplace
</
title
></
Head
>
<
Page
>
<
Marketplace
/>
<
PageTitle
title=
"Marketplace"
/>
</
Page
>
<
Marketplace
/>
</
Page
>
</>
);
);
};
};
...
...
ui/pages/MarketplaceApp.tsx
View file @
ecdc5c90
...
@@ -8,9 +8,11 @@ import type { MarketplaceAppOverview } from 'types/client/marketplace';
...
@@ -8,9 +8,11 @@ import type { MarketplaceAppOverview } from 'types/client/marketplace';
import
appConfig
from
'
configs/app/config
'
;
import
appConfig
from
'
configs/app/config
'
;
import
type
{
ResourceError
}
from
'
lib/api/resources
'
;
import
type
{
ResourceError
}
from
'
lib/api/resources
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
useApiFetch
from
'
lib/hooks/useFetch
'
;
import
useApiFetch
from
'
lib/hooks/useFetch
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
const
IFRAME_SANDBOX_ATTRIBUTE
=
'
allow-forms allow-orientation-lock
'
+
const
IFRAME_SANDBOX_ATTRIBUTE
=
'
allow-forms allow-orientation-lock
'
+
'
allow-pointer-lock allow-popups-to-escape-sandbox
'
+
'
allow-pointer-lock allow-popups-to-escape-sandbox
'
+
...
@@ -23,6 +25,7 @@ const MarketplaceApp = () => {
...
@@ -23,6 +25,7 @@ const MarketplaceApp = () => {
const
ref
=
useRef
<
HTMLIFrameElement
>
(
null
);
const
ref
=
useRef
<
HTMLIFrameElement
>
(
null
);
const
apiFetch
=
useApiFetch
();
const
apiFetch
=
useApiFetch
();
const
appProps
=
useAppContext
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
id
=
getQueryParamString
(
router
.
query
.
id
);
const
id
=
getQueryParamString
(
router
.
query
.
id
);
...
@@ -71,32 +74,46 @@ const MarketplaceApp = () => {
...
@@ -71,32 +74,46 @@ const MarketplaceApp = () => {
throw
new
Error
(
'
Unable to load app
'
,
{
cause
:
error
});
throw
new
Error
(
'
Unable to load app
'
,
{
cause
:
error
});
}
}
const
backLink
=
React
.
useMemo
(()
=>
{
const
hasGoBackLink
=
appProps
.
referrer
.
includes
(
'
/apps
'
);
if
(
!
hasGoBackLink
)
{
return
;
}
return
{
label
:
'
Back to marketplace
'
,
url
:
appProps
.
referrer
,
};
},
[
appProps
.
referrer
]);
return
(
return
(
<
Center
<>
as=
"main"
{
!
isLoading
&&
<
PageTitle
title=
{
data
.
title
}
px=
{
{
base
:
4
,
lg
:
12
}
}
pt=
{
{
base
:
'
138px
'
,
lg
:
0
}
}
backLink=
{
backLink
}
/>
}
h=
"100vh"
<
Center
pt=
{
{
base
:
'
138px
'
,
lg
:
0
}
}
as=
"main"
pb=
{
{
base
:
0
,
lg
:
10
}
}
h=
"100vh"
>
>
{
(
isFrameLoading
)
&&
(
{
(
isFrameLoading
)
&&
(
<
ContentLoader
/>
<
ContentLoader
/>
)
}
)
}
{
data
&&
(
{
data
&&
(
<
Box
<
Box
allow=
{
IFRAME_ALLOW_ATTRIBUTE
}
allow=
{
IFRAME_ALLOW_ATTRIBUTE
}
ref=
{
ref
}
ref=
{
ref
}
sandbox=
{
IFRAME_SANDBOX_ATTRIBUTE
}
sandbox=
{
IFRAME_SANDBOX_ATTRIBUTE
}
as=
"iframe"
as=
"iframe"
h=
"100%"
h=
"100%"
w=
"100%"
w=
"100%"
display=
{
isFrameLoading
?
'
none
'
:
'
block
'
}
display=
{
isFrameLoading
?
'
none
'
:
'
block
'
}
src=
{
data
.
url
}
src=
{
data
.
url
}
title=
{
data
.
title
}
title=
{
data
.
title
}
onLoad=
{
handleIframeLoad
}
onLoad=
{
handleIframeLoad
}
/>
/>
)
}
)
}
</
Center
>
</
Center
>
</>
);
);
};
};
...
...
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