mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 15:10:29 +00:00
gitbook 改版
This commit is contained in:
@@ -25,7 +25,7 @@ export default function NavBar(props) {
|
||||
|
||||
const onKeyUp = e => {
|
||||
if (e.keyCode === 13) {
|
||||
const search = document.getElementById('simple-search').value
|
||||
const search = document.getElementById('simple-search').innerText
|
||||
if (search) {
|
||||
router.push({ pathname: '/search/' + search })
|
||||
}
|
||||
@@ -33,30 +33,29 @@ export default function NavBar(props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<nav className="w-full bg-white md:pt-0 relative z-20 shadow border-t border-gray-100 dark:border-hexo-black-gray dark:bg-black">
|
||||
<nav className='w-full bg-white md:pt-0 relative z-20 shadow border-t border-gray-100 dark:border-hexo-black-gray dark:bg-black'>
|
||||
<div
|
||||
id="nav-bar-inner"
|
||||
className="h-12 mx-auto max-w-9/10 justify-between items-center text-sm md:text-md md:justify-start"
|
||||
>
|
||||
id='nav-bar-inner'
|
||||
className='h-12 mx-auto max-w-9/10 justify-between items-center text-sm md:text-md md:justify-start'>
|
||||
{/* 左侧菜单 */}
|
||||
<div className="h-full w-full float-left text-center md:text-left flex flex-wrap items-stretch md:justify-start md:items-start space-x-4">
|
||||
<div className='h-full w-full float-left text-center md:text-left flex flex-wrap items-stretch md:justify-start md:items-start space-x-4'>
|
||||
{showSearchInput && (
|
||||
<input
|
||||
autoFocus
|
||||
id="simple-search"
|
||||
id='simple-search'
|
||||
onKeyUp={onKeyUp}
|
||||
className="float-left w-full outline-none h-full px-4"
|
||||
aria-label="Submit search"
|
||||
type="search"
|
||||
name="s"
|
||||
autoComplete="off"
|
||||
placeholder="Type then hit enter to search..."
|
||||
className='float-left w-full outline-none h-full px-4'
|
||||
aria-label='Submit search'
|
||||
type='search'
|
||||
name='s'
|
||||
autoComplete='off'
|
||||
placeholder='Type then hit enter to search...'
|
||||
/>
|
||||
)}
|
||||
{!showSearchInput && <MenuList {...props} />}
|
||||
</div>
|
||||
|
||||
<div className="absolute right-12 h-full text-center px-2 flex items-center text-blue-400 cursor-pointer">
|
||||
<div className='absolute right-12 h-full text-center px-2 flex items-center text-blue-400 cursor-pointer'>
|
||||
{/* <!-- extra links --> */}
|
||||
<i
|
||||
className={
|
||||
@@ -64,8 +63,7 @@ export default function NavBar(props) {
|
||||
? 'fa-regular fa-circle-xmark'
|
||||
: 'fa-solid fa-magnifying-glass' + ' align-middle'
|
||||
}
|
||||
onClick={toggleShowSearchInput}
|
||||
></i>
|
||||
onClick={toggleShowSearchInput}></i>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user