feat: enhance card layouts and UI components across multiple pages
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 10s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 7s
Test Suite / playwright-tests (push) Failing after 29s

- Updated CSS styles to improve card spacing and layout consistency in grid formats.
- Introduced a new card-grid class for better handling of card arrangements in ClubsPage and TrainingFrameworkProgramsListPage.
- Added ExerciseCardScopeStatus component to display visibility and status icons in ExercisesListPage, enhancing user feedback.
- Refactored exercise card actions and footer for improved layout and accessibility.
- Enhanced overall responsiveness and visual clarity across various components.
This commit is contained in:
Lars committed 2026-05-06 12:41:04 +02:00
1 parent b9ef0395c1
commit 1e1fd80fb7
4 files changed
+122 -26

No files matched your search

+7 -5
View File
@@ -504,11 +504,13 @@ function ClubsPage() {
</p>
</div>
) : (
<div style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(320px, 1fr))',
gap: '1rem'
}}>
<div
className="card-grid clubs-groups-card-grid"
style={{
gridTemplateColumns: 'repeat(auto-fill, minmax(320px, 1fr))',
gap: '1rem'
}}
>
{groups.map(group => (
<div key={group.id} className="card">
<h3 style={{ marginBottom: '0.5rem' }}>{group.name}</h3>
+48 -4
View File
@@ -1,6 +1,17 @@
import React, { useState, useEffect, useMemo, useCallback } from 'react'
import { Link } from 'react-router-dom'
import { Eye, Pencil, Trash2 } from 'lucide-react'
import {
Eye,
Pencil,
Trash2,
Globe,
Users,
Lock,
CheckCircle2,
Archive,
CircleDot,
FilePenLine,
} from 'lucide-react'
import api from '../utils/api'
import { useAuth } from '../context/AuthContext'
import { SKILL_LEVEL_OPTIONS } from '../constants/skillLevels'
@@ -56,6 +67,38 @@ function exerciseCardClassName(exercise, userId) {
.join(' ')
}
function ExerciseCardScopeStatus({ exercise }) {
const v = exercise.visibility || 'private'
const s = exercise.status || 'draft'
const visLabel = visibilityLabel(v)
const stLabel = statusLabel(s)
const tip = `${visLabel} · ${stLabel}`
let VisIcon = Lock
if (v === 'official') VisIcon = Globe
else if (v === 'club') VisIcon = Users
let StatIcon = FilePenLine
if (s === 'approved') StatIcon = CheckCircle2
else if (s === 'archived') StatIcon = Archive
else if (s === 'in_review') StatIcon = CircleDot
return (
<div
className="exercise-card__meta-compact"
title={tip}
aria-label={`Sichtbarkeit: ${visLabel}. Status: ${stLabel}.`}
>
<span className="exercise-card__meta-glyph">
<VisIcon size={15} strokeWidth={2} aria-hidden />
</span>
<span className="exercise-card__meta-sep" aria-hidden>
·
</span>
<span className="exercise-card__meta-glyph">
<StatIcon size={15} strokeWidth={2} aria-hidden />
</span>
</div>
)
}
function levelOptionShort(levelStr) {
const o = LEVEL_FILTER_OPTS.find((x) => String(x.level) === String(levelStr))
return o ? String(o.level) : String(levelStr)
@@ -1157,8 +1200,6 @@ function ExercisesListPage() {
{typeNames.map((name) => (
<span key={`tt:${name}`} className="exercise-tag exercise-tag--training">{name}</span>
))}
<span className="exercise-tag exercise-tag--scope">{visibilityLabel(exercise.visibility)}</span>
<span className="exercise-tag exercise-tag--meta">{statusLabel(exercise.status)}</span>
</div>
{summaryHtml ? (
<div
@@ -1168,7 +1209,9 @@ function ExercisesListPage() {
) : null}
</div>
</div>
<div className="exercise-card__actions exercise-card__actions--icons">
<div className="exercise-card__footer">
<ExerciseCardScopeStatus exercise={exercise} />
<div className="exercise-card__actions exercise-card__actions--icons">
<Link
to={`/exercises/${exercise.id}`}
className="exercise-card__icon-btn"
@@ -1194,6 +1237,7 @@ function ExercisesListPage() {
>
<Trash2 size={18} strokeWidth={2} aria-hidden />
</button>
</div>
</div>
</div>
)
@@ -159,9 +159,9 @@ export default function TrainingFrameworkProgramsListPage() {
</Link>
</div>
) : (
<ul style={{ listStyle: 'none' }}>
<ul className="framework-programs-list">
{rows.map((r) => (
<li key={r.id} className="card" style={{ marginBottom: '12px' }}>
<li key={r.id} className="card">
<div
style={{
display: 'flex',