Skip to content

Commit

Permalink
removed scroll viewport and changes in table-header
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan Singh <114330931+aryanas159@users.noreply.github.com>
  • Loading branch information
aryanas159 committed Jul 18, 2023
1 parent 17b2a4f commit 7170cf0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
26 changes: 12 additions & 14 deletions components/atoms/Search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { GrClose } from "react-icons/gr";
import { FaSearch } from "react-icons/fa";
import { Spinner } from "../SpinLoader/spin-loader";
import { ScrollArea, ScrollViewport } from "../ScrollArea/scroll-area";
import { ScrollArea } from "../ScrollArea/scroll-area";

interface SearchProps {
name: string;
Expand Down Expand Up @@ -87,19 +87,17 @@ const Search = ({
/>
{suggestions && suggestions.length > 0 && showSuggestions && (
<div className="absolute left-0 z-10 w-full pb-1 space-y-1 bg-white border rounded-lg cursor-pointer shadow-input border-light-slate-6 top-full">
<ScrollArea type="auto">
<ScrollViewport className="max-h-60 w-full">
{suggestions.map((suggestion, index) => (
<div
className="px-4 py-2 overflow-hidden break-all text-light-slate-9 hover:bg-light-slate-2"
style={suggestionsStyle}
key={index}
onClick={() => handleOnSelect(suggestion)}
>
<span className="pl-5 text-sm ">{suggestion}</span>
</div>
))}
</ScrollViewport>
<ScrollArea type="auto" className="h-60">
{suggestions.map((suggestion, index) => (
<div
className="px-4 py-2 overflow-hidden break-all text-light-slate-9 hover:bg-light-slate-2"
style={suggestionsStyle}
key={index}
onClick={() => handleOnSelect(suggestion)}
>
<span className="pl-5 text-sm ">{suggestion}</span>
</div>
))}
</ScrollArea>
</div>
)}
Expand Down
1 change: 0 additions & 1 deletion components/molecules/TableHeader/table-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const TableHeader = ({
if (req.ok) {
const res = await req.json();
const suggestions = res.items.map((item: any) => item.full_name);
if (suggestions.length > 5) suggestions.length = 5;
setSuggestions(suggestions);
}
}, 250);
Expand Down

0 comments on commit 7170cf0

Please sign in to comment.