Skip to content

Commit

Permalink
Fix ellipsis for request (history)
Browse files Browse the repository at this point in the history
  • Loading branch information
flenter committed Dec 3, 2024
1 parent d89b9a4 commit 69c3954
Showing 1 changed file with 35 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,36 +135,39 @@ export function RequestsPanel() {
);

return (
<div className={cn("h-full", "flex", "flex-col")}>
<div>
<div className="flex items-center space-x-2 pb-3">
<Search
ref={searchRef}
value={filterValue}
onChange={setFilterValue}
onFocus={() => {
setSelectedItemId(null);
}}
placeholder="requests"
onItemSelect={() => {}}
itemCount={filteredItems.length}
/>
</div>
<div className={cn("h-full flex flex-col min-w-0")}>
<div className="flex items-center space-x-2 pb-3">
<Search
ref={searchRef}
value={filterValue}
onChange={setFilterValue}
onFocus={() => {
setSelectedItemId(null);
}}
placeholder="requests"
onItemSelect={() => {}}
itemCount={filteredItems.length}
/>
</div>
<div className="overflow-y-auto h-full relative">
{filteredItems.length === 0 && <EmptyState />}
{filteredItems.map((item) => (
<NavItem
key={getId(item)}
item={item}
isSelected={getId(item) === selectedItemId}
searchParams={searchParams}
to={{
pathname: `/request/${getId(item)}`,
search: searchParams.toString(),
}}
/>
))}
<div className="overflow-y-auto overflow-x-hidden h-full relative flex flex-col justify-start">
{filteredItems.length === 0 ? (
<EmptyState />
) : (
<>
{filteredItems.map((item) => (
<NavItem
key={getId(item)}
item={item}
isSelected={getId(item) === selectedItemId}
searchParams={searchParams}
to={{
pathname: `/request/${getId(item)}`,
search: searchParams.toString(),
}}
/>
))}
</>
)}
</div>
</div>
);
Expand Down Expand Up @@ -243,6 +246,8 @@ const NavItem = memo(({ to, item, isSelected }: NavItemProps) => {
to={to}
className={cn(
"grid grid-cols-[38px_38px_1fr] gap-2 hover:bg-muted px-2 py-1 rounded cursor-pointer items-center",
"w-full",
"h-fit min-w-0",
"focus:outline-none",
{
"bg-muted": id === getId(item),
Expand All @@ -267,9 +272,7 @@ const NavItem = memo(({ to, item, isSelected }: NavItemProps) => {
<div>
<MethodCell item={item} />
</div>
<div>
<PathCell item={item} />
</div>
<PathCell item={item} />
</Link>
);
});
Expand Down

0 comments on commit 69c3954

Please sign in to comment.