forked from crowetic/commerce
HTMLContent
This commit is contained in:
parent
f60ee2d9ec
commit
177a6f530e
@ -1,12 +1,12 @@
|
|||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
import s from './PageContent.module.css'
|
import s from './HTMLContent.module.css'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: 'string'
|
className?: 'string'
|
||||||
html: string
|
html: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PageContent({ className, html }: Props) {
|
export default function HTMLContent({ className, html }: Props) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(s.root, className)}
|
className={cn(s.root, className)}
|
1
components/core/HTMLContent/index.ts
Normal file
1
components/core/HTMLContent/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default } from './HTMLContent'
|
@ -7,3 +7,4 @@ export { default as Searchbar } from './Searchbar'
|
|||||||
export { default as UserNav } from './UserNav'
|
export { default as UserNav } from './UserNav'
|
||||||
export { default as Toggle } from './Toggle'
|
export { default as Toggle } from './Toggle'
|
||||||
export { default as Head } from './Head'
|
export { default as Head } from './Head'
|
||||||
|
export { default as HTMLContent } from './HTMLContent'
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export { default } from './PageContent'
|
|
@ -1,9 +1,8 @@
|
|||||||
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||||
import { Layout } from '@components/core'
|
|
||||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
|
||||||
import getPage from '@lib/bigcommerce/api/operations/get-page'
|
|
||||||
import getSlug from '@utils/get-slug'
|
import getSlug from '@utils/get-slug'
|
||||||
import PageContent from '@components/custom-pages/PageContent'
|
import getPage from '@lib/bigcommerce/api/operations/get-page'
|
||||||
|
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||||
|
import { Layout, HTMLContent } from '@components/core'
|
||||||
|
|
||||||
export async function getStaticProps({
|
export async function getStaticProps({
|
||||||
preview,
|
preview,
|
||||||
@ -40,7 +39,7 @@ export default function Pages({
|
|||||||
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-2xl mx-auto py-20">
|
<div className="max-w-2xl mx-auto py-20">
|
||||||
<PageContent html={page.body} />
|
<HTMLContent html={page.body} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user