Skip to content

Commit

Permalink
Merge pull request #408 from tylerslaton/fix-dark-icons
Browse files Browse the repository at this point in the history
fix: do not invert tool icons from /admin/assets
  • Loading branch information
tylerslaton authored Nov 1, 2024
2 parents caa2d5d + c297afe commit d20e326
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ui/admin/app/components/agent/ToolEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import useSWR from "swr";

import { ToolReferenceService } from "~/lib/service/api/toolreferenceService";

import { ToolIcon } from "../tools/ToolIcon";
import { LoadingSpinner } from "../ui/LoadingSpinner";
import { Button } from "../ui/button";
import { ToolIcon } from "~/components/tools/ToolIcon";
import { LoadingSpinner } from "~/components/ui/LoadingSpinner";
import { Button } from "~/components/ui/button";

export function ToolEntry({
tool,
Expand Down
5 changes: 4 additions & 1 deletion ui/admin/app/components/tools/ToolIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function ToolIcon(props: ToolIconProps) {
<img
alt={name}
src={icon}
className={cn("w-6 h-6 dark:invert", className)}
className={cn("w-6 h-6", className, {
// icons served from /admin/assets are colored, so we should not invert them.
"dark:invert": !icon.startsWith("/admin/assets"),
})}
/>
) : (
<WrenchIcon className={cn("w-4 h-4 mr-2", className)} />
Expand Down
2 changes: 1 addition & 1 deletion ui/admin/app/components/tools/toolGrid/CategoryHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function CategoryHeader({
}: CategoryHeaderProps) {
return (
<div className="flex items-center space-x-4">
<div className="w-10 h-10 flex items-center justify-center bg-muted rounded-full mb-2 border">
<div className="w-10 h-10 flex items-center justify-center rounded-full mb-2 border">
{tools[0]?.metadata?.icon ? (
<ToolIcon
className="w-6 h-6"
Expand Down
3 changes: 1 addition & 2 deletions ui/admin/app/components/tools/toolGrid/ToolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
TypographySmall,
} from "~/components/Typography";
import { ConfirmationDialog } from "~/components/composed/ConfirmationDialog";
import { ToolIcon } from "~/components/tools/ToolIcon";
import { Badge } from "~/components/ui/badge";
import { Button } from "~/components/ui/button";
import {
Expand All @@ -25,8 +26,6 @@ import {
TooltipTrigger,
} from "~/components/ui/tooltip";

import { ToolIcon } from "../ToolIcon";

interface ToolCardProps {
tool: ToolReference;
onDelete: (id: string) => void;
Expand Down

0 comments on commit d20e326

Please sign in to comment.