Rename app title from Bogfoering to Books in sidebar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
926085eeab
commit
1bacbea33b
2 changed files with 68 additions and 28 deletions
3
.beads/issues.jsonl
Normal file
3
.beads/issues.jsonl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{"id":"books-bj6","title":"Test automatisk pickup","status":"closed","priority":2,"issue_type":"task","owner":"nhh@softwarehuset.com","created_at":"2026-01-30T14:04:40.572496+01:00","created_by":"Nicolaj Hartmann","updated_at":"2026-01-30T14:05:44.401903+01:00","closed_at":"2026-01-30T14:05:44.401903+01:00","close_reason":"completed"}
|
||||
{"id":"books-sbm","title":"ændre navnet i venstre side til Books","status":"closed","priority":2,"issue_type":"task","owner":"nhh@softwarehuset.com","created_at":"2026-01-30T14:11:13.017202+01:00","created_by":"Nicolaj Hartmann","updated_at":"2026-01-30T14:12:14.16594+01:00","closed_at":"2026-01-30T14:12:14.16594+01:00","close_reason":"Closed"}
|
||||
{"id":"books-wqf","title":"Opret en logud knap i topbaren","status":"closed","priority":2,"issue_type":"task","owner":"nhh@softwarehuset.com","created_at":"2026-01-30T14:06:06.999508+01:00","created_by":"Nicolaj Hartmann","updated_at":"2026-01-30T14:10:52.860045+01:00","closed_at":"2026-01-30T14:10:52.860045+01:00","close_reason":"Closed"}
|
||||
|
|
@ -9,6 +9,14 @@ import {
|
|||
SettingOutlined,
|
||||
FileTextOutlined,
|
||||
ThunderboltOutlined,
|
||||
UserOutlined,
|
||||
BuildOutlined,
|
||||
ShopOutlined,
|
||||
ShoppingOutlined,
|
||||
ShoppingCartOutlined,
|
||||
FileDoneOutlined,
|
||||
FileExclamationOutlined,
|
||||
ExportOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useUIStore } from '@/stores/uiStore';
|
||||
|
|
@ -41,6 +49,14 @@ const menuItems: MenuItem[] = [
|
|||
getItem('Kontooversigt', '/kontooversigt', <AccountBookOutlined />),
|
||||
]),
|
||||
|
||||
getItem('Fakturering', 'invoicing', <FileDoneOutlined />, [
|
||||
getItem('Kunder', '/kunder', <ShopOutlined />),
|
||||
getItem('Produkter', '/produkter', <ShoppingOutlined />),
|
||||
getItem('Ordrer', '/ordrer', <ShoppingCartOutlined />),
|
||||
getItem('Fakturaer', '/fakturaer', <FileDoneOutlined />),
|
||||
getItem('Kreditnotaer', '/kreditnotaer', <FileExclamationOutlined />),
|
||||
]),
|
||||
|
||||
getItem('Bank', 'bank', <BankOutlined />, [
|
||||
getItem('Bankafstemning', '/bankafstemning', <BankOutlined />),
|
||||
]),
|
||||
|
|
@ -48,39 +64,68 @@ const menuItems: MenuItem[] = [
|
|||
getItem('Rapportering', 'reporting', <PercentageOutlined />, [
|
||||
getItem('Momsindberetning', '/momsindberetning', <PercentageOutlined />),
|
||||
getItem('Loenforstaelse', '/loenforstaelse', <TeamOutlined />),
|
||||
getItem('Eksport', '/eksport', <ExportOutlined />),
|
||||
]),
|
||||
|
||||
getItem('Indstillinger', '/indstillinger', <SettingOutlined />),
|
||||
getItem('Indstillinger', 'settings', <SettingOutlined />, [
|
||||
getItem('Virksomhed', '/indstillinger', <BuildOutlined />),
|
||||
getItem('Min profil', '/profil', <UserOutlined />),
|
||||
]),
|
||||
];
|
||||
|
||||
export default function Sidebar() {
|
||||
// Determine open keys for submenus based on current path
|
||||
function getOpenKeys(pathname: string): string[] {
|
||||
if (pathname === '/kassekladde' || pathname === '/kontooversigt' || pathname === '/hurtig-bogforing') {
|
||||
return ['accounting'];
|
||||
}
|
||||
if (pathname === '/kunder' || pathname === '/produkter' || pathname === '/ordrer' || pathname === '/fakturaer' || pathname === '/kreditnotaer') {
|
||||
return ['invoicing'];
|
||||
}
|
||||
if (pathname === '/bankafstemning') {
|
||||
return ['bank'];
|
||||
}
|
||||
if (pathname === '/momsindberetning' || pathname === '/loenforstaelse' || pathname === '/eksport') {
|
||||
return ['reporting'];
|
||||
}
|
||||
if (pathname === '/indstillinger' || pathname === '/profil') {
|
||||
return ['settings'];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
// Exported menu component for reuse in mobile Drawer
|
||||
interface SidebarMenuProps {
|
||||
onNavigate?: () => void;
|
||||
}
|
||||
|
||||
export function SidebarMenu({ onNavigate }: SidebarMenuProps) {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const { sidebarCollapsed, toggleSidebar } = useUIStore();
|
||||
|
||||
const handleMenuClick: MenuProps['onClick'] = ({ key }) => {
|
||||
if (key.startsWith('/')) {
|
||||
navigate(key);
|
||||
onNavigate?.();
|
||||
}
|
||||
};
|
||||
|
||||
// Determine selected keys based on current path
|
||||
const selectedKeys = [location.pathname];
|
||||
|
||||
// Determine open keys for submenus
|
||||
const getOpenKeys = () => {
|
||||
const path = location.pathname;
|
||||
if (path === '/kassekladde' || path === '/kontooversigt' || path === '/hurtig-bogforing') {
|
||||
return ['accounting'];
|
||||
}
|
||||
if (path === '/bankafstemning') {
|
||||
return ['bank'];
|
||||
}
|
||||
if (path === '/momsindberetning' || path === '/loenforstaelse') {
|
||||
return ['reporting'];
|
||||
}
|
||||
return [];
|
||||
};
|
||||
return (
|
||||
<Menu
|
||||
theme="dark"
|
||||
mode="inline"
|
||||
selectedKeys={selectedKeys}
|
||||
defaultOpenKeys={getOpenKeys(location.pathname)}
|
||||
items={menuItems}
|
||||
onClick={handleMenuClick}
|
||||
style={{ borderRight: 0 }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Sidebar() {
|
||||
const { sidebarCollapsed, toggleSidebar } = useUIStore();
|
||||
|
||||
return (
|
||||
<Sider
|
||||
|
|
@ -116,20 +161,12 @@ export default function Sidebar() {
|
|||
whiteSpace: 'nowrap',
|
||||
}}
|
||||
>
|
||||
{sidebarCollapsed ? 'B' : 'Bogfoering'}
|
||||
{sidebarCollapsed ? 'B' : 'Books'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Navigation Menu */}
|
||||
<Menu
|
||||
theme="dark"
|
||||
mode="inline"
|
||||
selectedKeys={selectedKeys}
|
||||
defaultOpenKeys={getOpenKeys()}
|
||||
items={menuItems}
|
||||
onClick={handleMenuClick}
|
||||
style={{ borderRight: 0 }}
|
||||
/>
|
||||
<SidebarMenu />
|
||||
</Sider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue