-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: common FAQ section * feat: import FAQ content from CMS * fix: undo unrelated changes
- Loading branch information
1 parent
ba095b6
commit f140ac5
Showing
5 changed files
with
40 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
import walletContent from '@/content/wallet.json' | ||
import type { InferGetStaticPropsType } from 'next' | ||
import PageContent from '../common/PageContent' | ||
import type { getStaticProps } from '@/pages/wallet' | ||
import walletContent from '@/content/wallet.json' | ||
import FaqContentContext from '@/contexts/FaqContentContext' | ||
|
||
export const Wallet = () => <PageContent content={walletContent} path="wallet.json" /> | ||
export const Wallet = ({ pageData }: InferGetStaticPropsType<typeof getStaticProps>) => ( | ||
<FaqContentContext.Provider value={pageData}> | ||
<PageContent content={walletContent} path="wallet.json" /> | ||
</FaqContentContext.Provider> | ||
) |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createContext } from 'react' | ||
import type { BaseBlockEntry } from '@/config/types' | ||
|
||
const FaqContentContext = createContext<{ | ||
faqContent: BaseBlockEntry | null | ||
}>({ | ||
faqContent: null, | ||
}) | ||
|
||
export default FaqContentContext |
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,6 +1,16 @@ | ||
import type { NextPage } from 'next' | ||
import type { InferGetStaticPropsType, NextPage } from 'next' | ||
import client from '@/lib/contentful' | ||
import { Wallet } from '@/components/Wallet' | ||
import type { TypeBaseBlockSkeleton } from '@/contentful/types' | ||
|
||
const WalletPage: NextPage = () => <Wallet /> | ||
const FAQ_CONTENT_TYPE_ID = '1jCIVFDUzFO1okK8b6TTxS' | ||
|
||
const WalletPage: NextPage<InferGetStaticPropsType<typeof getStaticProps>> = (props) => <Wallet {...props} /> | ||
|
||
export async function getStaticProps() { | ||
const faqContent = await client.getEntry<TypeBaseBlockSkeleton>(FAQ_CONTENT_TYPE_ID) | ||
|
||
return { props: { pageData: { faqContent } } } | ||
} | ||
|
||
export default WalletPage |