fix: Simplify notification settings and fix notification test on dashboard.

This commit is contained in:
Elisiário Couto
2025-09-11 12:16:47 +01:00
parent 5a823d62f0
commit 91020e32ea
5 changed files with 39 additions and 58 deletions

View File

@@ -102,7 +102,7 @@ export default function Notifications() {
if (!testService) return;
testMutation.mutate({
service: testService,
service: testService.toLowerCase(),
message: testMessage,
});
};
@@ -113,7 +113,7 @@ export default function Notifications() {
`Are you sure you want to delete the ${serviceName} notification service?`,
)
) {
deleteServiceMutation.mutate(serviceName);
deleteServiceMutation.mutate(serviceName.toLowerCase());
}
};

View File

@@ -3,29 +3,31 @@ import { useState } from "react";
import Sidebar from "../components/Sidebar";
import Header from "../components/Header";
export const Route = createRootRoute({
component: () => {
const [sidebarOpen, setSidebarOpen] = useState(false);
function RootLayout() {
const [sidebarOpen, setSidebarOpen] = useState(false);
return (
<div className="flex h-screen bg-gray-100">
<Sidebar sidebarOpen={sidebarOpen} setSidebarOpen={setSidebarOpen} />
return (
<div className="flex h-screen bg-gray-100">
<Sidebar sidebarOpen={sidebarOpen} setSidebarOpen={setSidebarOpen} />
{/* Mobile overlay */}
{sidebarOpen && (
<div
className="fixed inset-0 z-40 bg-gray-600 bg-opacity-75 lg:hidden"
onClick={() => setSidebarOpen(false)}
/>
)}
{/* Mobile overlay */}
{sidebarOpen && (
<div
className="fixed inset-0 z-40 bg-gray-600 bg-opacity-75 lg:hidden"
onClick={() => setSidebarOpen(false)}
/>
)}
<div className="flex flex-col flex-1 overflow-hidden">
<Header setSidebarOpen={setSidebarOpen} />
<main className="flex-1 overflow-y-auto p-6">
<Outlet />
</main>
</div>
<div className="flex flex-col flex-1 overflow-hidden">
<Header setSidebarOpen={setSidebarOpen} />
<main className="flex-1 overflow-y-auto p-6">
<Outlet />
</main>
</div>
);
},
</div>
);
}
export const Route = createRootRoute({
component: RootLayout,
});

View File

@@ -4,8 +4,5 @@ import { TanStackRouterVite } from "@tanstack/router-vite-plugin";
// https://vite.dev/config/
export default defineConfig({
plugins: [
TanStackRouterVite(),
react(),
],
plugins: [TanStackRouterVite(), react()],
});