Spaces:
Sleeping
Sleeping
Download src/App.jsx from Aya07/emotion-ui: direct link, hf CLI and curl.
- Browser
- Download file 890 Bytes
-
https://huggingface.co/spaces/Aya07/emotion-ui/resolve/main/src/App.jsx
- Command line
-
hf download hf://spaces/Aya07/emotion-ui/src/App.jsx
-
curl -L -o App.jsx https://huggingface.co/spaces/Aya07/emotion-ui/resolve/main/src/App.jsx
890 Bytes
| // src/App.jsx | |
| import React, { useState } from 'react'; | |
| import { AuthProvider, useAuth } from './contexts/AuthContext'; | |
| import Login from './pages/Login'; | |
| import Signup from './pages/Signup'; | |
| import MainApp from './MainApp'; | |
| import './styles/global.css'; | |
| const AppContent = () => { | |
| const { isAuthenticated, loading } = useAuth(); | |
| const [showSignup, setShowSignup] = useState(false); | |
| if (loading) { | |
| return ( | |
| <div className="loading-container"> | |
| <div className="spinner"></div> | |
| <p>Loading...</p> | |
| </div> | |
| ); | |
| } | |
| if (!isAuthenticated) { | |
| return showSignup ? ( | |
| <Signup onSwitchToLogin={() => setShowSignup(false)} /> | |
| ) : ( | |
| <Login onSwitchToSignup={() => setShowSignup(true)} /> | |
| ); | |
| } | |
| return <MainApp />; | |
| }; | |
| function App() { | |
| return ( | |
| <AuthProvider> | |
| <AppContent /> | |
| </AuthProvider> | |
| ); | |
| } | |
| export default App; |