fix: double scroll bar when searching (#5623)

* fix: double scroll bar when searching

* fix: use cn instead

---------

Co-authored-by: TuDHM <tudhm@ghn.vn>
Co-authored-by: Arik Chakma <arikchangma@gmail.com>
pull/5651/head
Dương Hồ Minh Tú 7 months ago committed by GitHub
parent d7978d39c9
commit 33c8528c1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      src/components/CommandMenu/CommandMenu.tsx

@ -17,6 +17,7 @@ import { ClipboardIcon } from '../ReactIcons/ClipboardIcon.tsx';
import { GuideIcon } from '../ReactIcons/GuideIcon.tsx'; import { GuideIcon } from '../ReactIcons/GuideIcon.tsx';
import { HomeIcon } from '../ReactIcons/HomeIcon.tsx'; import { HomeIcon } from '../ReactIcons/HomeIcon.tsx';
import { VideoIcon } from '../ReactIcons/VideoIcon.tsx'; import { VideoIcon } from '../ReactIcons/VideoIcon.tsx';
import { cn } from '../../lib/classname.ts';
export type PageType = { export type PageType = {
id: string; id: string;
@ -190,7 +191,7 @@ export function CommandMenu() {
return ( return (
<div className="fixed left-0 right-0 top-0 z-50 flex h-full justify-center overflow-y-auto overflow-x-hidden bg-black/50"> <div className="fixed left-0 right-0 top-0 z-50 flex h-full justify-center overflow-y-auto overflow-x-hidden bg-black/50">
<div className="relative top-0 h-full w-full max-w-lg p-2 sm:top-20 md:h-auto"> <div className="relative top-0 h-full w-full max-w-lg p-2 sm:mt-20 md:h-auto">
<div className="relative rounded-lg bg-white shadow" ref={modalRef}> <div className="relative rounded-lg bg-white shadow" ref={modalRef}>
<input <input
ref={inputRef} ref={inputRef}
@ -245,9 +246,10 @@ export function CommandMenu() {
<div className="border-b border-gray-100"></div> <div className="border-b border-gray-100"></div>
)} )}
<a <a
className={`flex w-full items-center rounded p-2 text-sm ${ className={cn(
counter === activeCounter ? 'bg-gray-100' : '' 'flex w-full items-center rounded p-2 text-sm',
}`} counter === activeCounter ? 'bg-gray-100' : '',
)}
onMouseOver={() => setActiveCounter(counter)} onMouseOver={() => setActiveCounter(counter)}
href={page.url} href={page.url}
> >

Loading…
Cancel
Save