theme 优化

This commit is contained in:
tangly1024.com
2024-01-30 18:05:37 +08:00
parent 51d3cdc9fc
commit b5bfdcba4b
16 changed files with 180 additions and 205 deletions

View File

@@ -50,9 +50,9 @@ export const MenuItem = ({ link }) => {
{
link?.subMenus?.map((sLink, index) => (
<div key={index} className='nav-submenu'>
<a href={sLink?.to}>
<Link href={sLink?.to}>
<span className='dark:text-neutral-400 text-gray-500 hover:text-black dark:hover:text-white text-xs font-bold'><i className={`text-xs mr-1 ${sLink?.icon ? sLink?.icon : 'fas fa-hashtag'}`} />{sLink.title}</span>
</a>
</Link>
</div>
))
}

View File

@@ -172,10 +172,10 @@ const LayoutPostListIndex = props => {
// const { customMenu, children, post, allNavPages, categoryOptions, slotLeft, slotRight, slotTop, meta } = props
// const [filteredNavPages, setFilteredNavPages] = useState(allNavPages)
return (
<div {...props} >
<>
<Announcement {...props} />
<BlogPostListAll { ...props } />
</div>
</>
)
}
@@ -189,7 +189,7 @@ const LayoutPostList = props => {
// 顶部如果是按照分类或标签查看文章列表,列表顶部嵌入一个横幅
// 如果是搜索,则列表顶部嵌入 搜索框
return (
<div {...props} >
<>
<div className='w-full max-w-7xl mx-auto justify-center mt-8'>
<div id='posts-wrapper' class='card-list grid gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5'>
{posts?.map(post => (
@@ -197,7 +197,7 @@ const LayoutPostList = props => {
))}
</div>
</div>
</div>
</>
)
}
@@ -210,7 +210,7 @@ const LayoutSlug = (props) => {
const { post, lock, validPassword } = props
return (
<div {...props} >
<>
{/* 文章锁 */}
{lock && <ArticleLock validPassword={validPassword} />}
@@ -244,7 +244,7 @@ const LayoutSlug = (props) => {
<TocDrawer {...props} />
</div>}
</div>
</>
)
}
@@ -255,7 +255,7 @@ const LayoutSlug = (props) => {
* @returns
*/
const LayoutSearch = (props) => {
return <div {...props}></div>
return <></>
}
/**
@@ -267,20 +267,20 @@ const LayoutSearch = (props) => {
const LayoutArchive = (props) => {
const { archivePosts } = props
return <div {...props}>
return <>
<div className="mb-10 pb-20 md:py-12 py-3 min-h-full">
{Object.keys(archivePosts)?.map(archiveTitle => <BlogArchiveItem key={archiveTitle} archiveTitle={archiveTitle} archivePosts={archivePosts} />)}
</div>
</div>
</>
}
/**
* 404
*/
const Layout404 = props => {
return <div {...props}>
return <>
<div className='w-full h-96 py-80 flex justify-center items-center'>404 Not found.</div>
</div>
</>
}
/**
@@ -289,7 +289,7 @@ const Layout404 = props => {
const LayoutCategoryIndex = (props) => {
const { categoryOptions } = props
const { locale } = useGlobal()
return <div {...props}>
return <>
<div className='bg-white dark:bg-gray-700 py-10'>
<div className='dark:text-gray-200 mb-5'>
<i className='mr-4 fas fa-th' />{locale.COMMON.CATEGORY}:
@@ -311,7 +311,7 @@ const LayoutCategoryIndex = (props) => {
})}
</div>
</div>
</div>
</>
}
/**
@@ -321,7 +321,7 @@ const LayoutTagIndex = (props) => {
const { tagOptions } = props
const { locale } = useGlobal()
return <div {...props}>
return <>
<div className="bg-white dark:bg-gray-700 py-10">
<div className="dark:text-gray-200 mb-5">
<i className="mr-4 fas fa-tag" />
@@ -337,7 +337,7 @@ const LayoutTagIndex = (props) => {
})}
</div>
</div>
</div>
</>
}
export {