Skip to content

Commit b24befb

Browse files
committed
Magzine 微调导航栏
1 parent cfde73f commit b24befb

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

themes/magzine/components/Header.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ export default function Header(props) {
147147
{!showSearchInput && (
148148
<>
149149
{/* 左侧图标Logo */}
150-
<div className='flex gap-x-8 h-full'>
151-
<LogoBar {...props} />
150+
<div className='flex gap-x-2 lg:gap-x-4 h-full'>
151+
<LogoBar className={'text-sm md:text-md lg:text-lg'} />
152152
{/* 桌面端顶部菜单 */}
153-
<ul className='hidden md:flex items-center gap-x-4 py-1'>
153+
<ul className='hidden md:flex items-center gap-x-4 py-1 text-sm md:text-md'>
154154
{links &&
155155
links?.map((link, index) => (
156156
<MenuItemDrop key={index} link={link} />

themes/magzine/components/LogoBar.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { siteConfig } from '@/lib/config'
22
import Link from 'next/link'
33

4-
export default function LogoBar(props) {
4+
export default function LogoBar({ className }) {
55
return (
6-
<div id='top-wrapper' className='w-full flex items-center '>
6+
<div
7+
id='top-wrapper'
8+
className={`w-full flex items-center ${className || ''}`}>
79
<Link
810
href='/'
9-
className='logo flex text-md font-semibold md:text-xl hover:bg-black hover:text-white p-2 rounded-xl duration-200 dark:text-gray-200'>
11+
className='logo flex font-semibold hover:bg-black hover:text-white p-2 rounded-xl duration-200 dark:text-gray-200'>
1012
{/* <LazyImage
1113
src={siteInfo?.icon}
1214
width={24}

themes/magzine/components/MenuItemDrop.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ export const MenuItemDrop = ({ link }) => {
2222
{hasSubMenu && (
2323
<div
2424
className={
25-
'px-2 h-full whitespace-nowrap duration-300 text-md justify-between dark:text-gray-300 cursor-pointer flex flex-nowrap items-center ' +
25+
'px-2 h-full whitespace-nowrap duration-300 justify-between dark:text-gray-300 cursor-pointer flex flex-nowrap items-center ' +
2626
(selected
2727
? 'bg-gray-600 text-white hover:text-white'
2828
: 'hover:text-gray-600')
2929
}>
30-
<div className='items-center flex gap-x-1'>
31-
{link?.icon && <i className={link?.icon} />} {link?.name}
30+
<div className='items-center flex'>
31+
{link?.icon && <i className={`${link?.icon} pr-2`} />} {link?.name}
3232
<i
3333
className={`px-1 fas fa-chevron-down duration-500 transition-all ${show ? ' rotate-180' : ''}`}></i>
3434
</div>
@@ -52,15 +52,15 @@ export const MenuItemDrop = ({ link }) => {
5252
{/* 子菜单 */}
5353
{hasSubMenu && (
5454
<ul
55-
className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} absolute border bg-white dark:bg-black dark:border-gray-800 transition-all duration-150 z-20 block rounded-lg drop-shadow-lg p-4 `}>
55+
className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} p-1 absolute border bg-white dark:bg-black dark:border-gray-800 transition-all duration-150 z-20 block rounded-lg drop-shadow-lg`}>
5656
{link?.subMenus?.map(sLink => {
5757
return (
5858
<li
5959
key={sLink.id}
60-
className='dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 dark:border-gray-800 py-3 pr-6 pl-3'>
60+
className='py-3 pr-6 hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-gray-200 tracking-widest transition-color duration-200 dark:border-gray-800 '>
6161
<Link href={sLink.href} target={link?.target}>
62-
<span className='text-sm'>
63-
{link?.icon && <i className={sLink?.icon}> &nbsp; </i>}
62+
<span className='text-sm ml-2'>
63+
{link?.icon && <i className={`${sLink?.icon} pr-2`}> </i>}
6464
{sLink.title}
6565
</span>
6666
</Link>

0 commit comments

Comments
 (0)