generated from Arquisoft/dede_0
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #196 from Arquisoft/Valentin_Interfaz2
Cabio estilo iniciar sesion
- Loading branch information
Showing
7 changed files
with
325 additions
and
216 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
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,43 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import Button from "@mui/material/Button"; | ||
import TextField from "@mui/material/TextField"; | ||
import type { AlertColor } from "@mui/material/Alert"; | ||
import { useNavigate, useParams } from "react-router-dom"; | ||
import Link from "@mui/material/Link"; | ||
import { addUser, getRocksById } from "../api/api"; | ||
import Swal from "sweetalert2"; | ||
import axios from "axios"; | ||
import "../css/LoginRegister.css"; | ||
import { Grid, Typography } from "@mui/material"; | ||
import { Rock } from "../shared/shareddtypes"; | ||
|
||
type RegisterProps = { | ||
handleAddToCart(r: Rock): void; | ||
}; | ||
|
||
function ProductView(props: RegisterProps): JSX.Element { | ||
const { id } = useParams() | ||
const [rock, setRock] = useState<Rock>() | ||
const refreshRock = async () => { | ||
if (id !== undefined) | ||
setRock((await getRocksById(id))[0]) | ||
console.log(rock) | ||
} | ||
useEffect(() => { | ||
refreshRock(); | ||
}, []); | ||
if (rock !== undefined) | ||
return ( | ||
<> | ||
<Grid container> | ||
<Grid item> | ||
<Typography>{rock.name}</Typography> | ||
</Grid> | ||
</Grid> | ||
</> | ||
); | ||
else | ||
return <></> | ||
} | ||
|
||
export default ProductView; |
Oops, something went wrong.