This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.html
44 lines (40 loc) · 1.5 KB
/
profile.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Perfil del Usuario</title>
<link rel="stylesheet" href="css/profile.css">
</head>
<body>
<h1>Complete User Profile</h1>
<form id="profileForm">
<div>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
</div>
<div>
<label for="surname">Surname:</label>
<input type="text" id="surname" name="surname" required>
</div>
<div>
<label for="birthdate">Date of Birth:</label>
<input type="date" id="birthdate" name="birthdate" required>
</div>
<button type="submit">Save Information</button>
</form>
<script type="module">
import '/js/firebaseIntegration.js'; // Importa la configuración de Firebase
import { auth } from '/js/firebaseIntegration.js';
import { updateProfile } from '/js/profile.js'; // Importa la función para actualizar el perfil
document.getElementById('profileForm').addEventListener('submit', event => {
event.preventDefault(); // Evita el envío normal del formulario
const name = document.getElementById('name').value;
const surname = document.getElementById('surname').value;
const birthdate = document.getElementById('birthdate').value;
updateProfile(auth.currentUser.uid, { name, surname, birthdate });
});
</script>
</body>
</html>