fix:post-scroll-page

This commit is contained in:
tangly1024
2022-04-19 16:15:34 +08:00
parent cd16275b0a
commit 92071cccb7
5 changed files with 11 additions and 6 deletions

View File

@@ -3,6 +3,6 @@ import LayoutBase from './LayoutBase'
export const LayoutIndex = (props) => { export const LayoutIndex = (props) => {
return <LayoutBase {...props}> return <LayoutBase {...props}>
<BlogListPage {...props}/> <BlogListPage {...props} />
</LayoutBase> </LayoutBase>
} }

View File

@@ -1,10 +1,12 @@
import BLOG from '@/blog.config'
import BlogPostListPage from './components/BlogPostListPage' import BlogPostListPage from './components/BlogPostListPage'
import BlogPostListScroll from './components/BlogPostListScroll'
import Header from './components/Header' import Header from './components/Header'
import CONFIG_HEXO from './config_hexo' import CONFIG_HEXO from './config_hexo'
import LayoutBase from './LayoutBase' import LayoutBase from './LayoutBase'
export const LayoutIndex = (props) => { export const LayoutIndex = (props) => {
return <LayoutBase {...props} headerSlot={CONFIG_HEXO.HOME_BANNER_ENABLE && <Header {...props}/>}> return <LayoutBase {...props} headerSlot={CONFIG_HEXO.HOME_BANNER_ENABLE && <Header {...props} />}>
<BlogPostListPage {...props}/> {BLOG.POST_LIST_STYLE === 'page' ? <BlogPostListPage {...props} /> : <BlogPostListScroll {...props} />}
</LayoutBase> </LayoutBase>
} }

View File

@@ -1,8 +1,10 @@
import BLOG from '@/blog.config'
import BlogPostListPage from './components/BlogPostListPage' import BlogPostListPage from './components/BlogPostListPage'
import BlogPostListScroll from './components/BlogPostListScroll'
import LayoutBase from './LayoutBase' import LayoutBase from './LayoutBase'
export const LayoutIndex = (props) => { export const LayoutIndex = (props) => {
return <LayoutBase {...props}> return <LayoutBase {...props}>
<BlogPostListPage {...props}/> {BLOG.POST_LIST_STYLE === 'page' ? <BlogPostListPage {...props} /> : <BlogPostListScroll {...props} />}
</LayoutBase> </LayoutBase>
} }

View File

@@ -74,7 +74,7 @@ const BlogPostListScroll = ({ posts = [], currentSearch }) => {
<div onClick={() => { <div onClick={() => {
handleGetMore() handleGetMore()
}} }}
className='w-full my-4 py-4 text-center cursor-pointer glassmorphism shadow-xl rounded-xl dark:text-gray-200' className='w-full my-4 py-4 text-center cursor-pointer dark:text-gray-200'
> {hasMore ? locale.COMMON.MORE : `${locale.COMMON.NO_MORE} 😰`} </div> > {hasMore ? locale.COMMON.MORE : `${locale.COMMON.NO_MORE} 😰`} </div>
</div> </div>
</div> </div>

View File

@@ -5,6 +5,7 @@ import Card from './components/Card'
import BlogPostListScroll from './components/BlogPostListScroll' import BlogPostListScroll from './components/BlogPostListScroll'
import BlogPostListPage from './components/BlogPostListPage' import BlogPostListPage from './components/BlogPostListPage'
import CONFIG_NEXT from './config_next' import CONFIG_NEXT from './config_next'
import BLOG from '@/blog.config'
export const LayoutIndex = (props) => { export const LayoutIndex = (props) => {
const { latestPosts } = props const { latestPosts } = props
@@ -15,7 +16,7 @@ export const LayoutIndex = (props) => {
rightAreaSlot={rightAreaSlot} rightAreaSlot={rightAreaSlot}
{...props} {...props}
> >
{CONFIG_NEXT.POST_LIST_TYPE !== 'page' {BLOG.POST_LIST_TYPE !== 'page'
? <BlogPostListScroll {...props} showSummary={true} /> ? <BlogPostListScroll {...props} showSummary={true} />
: <BlogPostListPage {...props} /> : <BlogPostListPage {...props} />
} }