From a5d0ca6e1c0bc773b7fc00cf5a4618dfb2035921 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Mon, 28 Oct 2024 01:19:37 -0700 Subject: [PATCH] Use selected agent color to theme the chat input area on home page --- src/interface/web/app/common/colorUtils.ts | 7 +++ .../chatInputArea/chatInputArea.tsx | 12 ++++- src/interface/web/app/page.tsx | 2 + src/interface/web/tailwind.config.ts | 50 +++++++++++-------- 4 files changed, 48 insertions(+), 23 deletions(-) diff --git a/src/interface/web/app/common/colorUtils.ts b/src/interface/web/app/common/colorUtils.ts index c534097f..6cd57a64 100644 --- a/src/interface/web/app/common/colorUtils.ts +++ b/src/interface/web/app/common/colorUtils.ts @@ -42,6 +42,13 @@ export function converColorToBgGradient(color: string) { return `${convertToBGGradientClass(color)} dark:border dark:border-neutral-700`; } +export function convertColorToRingClass(color: string | undefined) { + if (color && tailwindColors.includes(color)) { + return `focus-visible:ring-${color}-500`; + } + return `focus-visible:ring-orange-500`; +} + export function convertColorToBorderClass(color: string) { if (tailwindColors.includes(color)) { return `border-${color}-500`; diff --git a/src/interface/web/app/components/chatInputArea/chatInputArea.tsx b/src/interface/web/app/components/chatInputArea/chatInputArea.tsx index 14eaed1e..84adbb24 100644 --- a/src/interface/web/app/components/chatInputArea/chatInputArea.tsx +++ b/src/interface/web/app/components/chatInputArea/chatInputArea.tsx @@ -37,7 +37,12 @@ import { Popover, PopoverContent } from "@/components/ui/popover"; import { PopoverTrigger } from "@radix-ui/react-popover"; import { Textarea } from "@/components/ui/textarea"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; -import { convertColorToTextClass, convertToBGClass } from "@/app/common/colorUtils"; +import { + convertColorToTextClass, + convertToBGClass, + convertColorToBorderClass, + convertColorToRingClass, +} from "@/app/common/colorUtils"; import LoginPrompt from "../loginPrompt/loginPrompt"; import { uploadDataForIndexing } from "../../common/chatFunctions"; @@ -480,7 +485,10 @@ export const ChatInputArea = forwardRef((pr