-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust title for dapps category pages
- Loading branch information
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
import type { NextPage } from 'next'; | ||
import type { GetServerSideProps } from 'next'; | ||
import dynamic from 'next/dynamic'; | ||
import React from 'react'; | ||
|
||
import type { NextPageWithLayout } from 'nextjs/types'; | ||
|
||
import type { Route } from 'nextjs-routes'; | ||
import * as gSSP from 'nextjs/getServerSideProps'; | ||
import type { Props } from 'nextjs/getServerSideProps'; | ||
import PageNextJs from 'nextjs/PageNextJs'; | ||
|
||
const Marketplace = dynamic(() => import('ui/pages/Marketplace'), { ssr: false }); | ||
|
||
const Page: NextPage = () => ( | ||
<PageNextJs pathname="/apps"> | ||
const pathname: Route['pathname'] = '/apps'; | ||
|
||
const Page: NextPageWithLayout<Props<typeof pathname>> = (props: Props<typeof pathname>) => ( | ||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }> | ||
<Marketplace/> | ||
</PageNextJs> | ||
); | ||
|
||
export default Page; | ||
|
||
export { marketplace as getServerSideProps } from 'nextjs/getServerSideProps'; | ||
export const getServerSideProps: GetServerSideProps<Props<typeof pathname>> = async(ctx) => { | ||
const baseResponse = await gSSP.marketplace<typeof pathname>(ctx); | ||
|
||
if ('props' in baseResponse) { | ||
(await baseResponse.props).apiData = { | ||
seo_category: typeof ctx.query.category === 'string' ? ctx.query.category : 'DApps', | ||
seo_details: ctx.query.category ? 'Decentralized trading apps' : 'Explore top apps', | ||
}; | ||
} | ||
|
||
return baseResponse; | ||
}; |