diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 08e3419..113cdea 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -13,7 +13,6 @@ import { DialogProvider } from './context/DialogContext'; import { motion, AnimatePresence } from 'framer-motion'; import { StatusTimeline, type Event } from './components/dashboard/EventStatusTimeline'; import { useEffect } from 'react'; -import ritLogo from './assets/images/college-logo.png'; import { InstitutionalCalendar } from './components/dashboard/InstitutionalCalendar'; import { VenueTimeline } from './components/dashboard/VenueTimeline'; @@ -28,56 +27,6 @@ import { ManageNoticesView } from './components/dashboard/ManageNoticesView'; import { ManageStudentsView } from './components/dashboard/ManageStudentsView'; import { VenueManagement } from './components/dashboard/VenueManagement'; -const LoginTransitionScreen: React.FC<{ user: any }> = ({ user }) => { - return ( - -
- - RIT Logo - - -
- - Welcome Back - - - {user?.fullName || "User"} - -
- - - Connecting to Event Hub... - -
-
- ); -}; const AppContent: React.FC = () => { const { isAuthenticated, user } = useAuth(); @@ -85,22 +34,6 @@ const AppContent: React.FC = () => { const [activeItem, setActiveItem] = useState('dashboard'); const [userEvents, setUserEvents] = useState([]); const [preFillData, setPreFillData] = useState(null); - const [showTransition, setShowTransition] = useState(false); - const [cachedUser, setCachedUser] = useState(null); - - useEffect(() => { - if (isAuthenticated && user) { - setCachedUser(user); - setShowTransition(true); - const timer = setTimeout(() => { - setShowTransition(false); - }, 2000); - return () => clearTimeout(timer); - } else { - setShowTransition(false); - setCachedUser(null); - } - }, [isAuthenticated, user]); const handleIncompleteClick = (data: any) => { setPreFillData(data); @@ -168,6 +101,38 @@ const AppContent: React.FC = () => { } }, [isAuthenticated, activeItem, user?.email, user?.role, user?.department]); + if (!isAuthenticated) { + return ( + + + + + + ); + } + + if (user?.role === 'STUDENT') { + return ( + + + + + + ); + } + const renderContent = () => { const isDashboard = ( { }; return ( - <> - - {showTransition && } - - - {!isAuthenticated ? ( - - ) : user?.role === 'STUDENT' ? ( - - ) : ( - + + - - - {renderContent()} - - - - )} - + {renderContent()} + + + ); };