feat(dashboard): improve RecordingSummaryCard styling and fix tab navigation
- Increase font size from xs to sm for better readability - Reduce avatar size from xs to 24px for better proportions - Add proper layout with heat names in separate line - Add truncate for long usernames to prevent overflow - Style status badges with colored backgrounds and icons (pending/accepted) - Fix EventChatPage to read and handle ?tab=records URL parameter - Map 'records' query param to 'recording' tab for proper navigation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { useParams, useNavigate, Link } from 'react-router-dom';
|
||||
import { useParams, useNavigate, useSearchParams, Link } from 'react-router-dom';
|
||||
import Layout from '../components/layout/Layout';
|
||||
import { useAuth } from '../contexts/AuthContext';
|
||||
import { Send, UserPlus, Loader2, LogOut, AlertTriangle, QrCode, Edit2, Filter, X, MessageSquare, Users, Video } from 'lucide-react';
|
||||
@@ -20,6 +20,7 @@ const EventChatPage = () => {
|
||||
const { slug } = useParams();
|
||||
const { user } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
const [event, setEvent] = useState(null);
|
||||
const [isParticipant, setIsParticipant] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -56,6 +57,24 @@ const EventChatPage = () => {
|
||||
// Tab state: 'chat' | 'participants' | 'recording'
|
||||
const [activeTab, setActiveTab] = useState('chat');
|
||||
|
||||
// Read tab from URL query parameter
|
||||
useEffect(() => {
|
||||
const tabParam = searchParams.get('tab');
|
||||
if (tabParam) {
|
||||
// Map 'records' to 'recording' for backwards compatibility
|
||||
const tabMapping = {
|
||||
'chat': 'chat',
|
||||
'participants': 'participants',
|
||||
'records': 'recording',
|
||||
'recording': 'recording'
|
||||
};
|
||||
const mappedTab = tabMapping[tabParam];
|
||||
if (mappedTab) {
|
||||
setActiveTab(mappedTab);
|
||||
}
|
||||
}
|
||||
}, [searchParams]);
|
||||
|
||||
const scrollToBottom = () => {
|
||||
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user