Skip to content

Commit 6f03028

Browse files
authored
Merge pull request tangly1024#2404 from tangly1024/release/4.5.1
matery 主题已知样式bug修复,导航栏透明色优化
2 parents c294689 + 48462a4 commit 6f03028

File tree

2 files changed

+37
-39
lines changed

2 files changed

+37
-39
lines changed

themes/matery/components/Header.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { siteConfig } from '@/lib/config'
33
import { useGlobal } from '@/lib/global'
44
import throttle from 'lodash.throttle'
55
import Link from 'next/link'
6+
import { useRouter } from 'next/router'
67
import { useCallback, useEffect, useRef, useState } from 'react'
78
import CONFIG from '../config'
89
import CategoryGroup from './CategoryGroup'
@@ -28,6 +29,7 @@ const Header = props => {
2829
const throttleMs = 200
2930
const showSearchButton = siteConfig('MATERY_MENU_SEARCH', false, CONFIG)
3031

32+
const router = useRouter()
3133
const scrollTrigger = useCallback(
3234
throttle(() => {
3335
requestAnimationFrame(() => {
@@ -85,7 +87,7 @@ const Header = props => {
8587
return () => {
8688
window.removeEventListener('scroll', scrollTrigger)
8789
}
88-
}, [])
90+
}, [router])
8991

9092
const [isOpen, changeShow] = useState(false)
9193

themes/matery/index.js

+34-38
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const LayoutArchive = props => {
201201
const { archivePosts } = props
202202
return (
203203
<>
204-
<Card className='w-full -mt-32'>
204+
<Card className='w-full mt-8'>
205205
<div className='mb-10 pb-20 bg-white md:p-12 p-3 min-h-full dark:bg-hexo-black-gray'>
206206
{Object.keys(archivePosts).map(archiveTitle => (
207207
<BlogPostArchive
@@ -355,27 +355,25 @@ const LayoutCategoryIndex = props => {
355355
const { categoryOptions } = props
356356

357357
return (
358-
<>
359-
<div id='inner-wrapper' className='w-full'>
360-
<div className='drop-shadow-xl -mt-32 rounded-md mx-3 px-5 lg:border lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black dark:text-gray-300'>
361-
<div className='flex justify-center flex-wrap'>
362-
{categoryOptions?.map(e => {
363-
return (
364-
<Link
365-
key={e.name}
366-
href={`/category/${e.name}`}
367-
passHref
368-
legacyBehavior>
369-
<div className='duration-300 text-md whitespace-nowrap dark:hover:text-white px-5 cursor-pointer py-2 hover:text-indigo-400'>
370-
<i className={'mr-4 fas fa-folder'} /> {e.name}({e.count})
371-
</div>
372-
</Link>
373-
)
374-
})}
375-
</div>
358+
<div id='inner-wrapper' className='w-full'>
359+
<div className='drop-shadow-xl mt-8 rounded-md mx-3 px-5 lg:border lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black dark:text-gray-300'>
360+
<div className='flex justify-center flex-wrap'>
361+
{categoryOptions?.map(e => {
362+
return (
363+
<Link
364+
key={e.name}
365+
href={`/category/${e.name}`}
366+
passHref
367+
legacyBehavior>
368+
<div className='duration-300 text-md whitespace-nowrap dark:hover:text-white px-5 cursor-pointer py-2 hover:text-indigo-400'>
369+
<i className={'mr-4 fas fa-folder'} /> {e.name}({e.count})
370+
</div>
371+
</Link>
372+
)
373+
})}
376374
</div>
377375
</div>
378-
</>
376+
</div>
379377
)
380378
}
381379

@@ -388,27 +386,25 @@ const LayoutTagIndex = props => {
388386
const { tagOptions } = props
389387
const { locale } = useGlobal()
390388
return (
391-
<>
392-
<div id='inner-wrapper' className='w-full drop-shadow-xl'>
393-
<div className='-mt-32 rounded-md mx-3 px-5 lg:border lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black'>
394-
<div className='dark:text-gray-200 py-5 text-center text-2xl'>
395-
<i className='fas fa-tags' /> {locale.COMMON.TAGS}
396-
</div>
389+
<div id='inner-wrapper' className='w-full drop-shadow-xl'>
390+
<div className='mt-8 rounded-md mx-3 px-5 lg:border lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black'>
391+
<div className='dark:text-gray-200 py-5 text-center text-2xl'>
392+
<i className='fas fa-tags' /> {locale.COMMON.TAGS}
393+
</div>
397394

398-
<div
399-
id='tags-list'
400-
className='duration-200 flex flex-wrap justify-center pb-12'>
401-
{tagOptions.map(tag => {
402-
return (
403-
<div key={tag.name} className='p-2'>
404-
<TagItemMiddle key={tag.name} tag={tag} />
405-
</div>
406-
)
407-
})}
408-
</div>
395+
<div
396+
id='tags-list'
397+
className='duration-200 flex flex-wrap justify-center pb-12'>
398+
{tagOptions.map(tag => {
399+
return (
400+
<div key={tag.name} className='p-2'>
401+
<TagItemMiddle key={tag.name} tag={tag} />
402+
</div>
403+
)
404+
})}
409405
</div>
410406
</div>
411-
</>
407+
</div>
412408
)
413409
}
414410

0 commit comments

Comments
 (0)