fixed hover and colors for nav
This commit is contained in:
parent
8d09e96630
commit
73af333060
2 changed files with 22 additions and 22 deletions
|
|
@ -111,7 +111,7 @@ export function Navigation({
|
||||||
) {
|
) {
|
||||||
// Filter out the deleted conversation and find the next one
|
// Filter out the deleted conversation and find the next one
|
||||||
const remainingConversations = conversations.filter(
|
const remainingConversations = conversations.filter(
|
||||||
(conv) => conv.response_id !== conversationToDelete.response_id,
|
conv => conv.response_id !== conversationToDelete.response_id
|
||||||
);
|
);
|
||||||
|
|
||||||
if (remainingConversations.length > 0) {
|
if (remainingConversations.length > 0) {
|
||||||
|
|
@ -132,7 +132,7 @@ export function Navigation({
|
||||||
setDeleteModalOpen(false);
|
setDeleteModalOpen(false);
|
||||||
setConversationToDelete(null);
|
setConversationToDelete(null);
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: error => {
|
||||||
toast.error(`Failed to delete conversation: ${error.message}`);
|
toast.error(`Failed to delete conversation: ${error.message}`);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -164,7 +164,7 @@ export function Navigation({
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new CustomEvent("fileUploadStart", {
|
new CustomEvent("fileUploadStart", {
|
||||||
detail: { filename: file.name },
|
detail: { filename: file.name },
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -188,7 +188,7 @@ export function Navigation({
|
||||||
filename: file.name,
|
filename: file.name,
|
||||||
error: "Failed to process document",
|
error: "Failed to process document",
|
||||||
},
|
},
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Trigger loading end event
|
// Trigger loading end event
|
||||||
|
|
@ -208,7 +208,7 @@ export function Navigation({
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new CustomEvent("fileUploaded", {
|
new CustomEvent("fileUploaded", {
|
||||||
detail: { file, result },
|
detail: { file, result },
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Trigger loading end event
|
// Trigger loading end event
|
||||||
|
|
@ -222,7 +222,7 @@ export function Navigation({
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new CustomEvent("fileUploadError", {
|
new CustomEvent("fileUploadError", {
|
||||||
detail: { filename: file.name, error: "Failed to process document" },
|
detail: { filename: file.name, error: "Failed to process document" },
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -244,7 +244,7 @@ export function Navigation({
|
||||||
|
|
||||||
const handleDeleteConversation = (
|
const handleDeleteConversation = (
|
||||||
conversation: ChatConversation,
|
conversation: ChatConversation,
|
||||||
event?: React.MouseEvent,
|
event?: React.MouseEvent
|
||||||
) => {
|
) => {
|
||||||
if (event) {
|
if (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -256,7 +256,7 @@ export function Navigation({
|
||||||
|
|
||||||
const handleContextMenuAction = (
|
const handleContextMenuAction = (
|
||||||
action: string,
|
action: string,
|
||||||
conversation: ChatConversation,
|
conversation: ChatConversation
|
||||||
) => {
|
) => {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "delete":
|
case "delete":
|
||||||
|
|
@ -334,15 +334,15 @@ export function Navigation({
|
||||||
<div className="flex flex-col h-full bg-background">
|
<div className="flex flex-col h-full bg-background">
|
||||||
<div className="px-3 py-2 flex-shrink-0">
|
<div className="px-3 py-2 flex-shrink-0">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
{routes.map((route) => (
|
{routes.map(route => (
|
||||||
<div key={route.href}>
|
<div key={route.href}>
|
||||||
<Link
|
<Link
|
||||||
href={route.href}
|
href={route.href}
|
||||||
className={cn(
|
className={cn(
|
||||||
"text-sm group flex p-3 w-full justify-start font-medium cursor-pointer hover:bg-accent hover:text-accent-foreground rounded-lg transition-all",
|
"text-[13px] group flex p-3 w-full justify-start font-medium cursor-pointer hover:bg-accent hover:text-accent-foreground rounded-lg transition-all",
|
||||||
route.active
|
route.active
|
||||||
? "bg-accent text-accent-foreground shadow-sm"
|
? "bg-accent text-accent-foreground shadow-sm"
|
||||||
: "text-foreground hover:text-accent-foreground",
|
: "text-foreground hover:text-accent-foreground"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="flex items-center flex-1">
|
<div className="flex items-center flex-1">
|
||||||
|
|
@ -350,8 +350,8 @@ export function Navigation({
|
||||||
className={cn(
|
className={cn(
|
||||||
"h-4 w-4 mr-3 shrink-0",
|
"h-4 w-4 mr-3 shrink-0",
|
||||||
route.active
|
route.active
|
||||||
? "text-accent-foreground"
|
? "text-muted-foreground"
|
||||||
: "text-muted-foreground group-hover:text-foreground",
|
: "text-muted-foreground group-hover:text-muted-foreground"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{route.label}
|
{route.label}
|
||||||
|
|
@ -429,7 +429,7 @@ export function Navigation({
|
||||||
No conversations yet
|
No conversations yet
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
conversations.map((conversation) => (
|
conversations.map(conversation => (
|
||||||
<button
|
<button
|
||||||
key={conversation.response_id}
|
key={conversation.response_id}
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -464,7 +464,7 @@ export function Navigation({
|
||||||
disabled={
|
disabled={
|
||||||
loading || deleteSessionMutation.isPending
|
loading || deleteSessionMutation.isPending
|
||||||
}
|
}
|
||||||
onClick={(e) => {
|
onClick={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -475,14 +475,14 @@ export function Navigation({
|
||||||
side="bottom"
|
side="bottom"
|
||||||
align="end"
|
align="end"
|
||||||
className="w-48"
|
className="w-48"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={e => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={(e) => {
|
onClick={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleContextMenuAction(
|
handleContextMenuAction(
|
||||||
"delete",
|
"delete",
|
||||||
conversation,
|
conversation
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
className="cursor-pointer text-destructive focus:text-destructive"
|
className="cursor-pointer text-destructive focus:text-destructive"
|
||||||
|
|
@ -528,7 +528,7 @@ export function Navigation({
|
||||||
No documents yet
|
No documents yet
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
conversationDocs.map((doc) => (
|
conversationDocs.map(doc => (
|
||||||
<div
|
<div
|
||||||
key={`${doc.filename}-${doc.uploadTime.getTime()}`}
|
key={`${doc.filename}-${doc.uploadTime.getTime()}`}
|
||||||
className="p-2 rounded-lg hover:bg-accent cursor-pointer group flex items-center"
|
className="p-2 rounded-lg hover:bg-accent cursor-pointer group flex items-center"
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export function UserNav() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// In no-auth mode, show a simple theme switcher instead of auth UI
|
// In no-auth mode, show a simple theme switcher instead of auth UI
|
||||||
if (isNoAuthMode) {
|
if (!isNoAuthMode) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
||||||
|
|
@ -42,7 +42,7 @@ export function UserNav() {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
onClick={login}
|
onClick={login}
|
||||||
className="flex items-center gap-2 h-7 px-3 mr-2 rounded-md bg-primary text-primary-foreground text-sm"
|
className="flex items-center gap-2 h-7 px-3 mr-2 rounded-md bg-primary text-primary-foreground text-[13px] line-height-[16px]"
|
||||||
>
|
>
|
||||||
Sign In
|
Sign In
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -52,7 +52,7 @@ export function UserNav() {
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<button className="hover:bg-muted rounded-lg pl-[4px] p-[3px] flex items-center justify-center">
|
<button className="hover:bg-accent rounded-lg pl-[4px] p-[3px] flex items-center justify-center">
|
||||||
<Avatar className="rounded-md w-7 h-7">
|
<Avatar className="rounded-md w-7 h-7">
|
||||||
<AvatarImage
|
<AvatarImage
|
||||||
width={16}
|
width={16}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue