Skip to content

Commit 136b153

Browse files
Fix mering issues
2 parents fea999f + b986325 commit 136b153

File tree

20 files changed

+171
-314
lines changed

20 files changed

+171
-314
lines changed
8.34 KB
Loading

package-lock.json

Lines changed: 86 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
"@testing-library/user-event": "^13.5.0",
1010
"axios": "^1.8.4",
1111
"d3": "^7.9.0",
12-
"jwt-decode": "^4.0.0",
12+
"date-fns": "^4.1.0",
1313
"framer-motion": "^12.6.2",
14+
"jwt-decode": "^4.0.0",
1415
"react": "^19.0.0",
15-
"date-fns": "^4.1.0",
16+
"react-datepicker": "^8.2.1",
1617
"react-day-picker": "^9.6.3",
1718
"react-dom": "^19.0.0",
1819
"react-native": "^0.78.1",
19-
"react-router-dom": "^7.4.0",
20+
"react-router-dom": "^7.4.1",
2021
"react-scripts": "^5.0.1",
2122
"styled-components": "^6.1.16",
2223
"styled-system": "^5.1.5",

src/App.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ ul {
126126
justify-content: flex-end;
127127
}
128128

129+
.content .panel .header .user-info button {
130+
background: transparent;
131+
border: none;
132+
color: var(--variable-collection-current-color);
133+
cursor: pointer;
134+
}
135+
129136
.content .panel .header .user-info span {
130137
font-size: 18px;
131138
}

src/App.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import { ReactComponent as House } from "./assets/icons/house-user_11269953 1.svg";
1313
import { ReactComponent as Room } from "./assets/icons/workshop_14672030 1.svg";
1414
import { ReactComponent as UserIcon } from "./assets/icons/User.svg";
15+
import { ReactComponent as Door } from "./assets/icons/logOut 1.svg";
1516
import { consultarUsuarioPorCorreo } from "./api/usuario";
1617
import LoginPage from "./pages/Login/LoginPage";
1718
import Home from "./pages/Home/Home";
@@ -87,14 +88,13 @@ const Header = ({ user, onLogout }) => {
8788
alt="Avatar de usuario"
8889
/>
8990
<span>{user.nombre} {user.apellido}</span>
90-
<LogoutIcon
91-
src="https://cdn.builder.io/api/v1/image/assets/TEMP/1954f6c7c642021490080ffd4c81bc9798bf0beb?placeholderIfAbsent=true"
92-
alt="Logout"
91+
<button className="log-out"
9392
onClick={() => {
9493
onLogout();
9594
navigate("/");
96-
}}
97-
/>
95+
}}>
96+
<Door />
97+
</button>
9898
</div>
9999
</div>
100100
);
@@ -107,13 +107,6 @@ const UserAvatar = styled.img`
107107
border-radius: 50%;
108108
`;
109109

110-
const LogoutIcon = styled.img`
111-
width: 32px;
112-
height: 32px;
113-
cursor: pointer;
114-
fill: var(--variable-collection-current-color);
115-
`;
116-
117110
const obtenerCorreoDesdeToken = (token) => {
118111
try {
119112
const decoded = jwtDecode(token);
@@ -200,7 +193,7 @@ function AppRoutes({ user, setUser }) {
200193
</>
201194
) : (
202195
<>
203-
<Route path="/home" element={<Home />} />
196+
<Route path="/home" element={<Home usuario={user}/>} />
204197
<Route path="*" element={<Navigate to="/home" />} />
205198
</>
206199
)}

src/api/administrador.jsx

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/api/axiosInstance.js renamed to src/api/axiosInstance.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ const api = axios.create({
88
}
99
});
1010

11+
// Interceptor para agregar el token automáticamente
12+
api.interceptors.request.use(
13+
(config) => {
14+
const token = localStorage.getItem("token");
15+
if (token) {
16+
config.headers.Authorization = `Bearer ${token}`;
17+
}
18+
return config;
19+
},
20+
(error) => Promise.reject(error)
21+
);
22+
23+
1124
// Interceptor para manejar errores globalmente
1225
api.interceptors.response.use(
1326
response => response,

0 commit comments

Comments
 (0)