Topmenu mobilne: opcje grup rozciagniete na pelna szerokosc ekranu (akcje, sortowanie, grupowanie, miesiac)

This commit is contained in:
tisachi
2026-09-11 17:23:17 +02:00
parent 43e288054c
commit 214d22b3e1
3 changed files with 11 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import {
import type { Trainee, UserSearchResult } from '../../api/types';
import { displayName, fmtDate } from '../../lib/format';
import { TRAINEE_FLAGS } from '../../lib/labels';
import { cn } from '../../lib/utils';
import {
Badge,
Button,
@@ -132,8 +133,11 @@ export default function Trainees() {
onClick={() => setSortOpen((o) => !o)}
aria-haspopup="true"
aria-expanded={sortOpen}
/* pomarańcz (accent) tylko gdy wybrano nie-domyślne sortowanie */
className={sortKey !== 'none' ? 'border-accent/55 bg-accent/11 text-accent-text' : ''}
/* pomarańcz (accent) tylko gdy wybrano nie-domyślne sortowanie; telefon: pełna szerokość */
className={cn(
'max-md:w-full',
sortKey !== 'none' && 'border-accent/55 bg-accent/11 text-accent-text',
)}
>
<ArrowUpDown className="w-4 h-4" />
Sortuj: {SORT_OPTIONS.find((s) => s.id === sortKey)?.label}
@@ -174,7 +178,7 @@ export default function Trainees() {
variant="secondary"
aria-pressed={groupByGym}
onClick={() => setGroupByGym((v) => !v)}
className={groupByGym ? 'border-accent/55 bg-accent/11 text-accent-text' : ''}
className={cn('max-md:w-full', groupByGym && 'border-accent/55 bg-accent/11 text-accent-text')}
>
<Building2 className="w-4 h-4" />
Grupuj wg siłowni

View File

@@ -38,6 +38,8 @@ export function MonthPicker() {
}}
aria-haspopup="true"
aria-expanded={open}
/* telefon: rozciąga się między strzałkami na pełną szerokość panelu */
className="max-md:flex-1"
>
<Calendar className="w-4 h-4" />
{formatMonth(month)}

View File

@@ -38,6 +38,8 @@ function ActionButton({ action, onNavigate }: { action: TopbarAction; onNavigate
variant={action.variant ?? 'primary'}
disabled={action.disabled}
onClick={() => (action.to ? onNavigate(action.to) : action.onClick?.())}
/* telefon: panel grupy rozciąga opcje na pełną szerokość */
className="max-md:w-full"
>
{Icon && <Icon className="w-4 h-4" />}
{action.label}