Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Quick quiz active link fix #10

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/chat/chat-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const ChatInput: FC<ChatInputProps> = ({ files, setFiles }) => {
value={input}
onChange={handleInputChange}
onPaste={handlePaste}
onKeyDown={handleKeyDown} // Add this line
onKeyDown={handleKeyDown}
/>

<div className="absolute bottom-[8px] right-3 cursor-pointer hover:opacity-50">
Expand Down
13 changes: 6 additions & 7 deletions components/sidebar/items/chat/quick-quiz.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { LearntimeContext } from "@/context/context"
import { cn } from "@/lib/utils"
import { useParams, useRouter } from "next/navigation"
import { useContext, useRef } from "react"
import { useRouter } from "next/navigation"
import { useContext, useEffect, useRef, useState } from "react"
import { usePathname } from "next/navigation"

export const QuickQuiz = () => {
const { selectedWorkspace, selectedChat } = useContext(LearntimeContext)
const { selectedWorkspace } = useContext(LearntimeContext)

const router = useRouter()
const params = useParams()
const pathname = usePathname()

// chat id is quick-quiz
const isActive =
params.chatid === "quick-quiz" || selectedChat?.id === "quick-quiz"
const isActive = pathname.includes("/chat/quick-quiz")

const itemRef = useRef<HTMLDivElement>(null)

Expand Down