UX. refactor: simplify AdminPageNav component by removing unused hooks and improving styling
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 28s
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 6s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 28s
- Removed the useLocation hook as it was unnecessary for the component's functionality. - Updated the navigation styling to use CSS classes instead of inline styles, enhancing maintainability and readability. - Improved accessibility by adding aria-labels to navigation elements.
This commit is contained in:
1 parent
2007f3f659
commit
14884e6e55
6 files changed
+255
-221
No files matched your search
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Einheitliche Sub-Navigation (Jinkendo-Muster):
|
||||
* Mobil = horizontale Chips, Desktop ≥1024px = linke Spalte (sticky).
|
||||
* Nutzt .capture-shell* aus app.css.
|
||||
*/
|
||||
export default function AppSubnavShell({
|
||||
ariaLabel,
|
||||
items,
|
||||
value,
|
||||
onChange,
|
||||
children,
|
||||
iconSize = 18,
|
||||
}) {
|
||||
return (
|
||||
<div className="capture-shell app-subnav-shell">
|
||||
<div className="capture-shell__layout">
|
||||
<div className="capture-shell__nav-wrap">
|
||||
<nav className="capture-shell__nav" aria-label={ariaLabel}>
|
||||
{items.map((item) => {
|
||||
const Icon = item.icon
|
||||
const active = value === item.id
|
||||
return (
|
||||
<button
|
||||
key={item.id}
|
||||
type="button"
|
||||
className={
|
||||
'capture-shell__nav-item' +
|
||||
(active ? ' capture-shell__nav-item--active' : '')
|
||||
}
|
||||
onClick={() => onChange(item.id)}
|
||||
>
|
||||
{Icon ? (
|
||||
<Icon
|
||||
className="capture-shell__nav-icon"
|
||||
size={iconSize}
|
||||
strokeWidth={2}
|
||||
aria-hidden
|
||||
/>
|
||||
) : null}
|
||||
<span className="capture-shell__nav-label">{item.label}</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</nav>
|
||||
</div>
|
||||
<div className="capture-shell__main">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user