Skip to content

Commit 56b4647

Browse files
committed
cambios perfil usuario
1 parent a9d9ba0 commit 56b4647

File tree

5 files changed

+158
-263
lines changed

5 files changed

+158
-263
lines changed

Diff for: migrations/versions/83fb8f773037_.py renamed to migrations/versions/02db57486dda_.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"""empty message
22
3-
Revision ID: 83fb8f773037
3+
Revision ID: 02db57486dda
44
Revises:
5-
Create Date: 2025-03-19 01:32:37.695224
5+
Create Date: 2025-03-20 08:44:01.875440
66
77
"""
88
from alembic import op
99
import sqlalchemy as sa
1010

1111

1212
# revision identifiers, used by Alembic.
13-
revision = '83fb8f773037'
13+
revision = '02db57486dda'
1414
down_revision = None
1515
branch_labels = None
1616
depends_on = None

Diff for: src/front/js/component/footer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Footer = () => {
77
{/* Sección de Información */}
88
<div>
99
<h3 className="text-xl font-semibold mb-2">Sobre Nosotros</h3>
10-
<p className="text-gray-600">Nos dedicamos a proporcionar la mejor información sobre alimentación y cuidado de tus mascotas.</p>
10+
<p className="text-gray-600">En PupperEats queremos que tus peludos tengan la mejor calidad de vida posible. Somos defensores de la comida de calidad sin aditivos innecesarios que ofrezcan la mejor opción según las necesidades específicas de tu mascota.</p>
1111
</div>
1212

1313
{/* Sección de Redes Sociales */}
@@ -27,7 +27,7 @@ export const Footer = () => {
2727
</div>
2828
</div>
2929
<div className="text-center text-gray-500 text-sm mt-6">
30-
&copy; 2024 Pupper Eats - Todos los derechos reservados
30+
&copy; 2025 Pupper Eats - Todos los derechos reservados
3131
</div>
3232
</footer>
3333
);

Diff for: src/front/js/pages/loginSignup.js

+88-72
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import React, { useState, useContext } from 'react';
22
import { Context } from '../store/appContext';
33
import { Link, useNavigate } from 'react-router-dom';
4-
import "../../styles/home.css";
54

65
export const LoginSignup = () => {
7-
const { actions, store } = useContext(Context);
6+
const { actions } = useContext(Context);
87
const navigate = useNavigate();
98

109
const [name, setName] = useState('');
1110
const [email, setEmail] = useState('');
1211
const [password, setPassword] = useState('');
1312
const [isSignup, setIsSignup] = useState(false);
14-
const [loading, setLoading] = useState(false);
15-
const [error, setError] = useState('');
13+
const [loading, setLoading] = useState(false);
14+
const [error, setError] = useState('');
1615
const [successMessage, setSuccessMessage] = useState('');
1716

1817
const handleSubmit = async (e) => {
@@ -25,7 +24,7 @@ export const LoginSignup = () => {
2524
const dataUser = { name, email, password };
2625
if (isSignup) {
2726
await actions.signup(dataUser, navigate);
28-
setSuccessMessage('¡Registro exitoso! Redirigiendo a inicio de sesión...');
27+
setSuccessMessage('¡Registro exitoso! Redirigiendo...');
2928
setTimeout(() => {
3029
setIsSignup(false);
3130
},);
@@ -35,79 +34,96 @@ export const LoginSignup = () => {
3534
setName('');
3635
setEmail('');
3736
setPassword('');
38-
} catch (err) {
39-
setError('Error al procesar la solicitud. Por favor, intenta nuevamente.');
37+
} catch (error) {
38+
setError('Error al procesar la solicitud.');
4039
} finally {
4140
setLoading(false);
4241
}
4342
};
4443

4544
return (
46-
<div className="registration-view-container" style={{ background: "linear-gradient(to bottom, #FCE5CD, #FFFFFF)" }}>
47-
<div className="form-container">
48-
{!isSignup && (
49-
<form className="auth-form login-form" onSubmit={handleSubmit}>
50-
<h2>Iniciar sesión</h2>
51-
<input
52-
type="email"
53-
placeholder="Correo electrónico"
54-
value={email}
55-
onChange={(e) => setEmail(e.target.value)}
56-
required
57-
/>
58-
<input
59-
type="password"
60-
placeholder="Contraseña"
61-
value={password}
62-
onChange={(e) => setPassword(e.target.value)}
63-
required
64-
/>
65-
<button type="submit" disabled={loading}>
66-
{loading ? 'Cargando...' : 'Iniciar sesión'}
67-
</button>
68-
{error && <p className="error-message">{error}</p>}
69-
<p onClick={() => setIsSignup(true)}>¿No tienes cuenta? <strong>Regístrate</strong></p>
70-
71-
{/* NUEVO: Enlace para recuperación de contraseña */}
72-
<p>
73-
¿Olvidaste tu contraseña? <Link to="/RecuperacionContraseña">Recupérala aquí</Link>
74-
</p>
75-
</form>
76-
)}
77-
{isSignup && (
78-
<form className="auth-form signup-form" onSubmit={handleSubmit}>
79-
<h2>Regístrate</h2>
80-
<input
81-
type="name"
82-
placeholder="Nombre"
83-
value={name}
84-
onChange={(e) => setName(e.target.value)}
85-
required
86-
/>
87-
<input
88-
type="email"
89-
placeholder="Correo electrónico"
90-
value={email}
91-
onChange={(e) => setEmail(e.target.value)}
92-
required
93-
/>
94-
<input
95-
type="password"
96-
placeholder="Contraseña"
97-
value={password}
98-
onChange={(e) => setPassword(e.target.value)}
99-
required
100-
/>
101-
<button type="submit" disabled={loading}>
102-
{loading ? 'Cargando...' : 'Registrar'}
103-
</button>
104-
{error && <p className="error-message">{error}</p>}
105-
{successMessage && <p className="success-message">{successMessage}</p>}
106-
<p onClick={() => setIsSignup(false)}>¿Ya tienes cuenta? <strong>Inicia sesión</strong></p>
107-
</form>
108-
)}
109-
<Link to="/">
110-
<p>Volver a la página principal</p></Link>
45+
<div className="container d-flex justify-content-center align-items-center vh-100 bg-light">
46+
<div className="card shadow-lg p-4" style={{ maxWidth: "450px", width: "100%" }}>
47+
<div className="card-body">
48+
{!isSignup ? (
49+
<form onSubmit={handleSubmit}>
50+
<h2 className="text-center mb-3">Iniciar sesión</h2>
51+
<div className="mb-3">
52+
<input
53+
type="email"
54+
className="form-control"
55+
placeholder="Correo electrónico"
56+
value={email}
57+
onChange={(e) => setEmail(e.target.value)}
58+
required
59+
/>
60+
</div>
61+
<div className="mb-3">
62+
<input
63+
type="password"
64+
className="form-control"
65+
placeholder="Contraseña"
66+
value={password}
67+
onChange={(e) => setPassword(e.target.value)}
68+
required
69+
/>
70+
</div>
71+
<button type="submit" className="btn btn-primary w-100" disabled={loading}>
72+
{loading ? 'Cargando...' : 'Iniciar sesión'}
73+
</button>
74+
{error && <p className="text-danger text-center mt-2">{error}</p>}
75+
<p className="text-center mt-3">
76+
¿No tienes cuenta? <span className="text-primary" style={{ cursor: "pointer" }} onClick={() => setIsSignup(true)}>Regístrate</span>
77+
</p>
78+
<p className="text-center mt-1">
79+
<Link to="/RecuperacionContraseña" className="text-primary">¿Olvidaste tu contraseña?</Link>
80+
</p>
81+
</form>
82+
) : (
83+
<form onSubmit={handleSubmit}>
84+
<h2 className="text-center mb-3">Regístrate</h2>
85+
<div className="mb-3">
86+
<input
87+
type="text"
88+
className="form-control"
89+
placeholder="Nombre"
90+
value={name}
91+
onChange={(e) => setName(e.target.value)}
92+
required
93+
/>
94+
</div>
95+
<div className="mb-3">
96+
<input
97+
type="email"
98+
className="form-control"
99+
placeholder="Correo electrónico"
100+
value={email}
101+
onChange={(e) => setEmail(e.target.value)}
102+
required
103+
/>
104+
</div>
105+
<div className="mb-3">
106+
<input
107+
type="password"
108+
className="form-control"
109+
placeholder="Contraseña"
110+
value={password}
111+
onChange={(e) => setPassword(e.target.value)}
112+
required
113+
/>
114+
</div>
115+
<button type="submit" className="btn btn-primary w-100" disabled={loading}>
116+
{loading ? 'Cargando...' : 'Registrar'}
117+
</button>
118+
{error && <p className="text-danger text-center mt-2">{error}</p>}
119+
{successMessage && <p className="text-success text-center mt-2">{successMessage}</p>}
120+
<p className="text-center mt-3">
121+
¿Ya tienes cuenta? <span className="text-primary" style={{ cursor: "pointer" }} onClick={() => setIsSignup(false)}>Inicia sesión</span>
122+
</p>
123+
</form>
124+
)}
125+
<Link to="/" className="text-center d-block mt-3 text-secondary">Volver a la página principal</Link>
126+
</div>
111127
</div>
112128
</div>
113129
);

Diff for: src/front/js/pages/perfilUsuario.js

+65-26
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useEffect, useContext, useState } from "react";
22
import logo from "../../img/Icono puppereats.png";
3-
import {EdicionPerfil} from "../component/edicionPerfil";
3+
import { EdicionPerfil } from "../component/edicionPerfil";
44
import { Context } from "../store/appContext";
5-
import { User, MapPin, PlusCircle } from "lucide-react";
5+
import { User, MapPin, PlusCircle, LogOut, ShoppingCart } from "lucide-react"; // Importar ShoppingCart para el ícono
66
import { useNavigate, Link } from "react-router-dom";
77
import "bootstrap/dist/css/bootstrap.min.css";
88

@@ -27,38 +27,74 @@ export const PerfilUsuario = () => {
2727

2828
return (
2929
<div className="container py-5" style={{ background: "#f9f6f2", minHeight: "100vh", borderRadius: "10px" }}>
30-
{/* Header */}
31-
<div className="d-flex justify-content-between align-items-center mb-4">
32-
<div>
33-
<Link to="/" className="navbar-brand d-flex align-items-center" onClick={() => setActiveCategory(null)}>
34-
<img src={logo} alt="Logo" style={{ height: "60px", border: "3px solid #000", borderRadius: "10px", padding: "3px" }} />
35-
<span className="fw-bold text-dark" style={{ fontSize: "1.5rem", marginLeft: "10px" }}>Pupper Eats</span>
36-
</Link>
37-
<button className="btn btn-warning me-2" onClick={() => navigate("/carrito")}>🛒 Carrito</button>
38-
<button className="btn btn-outline-secondary" onClick={actions.logout}>Cerrar sesión</button>
30+
{/* Navbar personalizado */}
31+
<nav className="navbar navbar-expand-lg mb-4" style={{ borderRadius: "12px", boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)", backgroundColor:"#257180" }}>
32+
<div className="container-fluid">
33+
{/* Logo */}
34+
<Link to="/" className="navbar-brand d-flex align-items-center">
35+
<img
36+
src={logo}
37+
alt="Logo"
38+
style={{ height: "60px", border: "3px solid #000", borderRadius: "10px", padding: "3px" }}
39+
/>
40+
<span className="fw-bold text-dark ms-2" style={{ fontSize: "2.5rem" }}>Pupper Eats</span>
41+
</Link>
42+
43+
{/* Botón del carrito */}
44+
<button
45+
className="btn btn-warning btn-sm d-flex align-items-center gap-2 ms-auto"
46+
onClick={() => navigate("/carrito")}
47+
style={{ borderRadius: "8px", whiteSpace: "nowrap" }} // Estilo personalizado
48+
>
49+
<ShoppingCart size={16} /> {/* Ícono del carrito */}
50+
<span>Carrito</span>
51+
</button>
3952
</div>
40-
</div>
53+
</nav>
4154

42-
{/* Perfil de Usuario */}
43-
<div className="card p-4 mb-4 shadow-lg" style={{ borderRadius: "12px", backgroundColor: "#fff8e1" }}>
44-
<h2 className="text-dark">Hola, <span className="fw-bold">{store.user.name}</span> 👋</h2>
55+
{/* Perfil usuario */}
56+
<div className="card p-4 mb-5" style={{ borderRadius: "12px", backgroundColor: "#f9f6f2", border: "none", border: "none" }}>
57+
<h2 className="text-dark mb-3">Hola, <span className="fw-bold">{store.user.name}</span> 👋</h2>
58+
<button
59+
className="btn btn-sm d-flex align-items-center gap-2"
60+
onClick={actions.logout}
61+
style={{ border: "none", color: "#6c757d", padding: "0" }} // Estilo personalizado
62+
>
63+
<LogOut size={16} /> {/* Ícono de cerrar sesión */}
64+
<span>Cerrar sesión</span>
65+
</button>
4566
<div className="mt-3">
46-
<p><User size={16} /> {store.user.name}</p>
47-
<p><MapPin size={16} /> {store.user.email}</p>
48-
<button className="btn btn-outline-primary" onClick={() => setIsEditModalOpen(true)}>Editar perfil</button>
67+
<p className="d-flex align-items-center gap-2">
68+
<User size={20} className="text-primary" /> {store.user.name}
69+
</p>
70+
<p className="d-flex align-items-center gap-2">
71+
<MapPin size={20} className="text-primary" /> {store.user.email}
72+
</p>
73+
<button
74+
className="btn btn-dark"
75+
onClick={() => setIsEditModalOpen(true)}
76+
style={{ borderRadius: "none", backgroundColor: "#FD8B51" }}
77+
>
78+
Editar perfil
79+
</button>
4980
</div>
5081
</div>
5182

5283
{/* Modal de Edición de Perfil */}
5384
<EdicionPerfil isOpen={isEditModalOpen} onClose={() => setIsEditModalOpen(false)} />
5485

5586
{/* Mis Mascotas */}
56-
<h3 className="text-dark mb-3">🐾 Mis Mascotas</h3>
57-
<div className="card p-3 shadow-lg" style={{ borderRadius: "12px", backgroundColor: "#fff" }}>
58-
<div className="d-flex align-items-center gap-3 flex-wrap">
59-
<button className="btn btn-outline-primary d-flex flex-column align-items-center">
60-
<PlusCircle size={40} />
61-
<Link to="/registro-mascota" className="btn btn-primary">Añadir perfil mascota</Link>
87+
<h2 className="text-dark mb-4">🐾 Mis Mascotas</h2>
88+
<div className="card p-4" style={{ borderRadius: "12px", backgroundColor: "#fff", border: "none" }}>
89+
<div className="d-flex align-items-center gap-4 flex-wrap">
90+
<button
91+
className="btn btn-outline-light d-flex flex-column align-items-center justify-content-center p-3"
92+
style={{ borderRadius: "12px", width: "120px", height: "120px", color:"#F2E5BF" }}
93+
>
94+
<PlusCircle size={40} className="mb-2" />
95+
<Link to="/registro-mascota" className="text-decoration-none text-dark fs-6 fw-medium">
96+
<span>Añadir mascota</span>
97+
</Link>
6298
</button>
6399
{store.pets && store.pets.length > 0 ? (
64100
store.pets.map((pet, index) => (
@@ -69,12 +105,15 @@ export const PerfilUsuario = () => {
69105
style={{ cursor: "pointer" }}
70106
>
71107
<img
72-
src={pet.url || "https://via.placeholder.com/60"}
108+
src={pet.animal_type === "perro" ? "https://images.emojiterra.com/google/noto-emoji/unicode-16.0/color/1024px/1f436.png" :
109+
pet.animal_type === "gato" ? "https://cdn-icons-png.flaticon.com/512/6988/6988878.png" :
110+
pet.animal_type === "exotico" ? "https://cdn-icons-png.flaticon.com/512/802/802338.png" :
111+
"https://via.placeholder.com/60" }
73112
alt={pet.name}
74113
className="rounded-circle border border-secondary"
75114
style={{ width: 60, height: 60, objectFit: "cover" }}
76115
/>
77-
<span className="d-block mt-1 fw-semibold">{pet.name}</span>
116+
<span className="d-block mt-2 fw-semibold">{pet.name}</span>
78117
</div>
79118
))
80119
) : (

0 commit comments

Comments
 (0)