feat: widget icons, dark theme tables, breadcrumb removal, bookkeeping rework, personal equipment pages, PDF/order improvements
This commit is contained in:
@@ -1,2 +1 @@
|
||||
export { PageBreadcrumbs } from './PageBreadcrumbs';
|
||||
export type { BreadcrumbItem } from './PageBreadcrumbs';
|
||||
|
||||
|
||||
@@ -25,4 +25,3 @@ export { default as IssueOverviewWidget } from './IssueOverviewWidget';
|
||||
export { default as ChecklistWidget } from './ChecklistWidget';
|
||||
export { default as SortableWidget } from './SortableWidget';
|
||||
export { default as BuchhaltungWidget } from './BuchhaltungWidget';
|
||||
export { default as PersoenlicheAusruestungWidget } from './PersoenlicheAusruestungWidget';
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Box, Tab, Tabs } from '@mui/material';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { PageHeader } from './PageHeader';
|
||||
import { TabPanel } from './TabPanel';
|
||||
import type { BreadcrumbItem } from './PageHeader';
|
||||
|
||||
export interface TabDef {
|
||||
label: React.ReactNode;
|
||||
@@ -14,7 +13,6 @@ export interface TabDef {
|
||||
|
||||
export interface DetailLayoutProps {
|
||||
title: string;
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
actions?: React.ReactNode;
|
||||
tabs: TabDef[];
|
||||
backTo?: string;
|
||||
@@ -25,7 +23,6 @@ export interface DetailLayoutProps {
|
||||
/** Detail page layout with PageHeader and tab navigation synced to URL. */
|
||||
export const DetailLayout: React.FC<DetailLayoutProps> = ({
|
||||
title,
|
||||
breadcrumbs,
|
||||
actions,
|
||||
tabs,
|
||||
backTo,
|
||||
@@ -50,7 +47,7 @@ export const DetailLayout: React.FC<DetailLayoutProps> = ({
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<PageHeader title={title} breadcrumbs={breadcrumbs} actions={actions} backTo={backTo} />
|
||||
<PageHeader title={title} actions={actions} backTo={backTo} />
|
||||
{isLoading ? (
|
||||
skeleton
|
||||
) : (
|
||||
|
||||
@@ -1,31 +1,23 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Box,
|
||||
Breadcrumbs,
|
||||
IconButton,
|
||||
Typography,
|
||||
} from '@mui/material';
|
||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
|
||||
export interface BreadcrumbItem {
|
||||
label: string;
|
||||
href?: string;
|
||||
}
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
export interface PageHeaderProps {
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
actions?: React.ReactNode;
|
||||
backTo?: string;
|
||||
}
|
||||
|
||||
/** Page title bar with optional breadcrumbs, back button, and action slot. */
|
||||
/** Page title bar with optional back button and action slot. */
|
||||
export const PageHeader: React.FC<PageHeaderProps> = ({
|
||||
title,
|
||||
subtitle,
|
||||
breadcrumbs,
|
||||
actions,
|
||||
backTo,
|
||||
}) => {
|
||||
@@ -33,27 +25,6 @@ export const PageHeader: React.FC<PageHeaderProps> = ({
|
||||
|
||||
return (
|
||||
<Box>
|
||||
{breadcrumbs && breadcrumbs.length > 0 && (
|
||||
<Breadcrumbs sx={{ mb: 1 }}>
|
||||
{breadcrumbs.map((item, i) =>
|
||||
item.href && i < breadcrumbs.length - 1 ? (
|
||||
<Link
|
||||
key={i}
|
||||
to={item.href}
|
||||
style={{ textDecoration: 'none', color: 'inherit' }}
|
||||
>
|
||||
<Typography variant="body2" color="text.secondary" sx={{ '&:hover': { textDecoration: 'underline' } }}>
|
||||
{item.label}
|
||||
</Typography>
|
||||
</Link>
|
||||
) : (
|
||||
<Typography key={i} variant="body2" color="text.primary">
|
||||
{item.label}
|
||||
</Typography>
|
||||
)
|
||||
)}
|
||||
</Breadcrumbs>
|
||||
)}
|
||||
<Box display="flex" alignItems="center" justifyContent="space-between" mb={3}>
|
||||
<Box display="flex" alignItems="center" gap={1}>
|
||||
{backTo && (
|
||||
|
||||
@@ -59,7 +59,16 @@ export const WidgetCard: React.FC<WidgetCardProps> = ({
|
||||
>
|
||||
<Box display="flex" alignItems="center" gap={0.75}>
|
||||
{icon && (
|
||||
<Box sx={{ color: 'text.secondary', display: 'flex', alignItems: 'center', '& > *': { fontSize: '1.1rem' } }}>
|
||||
<Box sx={{
|
||||
bgcolor: 'primary.main',
|
||||
borderRadius: 1.5,
|
||||
p: 0.5,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: 'white',
|
||||
'& > *': { fontSize: '1rem' },
|
||||
}}>
|
||||
{icon}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
@@ -7,7 +7,7 @@ export type { ListCardProps } from './ListCard';
|
||||
export { FormCard } from './FormCard';
|
||||
export type { FormCardProps } from './FormCard';
|
||||
export { PageHeader } from './PageHeader';
|
||||
export type { PageHeaderProps, BreadcrumbItem } from './PageHeader';
|
||||
export type { PageHeaderProps } from './PageHeader';
|
||||
export { PageContainer } from './PageContainer';
|
||||
export type { PageContainerProps } from './PageContainer';
|
||||
export { FormLayout } from './FormLayout';
|
||||
|
||||
Reference in New Issue
Block a user