mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 15:10:06 +00:00
announcement
This commit is contained in:
21
themes/next/components/Announcement.js
Normal file
21
themes/next/components/Announcement.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import dynamic from 'next/dynamic'
|
||||
|
||||
const NotionPage = dynamic(() => import('@/components/NotionPage'))
|
||||
|
||||
const Announcement = ({ post, className }) => {
|
||||
if (!post) {
|
||||
return <></>
|
||||
}
|
||||
return <>
|
||||
<div className="text-sm pb-1 px-2 flex flex-nowrap justify-between">
|
||||
<div className="font-light text-gray-600 dark:text-gray-200">
|
||||
<i className="mr-2 fas fa-bullhorn" />
|
||||
公告
|
||||
</div>
|
||||
</div>
|
||||
{post && (<div id="announcement-content">
|
||||
<NotionPage post={post} className='text-center ' />
|
||||
</div>)}
|
||||
</>
|
||||
}
|
||||
export default Announcement
|
||||
@@ -116,7 +116,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export default BlogPostCard
|
||||
|
||||
@@ -48,8 +48,8 @@ const LatestPostsGroup = ({ latestPosts }) => {
|
||||
</div>
|
||||
|
||||
</Link>)
|
||||
);
|
||||
)
|
||||
})}
|
||||
</>;
|
||||
</>
|
||||
}
|
||||
export default LatestPostsGroup
|
||||
|
||||
@@ -41,7 +41,9 @@ const SideAreaLeft = props => {
|
||||
{CONFIG_NEXT.MENU_SEARCH && <div className='px-2 pt-2 font-sans'>
|
||||
<SearchInput {...props} />
|
||||
</div>}
|
||||
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
<div className='sticky top-4 hidden lg:block'>
|
||||
|
||||
@@ -8,6 +8,7 @@ import CONFIG_NEXT from '../config_next'
|
||||
import { useRouter } from 'next/router'
|
||||
import BLOG from '@/blog.config'
|
||||
import dynamic from 'next/dynamic'
|
||||
import Announcement from './Announcement'
|
||||
const NextRecentComments = dynamic(() => import('./NextRecentComments'))
|
||||
|
||||
/**
|
||||
@@ -21,82 +22,88 @@ const NextRecentComments = dynamic(() => import('./NextRecentComments'))
|
||||
* @constructor
|
||||
*/
|
||||
const SideAreaRight = (props) => {
|
||||
const { tags, currentTag, slot, categories, currentCategory } = props
|
||||
const { tags, currentTag, slot, categories, currentCategory, notice } = props
|
||||
const { locale } = useGlobal()
|
||||
const router = useRouter()
|
||||
return (<aside id='right' className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'mr-4' : 'ml-4') + ' hidden 2xl:block flex-col w-60 relative z-10'}>
|
||||
return (<aside id='right' className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'mr-4' : 'ml-4') + ' space-y-4 hidden 2xl:block flex-col w-60 relative z-10'}>
|
||||
|
||||
{CONFIG_NEXT.RIGHT_AD && <Card className='mb-2'>
|
||||
{/* 展示广告 */}
|
||||
<ins
|
||||
className='adsbygoogle'
|
||||
style={{ display: 'block' }}
|
||||
data-adtest='on'
|
||||
data-ad-client='ca-pub-2708419466378217'
|
||||
data-ad-slot='8807314373'
|
||||
data-ad-format='auto'
|
||||
data-full-width-responsive='true'
|
||||
/>
|
||||
{/* 展示广告 */}
|
||||
<ins
|
||||
className='adsbygoogle'
|
||||
style={{ display: 'block' }}
|
||||
data-adtest='on'
|
||||
data-ad-client='ca-pub-2708419466378217'
|
||||
data-ad-slot='8807314373'
|
||||
data-ad-format='auto'
|
||||
data-full-width-responsive='true'
|
||||
/>
|
||||
</Card>}
|
||||
|
||||
<div className="sticky top-4">
|
||||
{slot}
|
||||
<div className="sticky top-0 space-y-4">
|
||||
<div>
|
||||
{notice && <Card>
|
||||
<Announcement post={notice} />
|
||||
</Card>}
|
||||
</div>
|
||||
|
||||
{/* 分类 */}
|
||||
{CONFIG_NEXT.RIGHT_CATEGORY_LIST && router.asPath !== '/category' && categories && (
|
||||
<Card>
|
||||
<div className='text-sm px-2 flex flex-nowrap justify-between font-light'>
|
||||
<div className='pb-2 text-gray-600 dark:text-gray-300'><i className='mr-2 fas fa-th-list' />{locale.COMMON.CATEGORY}</div>
|
||||
<Link
|
||||
href={'/category'}
|
||||
passHref
|
||||
className='text-gray-400 hover:text-black dark:text-gray-400 dark:hover:text-white hover:underline cursor-pointer'>
|
||||
{slot}
|
||||
|
||||
{locale.COMMON.MORE} <i className='fas fa-angle-right' />
|
||||
{/* 分类 */}
|
||||
{CONFIG_NEXT.RIGHT_CATEGORY_LIST && router.asPath !== '/category' && categories && (
|
||||
<Card>
|
||||
<div className='text-sm px-2 flex flex-nowrap justify-between font-light'>
|
||||
<div className='pb-2 text-gray-600 dark:text-gray-300'><i className='mr-2 fas fa-th-list' />{locale.COMMON.CATEGORY}</div>
|
||||
<Link
|
||||
href={'/category'}
|
||||
passHref
|
||||
className='text-gray-400 hover:text-black dark:text-gray-400 dark:hover:text-white hover:underline cursor-pointer'>
|
||||
|
||||
</Link>
|
||||
</div>
|
||||
<CategoryGroup currentCategory={currentCategory} categories={categories} />
|
||||
</Card>
|
||||
)}
|
||||
{locale.COMMON.MORE} <i className='fas fa-angle-right' />
|
||||
|
||||
{CONFIG_NEXT.RIGHT_TAG_LIST && router.asPath !== '/tag' && tags && (
|
||||
<Card>
|
||||
<div className="text-sm pb-1 px-2 flex flex-nowrap justify-between font-light dark:text-gray-200">
|
||||
<div className="text-gray-600 dark:text-gray-200">
|
||||
<i className="mr-2 fas fa-tag" />
|
||||
{locale.COMMON.TAGS}
|
||||
</Link>
|
||||
</div>
|
||||
<CategoryGroup currentCategory={currentCategory} categories={categories} />
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{CONFIG_NEXT.RIGHT_TAG_LIST && router.asPath !== '/tag' && tags && (
|
||||
<Card>
|
||||
<div className="text-sm pb-1 px-2 flex flex-nowrap justify-between font-light dark:text-gray-200">
|
||||
<div className="text-gray-600 dark:text-gray-200">
|
||||
<i className="mr-2 fas fa-tag" />
|
||||
{locale.COMMON.TAGS}
|
||||
</div>
|
||||
<Link
|
||||
href={'/tag'}
|
||||
passHref
|
||||
className="text-gray-400 hover:text-black dark:hover:text-white hover:underline cursor-pointer">
|
||||
|
||||
{locale.COMMON.MORE}{' '}
|
||||
<i className='fas fa-angle-double-right' />
|
||||
|
||||
</Link>
|
||||
</div>
|
||||
<div className="px-2 pt-2">
|
||||
<TagGroups tags={tags} currentTag={currentTag} />
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{BLOG.COMMENT_WALINE_SERVER_URL && BLOG.COMMENT_WALINE_RECENT && <Card>
|
||||
<div className="text-sm pb-1 px-2 flex flex-nowrap justify-between font-light dark:text-gray-200">
|
||||
<div className="text-gray-600 dark:text-gray-200">
|
||||
<i className="mr-2 fas fa-tag" />
|
||||
{locale.COMMON.RECENT_COMMENTS}
|
||||
</div>
|
||||
</div>
|
||||
<Link
|
||||
href={'/tag'}
|
||||
passHref
|
||||
className="text-gray-400 hover:text-black dark:hover:text-white hover:underline cursor-pointer">
|
||||
|
||||
{locale.COMMON.MORE}{' '}
|
||||
<i className='fas fa-angle-double-right' />
|
||||
|
||||
</Link>
|
||||
</div>
|
||||
<div className="px-2 pt-2">
|
||||
<TagGroups tags={tags} currentTag={currentTag} />
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{BLOG.COMMENT_WALINE_SERVER_URL && BLOG.COMMENT_WALINE_RECENT && <Card>
|
||||
<div className="text-sm pb-1 px-2 flex flex-nowrap justify-between font-light dark:text-gray-200">
|
||||
<div className="text-gray-600 dark:text-gray-200">
|
||||
<i className="mr-2 fas fa-tag" />
|
||||
{locale.COMMON.RECENT_COMMENTS}
|
||||
<div className="px-2 pt-2">
|
||||
<NextRecentComments />
|
||||
</div>
|
||||
</div>
|
||||
<div className="px-2 pt-2">
|
||||
<NextRecentComments/>
|
||||
</div>
|
||||
</Card>}
|
||||
</Card>}
|
||||
|
||||
</div>
|
||||
</aside>
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
export default SideAreaRight
|
||||
|
||||
Reference in New Issue
Block a user