Skip to content

Commit 35d49de

Browse files
Revert "feat(notificacoes): página de notificações com badge na sidebar"
This reverts commit dea4f54.
1 parent dea4f54 commit 35d49de

4 files changed

Lines changed: 4 additions & 226 deletions

File tree

src/frontend/src/App.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import ResetPassword from "./pages/ResetPassword";
99
import { isAuthenticated } from "./services/authService";
1010
import Dashboard from "./pages/Dashboard";
1111
import Emprestimos from "./pages/Emprestimos";
12-
import Notificacoes from "./pages/Notificacoes";
1312

1413
export default function App() {
1514
const location = useLocation();
@@ -57,10 +56,6 @@ export default function App() {
5756
path="/emprestimos"
5857
element={authenticated ? <Emprestimos /> : <Navigate to="/login" replace />}
5958
/>
60-
<Route
61-
path="/notificacoes"
62-
element={authenticated ? <Notificacoes /> : <Navigate to="/login" replace />}
63-
/>
6459
{/* <Route path="/configuracoes" element={<Configuracoes />} /> */}
6560
</Routes>
6661
</div>

src/frontend/src/components/Sidebar.jsx

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
import { useEffect, useState } from "react";
21
import { useLocation, useNavigate } from "react-router-dom";
32
import { getUsuarioLogado, logout } from "../services/authService";
4-
import { getNotificacoes } from "../services/NotificacoesService";
53

64
const navItems = [
7-
{ icon: "📊", label: "Dashboard", path: "/dashboard" },
8-
{ icon: "👥", label: "Clientes", path: "/clientes" },
9-
{ icon: "💳", label: "Empréstimos", path: "/emprestimos" },
10-
{ icon: "📈", label: "Relatórios", path: "/relatorios" },
11-
{ icon: "🔔", label: "Notificações", path: "/notificacoes" },
5+
{ icon: "📊", label: "Dashboard", path: "/dashboard" },
6+
{ icon: "👥", label: "Clientes", path: "/clientes" },
7+
{ icon: "💳", label: "Empréstimos", path: "/emprestimos" },
8+
{ icon: "📈", label: "Relatórios", path: "/relatorios" },
129
{ icon: "⚙️", label: "Configurações", path: "/configuracoes" },
1310
];
1411

1512
export default function Sidebar() {
1613
const location = useLocation();
1714
const navigate = useNavigate();
18-
const [naoLidas, setNaoLidas] = useState(0);
1915

2016
const usuario = getUsuarioLogado();
2117
const user = {
@@ -24,13 +20,6 @@ export default function Sidebar() {
2420
email: usuario?.email ?? "",
2521
};
2622

27-
useEffect(() => {
28-
if (!usuario?.nome) return;
29-
getNotificacoes(usuario.nome)
30-
.then((lista) => setNaoLidas(Array.isArray(lista) ? lista.filter((n) => !n.lida).length : 0))
31-
.catch(() => {});
32-
}, [usuario?.nome]);
33-
3423
function handleLogout() {
3524
logout();
3625
navigate("/login");
@@ -64,9 +53,6 @@ export default function Sidebar() {
6453
}}>
6554
{item.label}
6655
</span>
67-
{item.path === "/notificacoes" && naoLidas > 0 && (
68-
<span style={styles.notifBadge}>{naoLidas}</span>
69-
)}
7056
</button>
7157
);
7258
})}
@@ -211,15 +197,6 @@ const styles = {
211197
overflow: "hidden",
212198
textOverflow: "ellipsis",
213199
},
214-
notifBadge: {
215-
marginLeft: "auto",
216-
background: "#7C3AED",
217-
color: "#fff",
218-
borderRadius: 20,
219-
padding: "1px 7px",
220-
fontSize: 11,
221-
fontWeight: 700,
222-
},
223200
logoutBtn: {
224201
width: "100%",
225202
padding: "8px",

src/frontend/src/pages/Notificacoes.jsx

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

src/frontend/src/services/NotificacoesService.js

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

0 commit comments

Comments
 (0)