feat(ui): move back arrow from topbar to sidebar header on all pages
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React, { useState, useEffect, useMemo } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { NavLink, useLocation } from 'react-router-dom';
|
||||
import { NavLink, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useUIStore } from '@/store/uiStore';
|
||||
import { ChevronRight, FileText, Home, Settings, Users } from 'lucide-react';
|
||||
import { ChevronRight, FileText, Home, Settings, Users, ArrowLeft } from 'lucide-react';
|
||||
import { usePluginStore } from '@/store/pluginStore';
|
||||
// Curated icon map — avoids `import * as LucideIcons` which loads ALL icons and causes OOM in tests
|
||||
import {
|
||||
@@ -58,6 +58,7 @@ const singleItems: NavSingleItem[] = [
|
||||
const bottomItems: NavSingleItem[] = [];
|
||||
|
||||
export function Sidebar() {
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
const { sidebarOpen, setSidebarOpen } = useUIStore();
|
||||
const location = useLocation();
|
||||
@@ -178,7 +179,15 @@ export function Sidebar() {
|
||||
aria-label="Seitenleiste Navigation"
|
||||
data-testid="sidebar"
|
||||
>
|
||||
<div className="h-[58px] flex items-center px-4 border-b border-secondary-700">
|
||||
<div className="h-[58px] flex items-center gap-2 px-4 border-b border-secondary-700">
|
||||
<button
|
||||
onClick={() => navigate('/start')}
|
||||
className="p-1.5 rounded-md text-secondary-400 hover:bg-secondary-700 hover:text-white flex items-center justify-center focus:outline-none"
|
||||
aria-label="Zurück zur Startseite"
|
||||
title="Zurück zur Startseite"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
</button>
|
||||
<span className="text-xl font-bold text-white">leocrm</span>
|
||||
</div>
|
||||
<nav className="flex-1 overflow-y-auto py-4" aria-label="Hauptnavigation">
|
||||
|
||||
Reference in New Issue
Block a user