forked 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.
Merge pull request #36 from Arquisoft/carlos
Attempt to create the game and history page.
- Loading branch information
Showing
4 changed files
with
101 additions
and
9 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
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,42 @@ | ||
import React, { useState } from 'react'; | ||
import axios from 'axios'; | ||
import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; | ||
|
||
const Game = () => { | ||
/*const [username, setUsername] = useState(''); | ||
const [password, setPassword] = useState(''); | ||
const [error, setError] = useState(''); | ||
const [loginSuccess, setLoginSuccess] = useState(false); | ||
const [createdAt, setCreatedAt] = useState(''); | ||
const [openSnackbar, setOpenSnackbar] = useState(false); | ||
const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; | ||
const loginUser = async () => { | ||
try { | ||
const response = await axios.post(`${apiEndpoint}/login`, { username, password }); | ||
// Extract data from the response | ||
const { createdAt: userCreatedAt } = response.data; | ||
setCreatedAt(userCreatedAt); | ||
setLoginSuccess(true); | ||
setOpenSnackbar(true); | ||
} catch (error) { | ||
setError(error.response.data.error); | ||
} | ||
}; | ||
const handleCloseSnackbar = () => { | ||
setOpenSnackbar(false); | ||
};*/ | ||
|
||
return ( | ||
<div> | ||
<h1>Esta sería la pagina del juego</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Game; |
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,14 @@ | ||
import React, { useState } from 'react'; | ||
import axios from 'axios'; | ||
import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; | ||
|
||
const HistoricalData = () => { | ||
|
||
return ( | ||
<div> | ||
<h1>Esta sería la pagina del historico de partidas</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HistoricalData; |
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