refactor: update navigation components and styles for improved consistency
Deploy Development / deploy (push) Successful in 34s
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

- Replaced legacy .capture-shell with .app-subnav-shell and integrated PageSectionNav for a unified navigation experience across multiple pages.
- Refactored AdminCatalogsPage, AdminMaturityModelsPage, ClubsPage, ExercisesListPage, MediaWikiImportPage, SkillsPage, and TrainingFrameworkProgramEditPage to utilize the new PageSectionNav component for tab navigation.
- Enhanced CSS styles for better responsiveness and visual clarity in navigation elements.
- Improved accessibility features with appropriate ARIA roles and attributes for better usability.
This commit is contained in:
Lars committed 2026-05-06 12:49:35 +02:00
1 parent 1e1fd80fb7
commit db8af53652
11 files changed
+243 -451

No files matched your search

+22 -25
View File
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react'
import React, { useState, useEffect, useMemo } from 'react'
import api from '../utils/api'
import { useAuth } from '../context/AuthContext'
import PageSectionNav from '../components/PageSectionNav'
const CLUB_ROLE_OPTIONS = [
{ code: 'club_admin', label: 'Vereinsadmin' },
@@ -285,6 +286,19 @@ function ClubsPage() {
setFormData(prev => ({ ...prev, [field]: value }))
}
const clubTabItems = useMemo(() => {
const ids = canManageOrgSomewhere
? ['clubs', 'divisions', 'groups', 'members']
: ['clubs', 'divisions', 'groups']
const labels = {
clubs: 'Vereine',
divisions: 'Sparten',
groups: 'Trainingsgruppen',
members: 'Mitglieder',
}
return ids.map((id) => ({ id, label: labels[id] }))
}, [canManageOrgSomewhere])
if (loading) {
return (
<div className="skills-page__loading">
@@ -294,10 +308,6 @@ function ClubsPage() {
)
}
const clubTabIds = canManageOrgSomewhere
? ['clubs', 'divisions', 'groups', 'members']
: ['clubs', 'divisions', 'groups']
return (
<div className="app-page clubs-page">
<h1 className="page-title">Vereinsverwaltung</h1>
@@ -306,27 +316,14 @@ function ClubsPage() {
Sparten sind optional — typische Eckdaten einer Gruppe (Wochentag, Zeit, Ort) kannst du schrittweise eintragen.
</p>
<div className="admin-page-subtabs" role="tablist" aria-label="Vereinsverwaltung">
{clubTabIds.map((tab) => (
<button
key={tab}
type="button"
role="tab"
aria-selected={activeTab === tab}
className={
'admin-page-subtabs__btn' + (activeTab === tab ? ' admin-page-subtabs__btn--active' : '')
}
onClick={() => setActiveTab(tab)}
>
{tab === 'clubs' && 'Vereine'}
{tab === 'divisions' && 'Sparten'}
{tab === 'groups' && 'Trainingsgruppen'}
{tab === 'members' && 'Mitglieder'}
</button>
))}
</div>
<PageSectionNav
ariaLabel="Vereinsverwaltung"
value={activeTab}
onChange={setActiveTab}
items={clubTabItems}
/>
{/* Clubs Tab */}
{/* Clubs Tab */}
{activeTab === 'clubs' && (
<>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1rem' }}>