mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
hotfix commerce: category list
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
import CONFIG from './config'
|
||||
|
||||
import { useEffect, useRef } from 'react'
|
||||
import Footer from './components/Footer'
|
||||
import LazyImage from '@/components/LazyImage'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import NotionPage from '@/components/NotionPage'
|
||||
import { siteConfig } from '@/lib/config'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import { isBrowser, scanAndConvertToLinks } from '@/lib/utils'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { ArticleLock } from './components/ArticleLock'
|
||||
import BlogPostArchive from './components/BlogPostArchive'
|
||||
import BlogPostListPage from './components/BlogPostListPage'
|
||||
import BlogPostListScroll from './components/BlogPostListScroll'
|
||||
import Hero from './components/Hero'
|
||||
import { useRouter } from 'next/router'
|
||||
import Card from './components/Card'
|
||||
import Footer from './components/Footer'
|
||||
import Header from './components/Header'
|
||||
import Hero from './components/Hero'
|
||||
import PostHeader from './components/PostHeader'
|
||||
import ProductCategories from './components/ProductCategories'
|
||||
import ProductCenter from './components/ProductCenter'
|
||||
import RightFloatArea from './components/RightFloatArea'
|
||||
import SearchNav from './components/SearchNav'
|
||||
import BlogPostArchive from './components/BlogPostArchive'
|
||||
import { ArticleLock } from './components/ArticleLock'
|
||||
import PostHeader from './components/PostHeader'
|
||||
import TocDrawer from './components/TocDrawer'
|
||||
import NotionPage from '@/components/NotionPage'
|
||||
import TagItemMini from './components/TagItemMini'
|
||||
import Link from 'next/link'
|
||||
import SlotBar from './components/SlotBar'
|
||||
import { Transition } from '@headlessui/react'
|
||||
import TagItemMini from './components/TagItemMini'
|
||||
import TocDrawer from './components/TocDrawer'
|
||||
import { Style } from './style'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import { siteConfig } from '@/lib/config'
|
||||
import Header from './components/Header'
|
||||
import ProductCenter from './components/ProductCenter'
|
||||
import LazyImage from '@/components/LazyImage'
|
||||
import ProductCategories from './components/ProductCategories'
|
||||
|
||||
/**
|
||||
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
|
||||
@@ -35,17 +35,19 @@ import ProductCategories from './components/ProductCategories'
|
||||
* @constructor
|
||||
*/
|
||||
const LayoutBase = props => {
|
||||
const { children, post, floatSlot, slotTop, slotRight, meta, className } =
|
||||
props
|
||||
const { children, post, floatSlot, slotTop, className } = props
|
||||
const { onLoading } = useGlobal()
|
||||
|
||||
const router = useRouter()
|
||||
// 查找页面上的 链接,并便成为可点击
|
||||
useEffect(() => {
|
||||
scanAndConvertToLinks(document.getElementById('theme-commerce'))
|
||||
})
|
||||
}, [router])
|
||||
|
||||
const slotRight = router.route !== '/' && !post && (
|
||||
<ProductCategories {...props} />
|
||||
)
|
||||
|
||||
let headerSlot = null
|
||||
const router = useRouter()
|
||||
if (router.route === '/' && !post) {
|
||||
headerSlot = JSON.parse(siteConfig('COMMERCE_HOME_BANNER_ENABLE', true)) ? (
|
||||
<Hero {...props} />
|
||||
@@ -146,18 +148,15 @@ const LayoutIndex = props => {
|
||||
* @returns
|
||||
*/
|
||||
const LayoutPostList = props => {
|
||||
const slotRight = <ProductCategories {...props} />
|
||||
return (
|
||||
<LayoutBase {...props} slotRight={slotRight}>
|
||||
<div className='bg-white border-[#D2232A] p-4'>
|
||||
<SlotBar {...props} />
|
||||
{siteConfig('POST_LIST_STYLE') === 'page' ? (
|
||||
<BlogPostListPage {...props} />
|
||||
) : (
|
||||
<BlogPostListScroll {...props} />
|
||||
)}
|
||||
</div>
|
||||
</LayoutBase>
|
||||
<div className='bg-white border-[#D2232A] p-4'>
|
||||
<SlotBar {...props} />
|
||||
{siteConfig('POST_LIST_STYLE') === 'page' ? (
|
||||
<BlogPostListPage {...props} />
|
||||
) : (
|
||||
<BlogPostListScroll {...props} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -241,7 +240,6 @@ const LayoutSlug = props => {
|
||||
const headerImage = post?.pageCover
|
||||
? post.pageCover
|
||||
: siteConfig('HOME_BANNER_IMAGE')
|
||||
const floatSlot = <></>
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -395,14 +393,14 @@ const LayoutTagIndex = props => {
|
||||
}
|
||||
|
||||
export {
|
||||
CONFIG as THEME_CONFIG,
|
||||
LayoutBase,
|
||||
LayoutIndex,
|
||||
LayoutSearch,
|
||||
LayoutArchive,
|
||||
LayoutSlug,
|
||||
Layout404,
|
||||
LayoutArchive,
|
||||
LayoutBase,
|
||||
LayoutCategoryIndex,
|
||||
LayoutIndex,
|
||||
LayoutPostList,
|
||||
LayoutTagIndex
|
||||
LayoutSearch,
|
||||
LayoutSlug,
|
||||
LayoutTagIndex,
|
||||
CONFIG as THEME_CONFIG
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user