mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 15:10:11 +00:00
movie 404
This commit is contained in:
@@ -9,7 +9,7 @@ import { MenuList } from './MenuList'
|
||||
* @param {*} props
|
||||
* @returns
|
||||
*/
|
||||
export default function NavBar (props) {
|
||||
export default function NavBar(props) {
|
||||
const [showSearchInput, changeShowSearchInput] = useState(false)
|
||||
const router = useRouter()
|
||||
const { searchModal } = useSimpleGlobal()
|
||||
@@ -23,7 +23,7 @@ export default function NavBar (props) {
|
||||
}
|
||||
}
|
||||
|
||||
const onKeyUp = (e) => {
|
||||
const onKeyUp = e => {
|
||||
if (e.keyCode === 13) {
|
||||
const search = document.getElementById('theme-simple-search').value
|
||||
if (search) {
|
||||
@@ -33,19 +33,41 @@ 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">
|
||||
<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">
|
||||
{/* 左侧菜单 */}
|
||||
<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="theme-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..." />}
|
||||
{!showSearchInput && (<MenuList {...props}/>)}
|
||||
</div>
|
||||
<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"
|
||||
>
|
||||
{/* 左侧菜单 */}
|
||||
<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="theme-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..."
|
||||
/>
|
||||
)}
|
||||
{!showSearchInput && <MenuList {...props} />}
|
||||
</div>
|
||||
|
||||
<div className="absolute right-12 h-full text-center px-2 flex items-center text-blue-400 cursor-pointer">
|
||||
{/* <!-- extra links --> */}
|
||||
<i className={showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass' + ' align-middle'} onClick={toggleShowSearchInput}></i>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div className="absolute right-12 h-full text-center px-2 flex items-center text-blue-400 cursor-pointer">
|
||||
{/* <!-- extra links --> */}
|
||||
<i
|
||||
className={
|
||||
showSearchInput
|
||||
? 'fa-regular fa-circle-xmark'
|
||||
: 'fa-solid fa-magnifying-glass' + ' align-middle'
|
||||
}
|
||||
onClick={toggleShowSearchInput}
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user