generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
1,397 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
coverage | ||
docs/build | ||
docs/build | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,6 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
* { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
font-family: 'PT Sans', sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,36 @@ | ||
import React, { useState } from 'react'; | ||
import AddUser from './components/AddUser'; | ||
import Login from './components/Login'; | ||
import CssBaseline from '@mui/material/CssBaseline'; | ||
import Container from '@mui/material/Container'; | ||
import Typography from '@mui/material/Typography'; | ||
import Link from '@mui/material/Link'; | ||
import React from 'react'; | ||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; | ||
import Layout from './components/Layout'; // Asegúrate de importar el nuevo componente Layout | ||
import Home from './components/pages/Home'; | ||
import Historial from './components/pages/Historial'; | ||
import Jugar from './components/pages/Jugar'; | ||
import SignUp from './components/AddUser'; | ||
import LogIn from './components/Login'; | ||
import { AuthProvider } from './AuthContext'; | ||
import Logout from "./components/Logout"; | ||
import AboutUS from "./components/pages/AboutUS"; | ||
import Error404Page from "./components/pages/Error404Page"; | ||
|
||
function App() { | ||
const [showLogin, setShowLogin] = useState(true); | ||
return ( | ||
<AuthProvider> {/* Envolver con AuthProvider */} | ||
<Router> | ||
<Routes> | ||
{/* Rutas que incluyen el Navbar a través del componente Layout */} | ||
<Route path="/" element={<Layout><Home /></Layout>} /> | ||
<Route path="/historial" element={<Layout><Historial /></Layout>} /> | ||
<Route path="/jugar" element={<Layout><Jugar /></Layout>} /> | ||
<Route path="/sign-up" element={<Layout><SignUp /></Layout>} /> | ||
<Route path="/logout" element={<Layout><Logout /></Layout>} /> | ||
<Route path="/login" element={<Layout><LogIn /></Layout>} /> | ||
<Route path="/aboutus" element={<Layout><AboutUS/></Layout>} /> | ||
|
||
const handleToggleView = () => { | ||
setShowLogin(!showLogin); | ||
}; | ||
|
||
return ( | ||
<Container component="main" maxWidth="xs"> | ||
<CssBaseline /> | ||
<Typography component="h1" variant="h5" align="center" sx={{ marginTop: 2 }}> | ||
Welcome to wiq_es04d | ||
</Typography> | ||
{showLogin ? <Login /> : <AddUser />} | ||
<Typography component="div" align="center" sx={{ marginTop: 2 }}> | ||
{showLogin ? ( | ||
<Link name="gotoregister" component="button" variant="body2" onClick={handleToggleView}> | ||
Don't have an account? Register here. | ||
</Link> | ||
) : ( | ||
<Link component="button" variant="body2" onClick={handleToggleView}> | ||
Already have an account? Login here. | ||
</Link> | ||
)} | ||
</Typography> | ||
</Container> | ||
); | ||
{/* Ruta NotFoundPage sin Layout para evitar mostrar el Navbar */} | ||
<Route path="*" element={<Error404Page />} /> | ||
</Routes> | ||
</Router> | ||
</AuthProvider> | ||
); | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// AuthContext.js | ||
import React, { createContext, useState } from 'react'; | ||
|
||
export const AuthContext = createContext(); | ||
|
||
export const AuthProvider = ({ children }) => { | ||
const [isLoggedIn, setIsLoggedIn] = useState(false); | ||
const [username, setUsername] = useState("unknown"); // Cambio de "unknow" a "unknown" | ||
|
||
const handleLogin = (username) => { | ||
setIsLoggedIn(true); | ||
setUsername(username); // Establecer el nombre de usuario al iniciar sesión | ||
}; | ||
|
||
const handleLogout = () => { | ||
setIsLoggedIn(false); | ||
setUsername("unknown"); // Restablecer el nombre de usuario al cerrar sesión | ||
}; | ||
|
||
return ( | ||
<AuthContext.Provider value={{ isLoggedIn, username, handleLogin, handleLogout }}> | ||
{children} | ||
</AuthContext.Provider> | ||
); | ||
}; |
Oops, something went wrong.