|
|
|
'use client' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import NotionPage from '@/components/NotionPage' |
|
import Header from './components/Header' |
|
import Footer from './components/Footer' |
|
import Hero from './components/Hero' |
|
import Features from './components/Features' |
|
import FeaturesBlocks from './components/FeaturesBlocks' |
|
import Testimonials from './components/Testimonials' |
|
import Newsletter from './components/Newsletter' |
|
import { useRouter } from 'next/router' |
|
import CONFIG from './config' |
|
import Loading from '@/components/Loading' |
|
import { isBrowser } from '@/lib/utils' |
|
import { siteConfig } from '@/lib/config' |
|
import { Pricing } from './components/Pricing' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const LayoutBase = (props) => { |
|
const { children } = props |
|
|
|
return <div id='theme-landing' className="overflow-hidden flex flex-col justify-between bg-white dark:bg-black"> |
|
|
|
{/* 顶部导航栏 */} |
|
<Header /> |
|
|
|
{/* 内容 */} |
|
<div id='content-wrapper'> |
|
{children} |
|
</div> |
|
|
|
{/* 底部页脚 */} |
|
<Footer /> |
|
</div> |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
const LayoutIndex = (props) => { |
|
return ( |
|
<> |
|
<Hero /> |
|
<Features /> |
|
<FeaturesBlocks /> |
|
<Testimonials /> |
|
<Pricing/> |
|
<Newsletter /> |
|
</> |
|
) |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
const LayoutSlug = (props) => { |
|
|
|
const router = useRouter() |
|
if (JSON.parse(siteConfig('LANDING_POST_REDIRECT_ENABLE', null, CONFIG)) && isBrowser && router.route === '/[prefix]/[slug]') { |
|
const redirectUrl = siteConfig('LANDING_POST_REDIRECT_URL', null, CONFIG) + router.asPath.replace('?theme=landing', '') |
|
router.push(redirectUrl) |
|
return <div id='theme-landing'><Loading /></div> |
|
} |
|
|
|
return <> |
|
<div id='container-inner' className='mx-auto max-w-screen-lg p-12'> |
|
<NotionPage {...props} /> |
|
</div> |
|
</> |
|
} |
|
|
|
|
|
const LayoutSearch = (props) => <><Hero /></> |
|
const LayoutArchive = (props) => <><Hero /></> |
|
const Layout404 = (props) => <><Hero /></> |
|
const LayoutCategoryIndex = (props) => <><Hero /></> |
|
const LayoutPostList = (props) => <><Hero /></> |
|
const LayoutTagIndex = (props) => <><Hero /></> |
|
|
|
export { |
|
CONFIG as THEME_CONFIG, |
|
LayoutBase, |
|
LayoutIndex, |
|
LayoutSearch, |
|
LayoutArchive, |
|
LayoutSlug, |
|
Layout404, |
|
LayoutPostList, |
|
LayoutCategoryIndex, |
|
LayoutTagIndex |
|
} |
|
|