diff --git a/.replit b/.replit
index b1b492e..fa8f8de 100644
--- a/.replit
+++ b/.replit
@@ -22,6 +22,10 @@ externalPort = 3003
localPort = 35357
externalPort = 3002
+[[ports]]
+localPort = 37431
+externalPort = 5000
+
[[ports]]
localPort = 37659
externalPort = 4200
@@ -34,6 +38,10 @@ externalPort = 3000
localPort = 43245
externalPort = 3001
+[[ports]]
+localPort = 46681
+externalPort = 5173
+
[env]
PORT = "5000"
diff --git a/client/src/components/sidebar.tsx b/client/src/components/sidebar.tsx
index 071eec8..f0154c0 100644
--- a/client/src/components/sidebar.tsx
+++ b/client/src/components/sidebar.tsx
@@ -31,10 +31,16 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
const isAdmin = session?.role === "admin";
- const handleLinkClick = () => {
+ const handleLinkClick = (href: string, e: React.MouseEvent) => {
+ e.preventDefault();
+ // Always close sidebar on mobile first
if (onLinkClick) {
onLinkClick();
}
+ // Navigate after a small delay to ensure state update completes
+ setTimeout(() => {
+ setLocation(href);
+ }, 10);
};
const logoutMutation = useMutation({
@@ -92,11 +98,11 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
return (
- handleLinkClick(item.href, e)}
className={`
- flex items-center gap-3 px-4 py-3 rounded-xl font-medium transition-all relative
+ flex items-center gap-3 px-4 py-3 rounded-xl font-medium transition-all relative cursor-pointer
${isActive
? 'bg-gradient-to-r from-primary/10 to-secondary/10 text-primary shadow-sm'
: 'text-muted-foreground hover:bg-sidebar-accent hover:text-foreground'
@@ -119,7 +125,7 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
)}
>
)}
-
+
{isCollapsed && (
{item.label}
@@ -142,11 +148,11 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
return (
- handleLinkClick(item.href, e)}
className={`
- flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative
+ flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative cursor-pointer
${isActive
? 'bg-gradient-to-r from-primary/10 to-secondary/10 text-primary shadow-sm'
: 'text-muted-foreground hover:bg-sidebar-accent hover:text-foreground'
@@ -160,7 +166,7 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
)}
{!isCollapsed && {item.label}}
-
+
{isCollapsed && (
{item.label}
@@ -182,11 +188,11 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
Administration
)}
- handleLinkClick("/pages", e)}
className={`
- flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group
+ flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group cursor-pointer
${location === "/pages"
? 'bg-gradient-to-r from-primary/10 to-secondary/10 text-primary shadow-sm'
: 'text-muted-foreground hover:bg-sidebar-accent hover:text-foreground'
@@ -205,12 +211,12 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
Pages gérées
)}
-
-
+ handleLinkClick("/users", e)}
className={`
- flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group
+ flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group cursor-pointer
${location === "/users"
? 'bg-gradient-to-r from-primary/10 to-secondary/10 text-primary shadow-sm'
: 'text-muted-foreground hover:bg-sidebar-accent hover:text-foreground'
@@ -229,12 +235,12 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
Utilisateurs
)}
-
-
+ handleLinkClick("/sql", e)}
className={`
- flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group
+ flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group cursor-pointer
${location === "/sql"
? 'bg-gradient-to-r from-primary/10 to-secondary/10 text-primary shadow-sm'
: 'text-muted-foreground hover:bg-sidebar-accent hover:text-foreground'
@@ -253,12 +259,12 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
SQL
)}
-
-
+ handleLinkClick("/settings", e)}
className={`
- flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group
+ flex items-center gap-3 px-4 py-3 rounded-xl transition-all relative group cursor-pointer
${location === "/settings"
? 'bg-gradient-to-r from-primary/10 to-secondary/10 text-primary shadow-sm'
: 'text-muted-foreground hover:bg-sidebar-accent hover:text-foreground'
@@ -277,7 +283,7 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
Paramètres
)}
-
+
>
)}
@@ -318,10 +324,10 @@ export default function Sidebar({ onLinkClick }: SidebarProps = {}) {
)}
- {/* Toggle Button */}
+ {/* Toggle Button (Desktop only) */}