Spaces:
Sleeping
Sleeping
Girish Jeswani commited on
Commit ·
141e477
1
Parent(s): cc28dcb
update sidebar props
Browse files
phd-advisor-frontend/src/pages/ChatPage.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import React, { useState, useEffect, useRef } from 'react';
|
| 2 |
-
import { Home, MessageCircle, Reply, X, Sparkles, Users, Settings2, FileText , LogOut} from 'lucide-react';
|
| 3 |
import EnhancedChatInput from '../components/EnhancedChatInput';
|
| 4 |
import MessageBubble from '../components/MessageBubble';
|
| 5 |
import ThinkingIndicator from '../components/ThinkingIndicator';
|
|
@@ -30,6 +30,7 @@ const ChatPage = ({ user, authToken, onNavigateToHome, onSignOut }) => {
|
|
| 30 |
const [currentSessionTitle, setCurrentSessionTitle] = useState('');
|
| 31 |
const [isSavingSession, setIsSavingSession] = useState(false);
|
| 32 |
const [isLoadingSession, setIsLoadingSession] = useState(false);
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
|
|
@@ -37,6 +38,10 @@ const ChatPage = ({ user, authToken, onNavigateToHome, onSignOut }) => {
|
|
| 37 |
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
| 38 |
};
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
useEffect(() => {
|
| 41 |
scrollToBottom();
|
| 42 |
}, [messages, thinkingAdvisors]);
|
|
@@ -688,6 +693,8 @@ const handleNewChat = async (sessionId = null) => {
|
|
| 688 |
onSignOut={onSignOut}
|
| 689 |
authToken={authToken}
|
| 690 |
onSidebarToggle={handleSidebarToggle}
|
|
|
|
|
|
|
| 691 |
/>
|
| 692 |
|
| 693 |
<div className={`main-chat-area ${isSidebarCollapsed ? 'sidebar-collapsed' : ''}`}>
|
|
@@ -695,6 +702,12 @@ const handleNewChat = async (sessionId = null) => {
|
|
| 695 |
{/* Floating Header */}
|
| 696 |
<div className="floating-header">
|
| 697 |
<div className="header-left">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 698 |
<button onClick={onNavigateToHome} className="modern-home-btn">
|
| 699 |
<Home size={20} />
|
| 700 |
</button>
|
|
|
|
| 1 |
import React, { useState, useEffect, useRef } from 'react';
|
| 2 |
+
import { Home, MessageCircle, Reply, X, Sparkles, Users, Settings2, FileText , LogOut, Menu} from 'lucide-react';
|
| 3 |
import EnhancedChatInput from '../components/EnhancedChatInput';
|
| 4 |
import MessageBubble from '../components/MessageBubble';
|
| 5 |
import ThinkingIndicator from '../components/ThinkingIndicator';
|
|
|
|
| 30 |
const [currentSessionTitle, setCurrentSessionTitle] = useState('');
|
| 31 |
const [isSavingSession, setIsSavingSession] = useState(false);
|
| 32 |
const [isLoadingSession, setIsLoadingSession] = useState(false);
|
| 33 |
+
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
| 34 |
|
| 35 |
|
| 36 |
|
|
|
|
| 38 |
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
| 39 |
};
|
| 40 |
|
| 41 |
+
const handleMobileMenuToggle = () => {
|
| 42 |
+
setIsMobileMenuOpen(!isMobileMenuOpen);
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
useEffect(() => {
|
| 46 |
scrollToBottom();
|
| 47 |
}, [messages, thinkingAdvisors]);
|
|
|
|
| 693 |
onSignOut={onSignOut}
|
| 694 |
authToken={authToken}
|
| 695 |
onSidebarToggle={handleSidebarToggle}
|
| 696 |
+
isMobileOpen={isMobileMenuOpen}
|
| 697 |
+
onMobileToggle={setIsMobileMenuOpen}
|
| 698 |
/>
|
| 699 |
|
| 700 |
<div className={`main-chat-area ${isSidebarCollapsed ? 'sidebar-collapsed' : ''}`}>
|
|
|
|
| 702 |
{/* Floating Header */}
|
| 703 |
<div className="floating-header">
|
| 704 |
<div className="header-left">
|
| 705 |
+
<button
|
| 706 |
+
className="mobile-menu-button"
|
| 707 |
+
onClick={handleMobileMenuToggle}
|
| 708 |
+
>
|
| 709 |
+
<Menu size={20} />
|
| 710 |
+
</button>
|
| 711 |
<button onClick={onNavigateToHome} className="modern-home-btn">
|
| 712 |
<Home size={20} />
|
| 713 |
</button>
|
phd-advisor-frontend/src/styles/ChatPage.css
CHANGED
|
@@ -986,18 +986,56 @@
|
|
| 986 |
font-size: 12px;
|
| 987 |
}
|
| 988 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 989 |
/* Responsive Design for Chat Page */
|
| 990 |
@media (max-width: 768px) {
|
| 991 |
.floating-header {
|
| 992 |
padding: 12px 16px;
|
| 993 |
-
flex-wrap:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 994 |
gap: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 995 |
}
|
| 996 |
|
| 997 |
.header-right {
|
| 998 |
-
gap:
|
|
|
|
|
|
|
|
|
|
| 999 |
}
|
| 1000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1001 |
|
| 1002 |
.main-content {
|
| 1003 |
padding: 24px 12px 120px 12px; /* Adjusted for mobile */
|
|
@@ -1030,12 +1068,6 @@
|
|
| 1030 |
font-size: 13px;
|
| 1031 |
}
|
| 1032 |
|
| 1033 |
-
.export-dropdown {
|
| 1034 |
-
right: -20px;
|
| 1035 |
-
left: -20px;
|
| 1036 |
-
width: auto;
|
| 1037 |
-
min-width: unset;
|
| 1038 |
-
}
|
| 1039 |
|
| 1040 |
.main-chat-area {
|
| 1041 |
margin-left: 0;
|
|
@@ -1063,4 +1095,17 @@
|
|
| 1063 |
padding: 10px 14px;
|
| 1064 |
font-size: 12px;
|
| 1065 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1066 |
}
|
|
|
|
| 986 |
font-size: 12px;
|
| 987 |
}
|
| 988 |
|
| 989 |
+
.mobile-menu-button {
|
| 990 |
+
display: none;
|
| 991 |
+
width: 44px;
|
| 992 |
+
height: 44px;
|
| 993 |
+
border-radius: 12px;
|
| 994 |
+
border: none;
|
| 995 |
+
background: var(--bg-secondary);
|
| 996 |
+
color: var(--text-secondary);
|
| 997 |
+
cursor: pointer;
|
| 998 |
+
transition: all 0.2s ease;
|
| 999 |
+
align-items: center;
|
| 1000 |
+
justify-content: center;
|
| 1001 |
+
}
|
| 1002 |
+
|
| 1003 |
+
.mobile-menu-button:hover {
|
| 1004 |
+
background: var(--accent-primary);
|
| 1005 |
+
color: white;
|
| 1006 |
+
}
|
| 1007 |
+
|
| 1008 |
/* Responsive Design for Chat Page */
|
| 1009 |
@media (max-width: 768px) {
|
| 1010 |
.floating-header {
|
| 1011 |
padding: 12px 16px;
|
| 1012 |
+
flex-wrap: nowrap;
|
| 1013 |
+
gap: 8px;
|
| 1014 |
+
}
|
| 1015 |
+
|
| 1016 |
+
.header-left {
|
| 1017 |
gap: 12px;
|
| 1018 |
+
flex: 0; /* Don't let it grow */
|
| 1019 |
+
min-width: 0;
|
| 1020 |
+
}
|
| 1021 |
+
|
| 1022 |
+
/* Hide brand elements on mobile to reduce clutter */
|
| 1023 |
+
.header-left .modern-home-btn,
|
| 1024 |
+
.header-left .header-brand {
|
| 1025 |
+
display: none;
|
| 1026 |
}
|
| 1027 |
|
| 1028 |
.header-right {
|
| 1029 |
+
gap: 8px;
|
| 1030 |
+
flex: 1; /* Let header-right take available space */
|
| 1031 |
+
justify-content: flex-end; /* Align items to the right */
|
| 1032 |
+
flex-shrink: 0;
|
| 1033 |
}
|
| 1034 |
|
| 1035 |
+
/* Ensure mobile menu button is visible */
|
| 1036 |
+
.mobile-menu-button {
|
| 1037 |
+
display: flex;
|
| 1038 |
+
}
|
| 1039 |
|
| 1040 |
.main-content {
|
| 1041 |
padding: 24px 12px 120px 12px; /* Adjusted for mobile */
|
|
|
|
| 1068 |
font-size: 13px;
|
| 1069 |
}
|
| 1070 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1071 |
|
| 1072 |
.main-chat-area {
|
| 1073 |
margin-left: 0;
|
|
|
|
| 1095 |
padding: 10px 14px;
|
| 1096 |
font-size: 12px;
|
| 1097 |
}
|
| 1098 |
+
|
| 1099 |
+
.brand-text h1 {
|
| 1100 |
+
font-size: 16px;
|
| 1101 |
+
}
|
| 1102 |
+
|
| 1103 |
+
.brand-text p {
|
| 1104 |
+
font-size: 11px;
|
| 1105 |
+
}
|
| 1106 |
+
|
| 1107 |
+
.session-title-display{
|
| 1108 |
+
display: none;
|
| 1109 |
+
}
|
| 1110 |
+
|
| 1111 |
}
|