Skip to content

Commit

Permalink
Fix current conversation css
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase committed Sep 13, 2024
1 parent e77d7c6 commit 8a6a590
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/app/_components/MainSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export default function MainSidebar({ data }: SidebarProps) {
<Link
href={item.href}
className={
`${pathname.includes(item.href) ? "bg-black text-white pointer-events-none" : "bg-transparent"}
`${pathname.includes(item.href) ? "bg-black text-white pointer-events-none" : "bg-transparent text-black"}
flex justify-center items-center
w-full h-12 text-balack rounded-lg
w-full h-12 rounded-lg
transition-all duration-500
hover:bg-white/70 active:scale-90`
}
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/app/_components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
import { AnimatePresence, motion } from "framer-motion";
import { X, MessageCirclePlus } from 'lucide-react';
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useParams, useRouter } from "next/navigation";
import { useMutation, useQuery, useQueryClient } from "react-query";

type Conversation = {
Expand All @@ -26,6 +26,7 @@ export default function Sidebar({
const config = useConfig();

const queryClient = useQueryClient();
const params = useParams();

const { data: conversations = [] } = useQuery("conversations", async () => {
const response = await api.get_messages__user_id_(config.ENDPOINT);
Expand Down Expand Up @@ -91,7 +92,7 @@ export default function Sidebar({
<label
htmlFor={`chat-${conversation.id}`}
className={`flex cursor-pointer items-center justify-between gap-4 border-b px-2 py-3 md:p-4 text-sm font-medium ${
currentConversationId == conversation.id
params.id == conversation.id
? "bg-[#5d76f7]/20 text-black font-semibold"
: "text-black"
}`}
Expand Down

0 comments on commit 8a6a590

Please sign in to comment.