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 #49 from Arquisoft/carlos
MainPage creation and navigation changes
- Loading branch information
Showing
5 changed files
with
58 additions
and
52 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
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,40 @@ | ||
import React, { useState } from 'react'; | ||
import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
const MainPage = () => { | ||
const navigate = useNavigate(); | ||
|
||
const handleShowGame = () => { | ||
let path= '/Game'; | ||
navigate(path); | ||
}; | ||
|
||
const handleShowHistoricalData = () => { | ||
let path= '/HistoricalData'; | ||
navigate(path); | ||
}; | ||
|
||
return ( | ||
<Container component="main" maxWidth="xs" sx={{ marginTop: 4 }}> | ||
<div> | ||
<Typography component="h1" variant="h5" sx={{ textAlign: 'center' }}> | ||
Hello ! | ||
</Typography> | ||
<Typography component="p" variant="body1" sx={{ textAlign: 'center', marginTop: 2 }}> | ||
Your account was created on . | ||
</Typography> | ||
|
||
{/* Se declaran los botones en los q al hacer click se ejecuta el metodo especificado en onClick*/} | ||
<Button variant="contained" color="primary" onClick={handleShowGame}> | ||
Empieza juego | ||
</Button> | ||
<Button variant="contained" color="primary" onClick={handleShowHistoricalData}> | ||
Historico de partidas de jugador | ||
</Button> | ||
</div> | ||
</Container> | ||
) | ||
} | ||
|
||
export default MainPage; |
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