Merge pull request #558 from tangly1024/develop

微调修复
This commit is contained in:
tangly1024
2022-12-08 16:39:59 +08:00
committed by GitHub
5 changed files with 18 additions and 8 deletions

View File

@@ -23,8 +23,8 @@ const PrismMac = () => {
const observer = new MutationObserver(mutationsList => {
for (const m of mutationsList) {
if (m.target.nodeName === 'DETAILS') {
const preCode = m.target.querySelector('pre.notion-code')
if (preCode) {
const preCodes = m.target.querySelectorAll('pre.notion-code')
for (const preCode of preCodes) {
Prism.plugins.lineNumbers.resize(preCode)
}
}

View File

@@ -62,8 +62,10 @@ const WalineComponent = (props) => {
}
return () => {
waline.destroy()
waline = null
if (waline) {
waline.destroy()
waline = null
}
router.events.off('routeChangeComplete', updateWaline)
}
}, [])

View File

@@ -1978,4 +1978,10 @@ pre[class*='language-'] {
.notion-asset-wrapper-pdf>div{
width:unset!important
}
/* pdf预览适配页面 */
.react-pdf__Page__canvas,.react-pdf__Page__textContent{
width: 100% !important;
height: auto !important;
}

View File

@@ -69,6 +69,7 @@ const LayoutBase = (props) => {
<div className='h-0.5 w-full bg-gray-700 dark:bg-gray-600 hidden lg:block'/>
<main id='wrapper' className='flex justify-center flex-1 pb-12'>
{/* 左侧栏样式 */}
<SideAreaLeft slot={leftAreaSlot} targetRef={targetRef} {...props}/>
<section id='container-inner' className={`${CONFIG_NEXT.NAV_TYPE !== 'normal' ? 'mt-40' : ''} lg:max-w-3xl xl:max-w-4xl flex-grow md:mt-0 min-h-screen w-full`} ref={targetRef}>
{onLoading ? <LoadingCover/> : <> {children}</> }

View File

@@ -10,22 +10,23 @@ const MenuButtonGroup = (props) => {
const router = useRouter()
const archiveSlot = <div className='bg-gray-300 dark:bg-gray-500 rounded-md text-gray-50 px-1 text-xs'>{postCount}</div>
let links = [
const defaultLinks = [
{ icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true },
{ icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NEXT.MENU_CATEGORY },
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NEXT.MENU_TAG },
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_NEXT.MENU_ARCHIVE },
{ icon: 'fas fa-user', name: locale.NAV.ABOUT, to: '/about', show: CONFIG_NEXT.MENU_ABOUT }
]
let links = [].concat(defaultLinks)
if (customNav) {
links = links.concat(customNav)
links = defaultLinks.concat(customNav)
}
return <nav id='nav' className='leading-8 text-gray-500 dark:text-gray-400 font-sans'>
{links.map(link => {
if (link && link.show) {
const selected = (router.pathname === link.to) || (router.asPath === link.to)
return <Link key={`${link.to}`} title={link.to} href={link.to} >
return <Link key={link.to} title={link.to} href={link.to} >
<a target={link.to.indexOf('http') === 0 ? '_blank' : '_self'} className={'py-1.5 px-5 duration-300 text-base justify-between 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 items-center justify-center flex '>
@@ -36,7 +37,7 @@ const MenuButtonGroup = (props) => {
</a>
</Link>
} else {
return null
return <></>
}
})}
</nav>