This commit is contained in:
tangly1024
2023-03-25 15:42:33 +08:00
parent db5b815942
commit 246ae4fa6d
10 changed files with 14 additions and 14 deletions

View File

@@ -16,8 +16,9 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
if (!posts || posts.length === 0) {
return <BlogPostListEmpty />
} else {
return (
}
return (
<div className='w-full justify-center'>
<div id='container'>
{/* 文章列表 */}
@@ -27,8 +28,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
</div>
<PaginationSimple page={page} totalPage={totalPage} />
</div>
)
}
)
}
export default BlogPostListPage

View File

@@ -14,7 +14,7 @@ const Footer = ({ title }) => {
return (
<footer
className='z-10 dark:bg-hexo-black-gray flex-shrink-0 justify-center text-center m-auto w-full leading-6 text-gray-400 text-sm p-6 relative'
className='z-10 dark:bg-hexo-black-gray flex-shrink-0 justify-center text-center m-auto w-full leading-6 text-sm p-6 relative'
>
<DarkModeButton/>
<i className='fas fa-copyright' /> {`${copyrightDate}`} <span><i className='mx-1 animate-pulse fas fa-heart'/> <a href={BLOG.LINK} className='underline font-bold text-gray-500 dark:text-gray-300 '>{BLOG.AUTHOR}</a>.<br/>

View File

@@ -28,7 +28,7 @@ export const MenuBarMobile = (props) => {
return (
<nav id='nav' className=' text-md'>
{/* {links.map(link => <NormalMenu key={link.id} link={link}/>)} */}
{links.map(link => <MenuItemCollapse onHeightChange={props.onHeightChange} key={link.id} link={link}/>)}
{links?.map(link => <MenuItemCollapse onHeightChange={props.onHeightChange} key={link.id} link={link}/>)}
</nav>
)

View File

@@ -48,7 +48,7 @@ export const MenuItemCollapse = (props) => {
{/* 折叠子菜单 */}
{hasSubMenu && <Collapse isOpen={isOpen} onHeightChange={props.onHeightChange}>
{link.subMenus.map(sLink => {
{link?.subMenus?.map(sLink => {
return <div key={sLink.id} className='
not:last-child:border-b-0 border-b dark:border-gray-800 py-2 px-14 cursor-pointer hover:bg-gray-100 dark:text-gray-200
font-extralight dark:bg-black text-left justify-start text-gray-600 bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200'>

View File

@@ -37,7 +37,7 @@ export const MenuItemDrop = ({ link }) => {
{/* 子菜单 */}
{hasSubMenu && <ul className={`${show ? 'visible opacity-100 top-12 ' : 'invisible opacity-0 top-10 '} border-gray-100 bg-white dark:bg-black dark:border-gray-800 transition-all duration-300 z-20 absolute block drop-shadow-lg `}>
{link.subMenus.map(sLink => {
{link?.subMenus?.map(sLink => {
return <li key={sLink.id} className='not:last-child:border-b-0 border-b text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 dark:border-gray-800 py-3 pr-6 pl-2'>
<Link href={sLink.to}>
<span className='text-xs font-extralight'>{link?.icon && <i className={sLink?.icon} > &nbsp; </i>}{sLink.title}</span>

View File

@@ -62,7 +62,7 @@ export default function TopNavBar(props) {
{/* 桌面端顶部菜单 */}
<div className='hidden md:flex'>
{links && links.map(link => <MenuItemDrop key={link.id} link={link}/>)}
{links && links?.map(link => <MenuItemDrop key={link.id} link={link}/>)}
</div>
</div>
</div>