mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-20 07:26:46 +00:00
Merge branch 'main' of https://github.com/tangly1024/NotionNext into main
This commit is contained in:
@@ -113,7 +113,6 @@ export default function ArticleDetail ({ post, blockMap, recommendPosts, prev, n
|
||||
<section id='notion-article' className='px-1'>
|
||||
{blockMap && (
|
||||
<NotionRenderer
|
||||
className={`${BLOG.font}`}
|
||||
recordMap={blockMap}
|
||||
mapPageUrl={mapPageUrl}
|
||||
components={{
|
||||
|
||||
@@ -21,7 +21,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => {
|
||||
if (link.show) {
|
||||
const selected = (router.pathname === link.to) || (router.asPath === link.to)
|
||||
return <Link key={`${link.id}-${link.to}`} title={link.to} href={link.to} >
|
||||
<a className={'py-1 my-1 px-5 mx-2 duration-300 text-base hover:bg-gray-500 hover:text-white hover:shadow-lg cursor-pointer font-light flex flex-nowrap items-center ' +
|
||||
<a className={'py-1 my-1 px-5 mx-2 duration-300 text-base hover:bg-gray-700 hover:text-white hover:shadow-lg cursor-pointer font-light flex flex-nowrap items-center ' +
|
||||
(selected ? 'bg-gray-200 text-black' : ' ')} >
|
||||
<div className='my-auto justify-center flex '>
|
||||
<FontAwesomeIcon icon={link.icon} />
|
||||
|
||||
@@ -49,10 +49,10 @@ const PaginationNumber = ({ page, showNext, totalPage }) => {
|
||||
|
||||
function getPageElement (page, currentPage) {
|
||||
return <Link href={`/page/${page}`} key={page} passHref>
|
||||
<div className={(page + '' === currentPage ? 'font-bold bg-gray-500 dark:bg-gray-400 text-white ' : 'border-t-2 duration-500 border-white hover:border-gray-400 ') +
|
||||
<a className={(page + '' === currentPage + '' ? 'font-bold bg-gray-500 dark:bg-gray-400 text-white ' : 'border-t-2 duration-500 border-white hover:border-gray-400 ') +
|
||||
' border-white dark:border-gray-700 dark:hover:border-gray-400 cursor-pointer w-6 text-center font-light hover:font-bold'}>
|
||||
{page}
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
}
|
||||
function generatePages (page, currentPage, totalPage) {
|
||||
|
||||
@@ -18,7 +18,7 @@ const Tabs = ({ children }) => {
|
||||
})
|
||||
|
||||
if (count === 1) {
|
||||
return <section className='shadow'>
|
||||
return <section className='shadow hover:shadow-xl duration-200'>
|
||||
{children}
|
||||
</section>
|
||||
}
|
||||
|
||||
@@ -37,6 +37,18 @@ const ThirdPartyScript = () => {
|
||||
/>
|
||||
</>)}
|
||||
|
||||
{/* */}
|
||||
{BLOG.gitter && (<>
|
||||
<script async dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
((window.gitter = {}).chat = {}).options = {
|
||||
room: 'tangly1024/community'
|
||||
};
|
||||
`
|
||||
}}/>
|
||||
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
|
||||
</>)}
|
||||
|
||||
{/* 代码统计 */}
|
||||
{BLOG.isProd && (<>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback } from 'react'
|
||||
import React from 'react'
|
||||
import throttle from 'lodash.throttle'
|
||||
import { uuidToId } from 'notion-utils'
|
||||
import Progress from './Progress'
|
||||
@@ -12,8 +12,9 @@ import Progress from './Progress'
|
||||
*/
|
||||
const Toc = ({ toc, targetRef }) => {
|
||||
// 无目录就直接返回空
|
||||
if (!toc || toc.length < 1) return <></>
|
||||
|
||||
if (!toc || toc.length < 1) {
|
||||
return <></>
|
||||
}
|
||||
// 监听滚动事件
|
||||
React.useEffect(() => {
|
||||
window.addEventListener('scroll', actionSectionScrollSpy)
|
||||
@@ -26,7 +27,7 @@ const Toc = ({ toc, targetRef }) => {
|
||||
// 同步选中目录事件
|
||||
const [activeSection, setActiveSection] = React.useState(null)
|
||||
const throttleMs = 100
|
||||
const actionSectionScrollSpy = useCallback(throttle(() => {
|
||||
const actionSectionScrollSpy = React.useCallback(throttle(() => {
|
||||
const sections = document.getElementsByClassName('notion-h')
|
||||
let prevBBox = null
|
||||
let currentSectionId = activeSection
|
||||
|
||||
Reference in New Issue
Block a user