Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed:Search box doesn't render well in small views and dashboard responsiveness #85

Merged
merged 8 commits into from
Oct 18, 2024
8 changes: 4 additions & 4 deletions src/components/SearchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const SearchComponent: React.FC<SearchComponentProps> = ({
}
return data.snippets
},
{ enabled: Boolean(searchQuery) },
{ enabled: Boolean(searchQuery) }
)

const handleSearch = (e: React.FormEvent) => {
Expand Down Expand Up @@ -73,7 +73,7 @@ const SearchComponent: React.FC<SearchComponentProps> = ({
{showResults && searchResults && (
<div
ref={resultsRef}
className="absolute top-full left-0 right-0 mt-2 bg-white shadow-lg rounded-md z-10"
className="absolute top-full left-0 right-0 mt-2 bg-white shadow-lg rounded-md z-10 md:w-52"
>
{searchResults.length > 0 ? (
<ul className="divide-y divide-gray-200">
Expand All @@ -85,10 +85,10 @@ const SearchComponent: React.FC<SearchComponentProps> = ({
rel="noopener noreferrer"
className="block"
>
<div className="font-medium text-blue-600">
<div className="font-medium text-blue-600 break-words">
{snippet.name}
</div>
<div className="text-sm text-gray-500">
<div className="text-sm text-gray-500 break-words">
{snippet.description}
</div>
</a>
Expand Down